-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Disable identity for local mounts #4407
Conversation
if auth.Alias != nil { | ||
mEntry := c.router.MatchingMountEntry(req.Path) | ||
|
||
if auth.Alias != nil && mEntry != nil && !mEntry.Local { |
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.
You're missing the auth/token/renew path earlier on, which can also end up updating memberships.
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 left the renewal flow as it is to allow it to work if the tokens were created before this fix. The thought I had was to only disallow entity attachment for the newly created tokens.
@@ -329,6 +329,10 @@ func (i *IdentityStore) CreateOrFetchEntity(alias *logical.Alias) (*identity.Ent | |||
return nil, fmt.Errorf("invalid mount accessor %q", alias.MountAccessor) | |||
} | |||
|
|||
if mountValidationResp.MountLocal { |
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.
Shouldn't this happen later so that existing values are returned?
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.
It wouldn't matter. This function will not be called for the new tokens.
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.
OK, I just figured from the name (Create or Fetch) that it could end up creating new entities...which it can... :-)
No description provided.