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: subject expansion is terminated unexpectedly #1256

Merged
merged 4 commits into from
Feb 27, 2023

Conversation

stonelgh
Copy link
Contributor

@stonelgh stonelgh commented Feb 24, 2023

This change fixes the issue that subject expansion will fail if the depth exceeds 2.

Related issue(s)

closes #1255

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Thanks a lot, very nice find 👍

Comment on lines +140 to +145
sub := &relationtuple.SubjectSet{
Namespace: result.To.Namespace,
Object: result.To.Object,
Relation: result.To.Relation,
}
innerCtx, visited = graph.CheckAndAddVisited(innerCtx, sub)
Copy link
Member

Choose a reason for hiding this comment

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

Good catch, at this point result.To.Subject is the same for all results:

to.Subject = start.Subject

@zepatrik zepatrik changed the title fix: subject expansion is terminated unexpectedly (#1255) fix: subject expansion is terminated unexpectedly Feb 24, 2023
Copy link
Collaborator

@hperl hperl left a comment

Choose a reason for hiding this comment

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

Very nice, thanks! 🎉

@hperl hperl enabled auto-merge February 27, 2023 08:38
@hperl hperl added this pull request to the merge queue Feb 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2023
@zepatrik zepatrik merged commit f88a479 into ory:master Feb 27, 2023
@stonelgh stonelgh deleted the fix/subject-expansion branch February 27, 2023 09:41
@vinckr
Copy link
Member

vinckr commented Mar 1, 2023

Hello @stonelgh
Congrats on merging your first PR in Ory 🎉 !
Your contribution will soon be helping secure millions of identities around the globe 🌏.
As a small token of appreciation we send our first time contributors a gift package to welcome them to the community.
Please drop me an email and I will forward you the form to claim your Ory swag!

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.

Subject expansion failed when depth exceeds 2
4 participants