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

feature: process nested tag claims #6

Conversation

pvbouwel
Copy link
Contributor

feature: process nested tag claims

Allow IDPs to provide session tags via the nested format.

This is for #4

As a bonus it also has feature: implement the Deny effect for policies

Which allowed to create a test case that simulates a scenario where this could be of value.

At this time there are not yet trust policies but since OIDC providers are configured the trust is configured towards OIDC providers. You just cannot distinguish trust on a per role level. For that trust policies are needed which is significantly more work and that could be another future improvement (which will be needed once an sts action like assumeRole gets implemented)

Peter Van Bouwel added 2 commits November 16, 2024 13:01
feature: process nested tag claims

Allow IDPs to provide sessiont tags via the nested format.

This is for VITObelgium#4
A convoluted way was created where a stub is created that always returns an error and where the return value is encapsulated in the error message. Given to how error message are build it was tricky to extract them and while this case worked for most actions it did not work for HeadObject.

Given that these unittest just run in one execution environment it is easier to just introduce a global which gets updated by the stub. So after calling the stub the global will contain the created value. So this approach is easier and more reliable.

Since our stub is called by anonymous requests we should not use session data with valid tags as it makes the tests a bit confusing so changed those.
@pvbouwel pvbouwel merged commit b124d58 into VITObelgium:main Nov 20, 2024
4 checks passed
@pvbouwel pvbouwel deleted the feature/issue4_session_tags_nested_claim_format branch November 20, 2024 10:18
pvbouwel pushed a commit to pvbouwel/fakes3pp that referenced this pull request Dec 6, 2024
Policies that were using nested claims were not working as expected because the nested claims that were asserted by the IDP were not passed on.

This commit adds test coverage for scenario where IDP claims are in a web identity token which gets exchangd for AWS credentials which are then used and evaluated in a policy.

It also covers the case where the tags are not povided by the IDP. In those cases an internal error was thrown but it is a valid case and instead an Access Denied mus be returned.

This is needed to make  VITObelgium#6 actually work
pvbouwel added a commit that referenced this pull request Dec 6, 2024
* bugfix: embed IDP nested claims in credentials

Policies that were using nested claims were not working as expected because the nested claims that were asserted by the IDP were not passed on.

This commit adds test coverage for scenario where IDP claims are in a web identity token which gets exchangd for AWS credentials which are then used and evaluated in a policy.

It also covers the case where the tags are not povided by the IDP. In those cases an internal error was thrown but it is a valid case and instead an Access Denied mus be returned.

This is needed to make  #6 actually work

* fmt: no spaces

---------

Co-authored-by: Peter Van Bouwel <[email protected]>
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.

1 participant