Skip to content
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

Merged
merged 1 commit into from
May 17, 2023
Merged

Fix Public Link Path matching #3892

merged 1 commit into from
May 17, 2023

Conversation

kobergj
Copy link
Contributor

@kobergj kobergj commented May 16, 2023

Fixes matching of pathes when resolving public links.

We need another GetPath call to get the necessary information.

if childStat.Status.Code != rpc.Code_CODE_OK {
return false, statuspkg.NewErrorFromCode(childStat.Status.Code, "auth interceptor")
}
childPath = statResponse.Info.Path
Copy link
Contributor Author

@kobergj kobergj May 16, 2023

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

@kobergj kobergj marked this pull request as ready for review May 16, 2023 13:38
@kobergj kobergj requested review from labkode, ishank011, glpatcern and a team as code owners May 16, 2023 13:38
// 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? ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂 …

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😞

Copy link
Member

@micbar micbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Catch!

@kobergj kobergj merged commit 2bd4810 into cs3org:edge May 17, 2023
@kobergj kobergj deleted the FixPublicLinks branch May 17, 2023 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants