Skip to content

Commit

Permalink
Always forward entity merge requests from perfStandby (#24325)
Browse files Browse the repository at this point in the history
Update requests to /sys/identity/entity/merge perform merges on perfStandby nodes in memory and skip the persist call.

This commit changes the behavior for the merge endpoint, forcing it to be forwarded from the standby to the active node. This change is specifically scoped to manual merges, as automatic merges are not isolated to a specific endpoint and require careful consideration for all callers.
  • Loading branch information
mpalmi authored and elliesterner committed Dec 1, 2023
1 parent 16af5e6 commit 8f305f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog/24325.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:change
identity (enterprise): POST requests to the `/identity/entity/merge` endpoint
are now always forwarded from standbys to the active node.
```
7 changes: 5 additions & 2 deletions vault/identity_store_entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ func entityPaths(i *IdentityStore) []*framework.Path {
Description: "Setting this will follow the 'mine' strategy for merging MFA secrets. If there are secrets of the same type both in entities that are merged from and in entity into which all others are getting merged, secrets in the destination will be unaltered. If not set, this API will throw an error containing all the conflicts.",
},
},
Callbacks: map[logical.Operation]framework.OperationFunc{
logical.UpdateOperation: i.pathEntityMergeID(),
Operations: map[logical.Operation]framework.OperationHandler{
logical.UpdateOperation: &framework.PathOperation{
Callback: i.pathEntityMergeID(),
ForwardPerformanceStandby: true,
},
},

HelpSynopsis: strings.TrimSpace(entityHelp["entity-merge-id"][0]),
Expand Down

0 comments on commit 8f305f7

Please sign in to comment.