-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix client#removeGroupMemberships parameter order #51
Fix client#removeGroupMemberships parameter order #51
Conversation
I wasn't able to see the following Azure error in the audit logs `warnings` field. It looks as though even though the request to Azure fails, when the Azure app is removed the group memberships are still cleaned up. I was only able to see the error below by adding a log line to print the error when revoke is called. ``` 1 error occurred: * error removing group membership: graphrbac.GroupsClient#RemoveMember: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="Unknown" Message="Unknown service error" Details=[{"odata.error":{"code":"Request_ResourceNotFound","date":"2020-10-23T20:32:14","message":{"lang":"en","value":"Resource 'c1004989-2986-48e8-9e2e-aa03b7cacbc1' does not exist or one of its queried reference-property objects are not present."},"requestId":"a2d4d4c6-4e0a-4ea2-a807-16486c307d03"}}] : timestamp=2020-10-23T14:32:14.604-0600 ```
client.go
Outdated
@@ -302,7 +302,7 @@ func (c *client) removeGroupMemberships(ctx context.Context, servicePrincipalObj | |||
var merr *multierror.Error | |||
|
|||
for _, id := range groupIDs { | |||
if _, err := c.provider.RemoveGroupMember(ctx, servicePrincipalObjectID, id); err != nil { | |||
if _, err := c.provider.RemoveGroupMember(ctx, id, servicePrincipalObjectID); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref to RemoveGroupMember -
vault-plugin-secrets-azure/provider.go
Line 41 in 6544951
RemoveGroupMember(ctx context.Context, groupObjectID, memberObjectID string) (result autorest.Response, err error) |
I came across this working on an implementation of #50 with our internal fork. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize it's been a while on this one, but it makes sense to fix the parameter order. Thanks, @mdgreenfield!
I wasn't able to see the following Azure error in the audit logs
warnings
field. It looks as though even though the request to Azurefails, when the Azure app is removed the group memberships are still
cleaned up.
I was only able to see the error below by adding a log line to print the
error when revoke is called.
With that said, I think it begs the question whether or not calling
removeGroupMemberships
should even be called on revoke.