-
Notifications
You must be signed in to change notification settings - Fork 113
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 Public Link Path matching #3892
Conversation
Signed-off-by: jkoberg <[email protected]>
if childStat.Status.Code != rpc.Code_CODE_OK { | ||
return false, statuspkg.NewErrorFromCode(childStat.Status.Code, "auth interceptor") | ||
} | ||
childPath = statResponse.Info.Path |
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.
NOTE this was an (unknown) critical bug.
parentPath := statResponse.Info.Path
( ... )
childPath = statResponse.Info.Path
( ... )
return strings.HasPrefix(childPath, parentPath), nil
// The request is not relative to the root. We need to find out if the requested resource is child of the `parent` (coming from token scope) | ||
// We mint a token as the owner of the public share and try to stat the reference | ||
// TODO(ishank011): We need to find a better alternative to this | ||
// NOTE: did somebody say service accounts? ... |
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.
😄
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.
😂 …
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.
😞
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.
Nice Catch!
Fixes matching of pathes when resolving public links.
We need another
GetPath
call to get the necessary information.