Skip to content

Conversation

@tokoko
Copy link

@tokoko tokoko commented Dec 6, 2025

PR changes role session name of temporary credentials generated for s3 to contain principal name. The goal is to simplify audit of storage access with credentials generated by Polaris. PolarisPrincipal is injected in StorageAccessConfigProvider, used as part of a cache key and then value propagated through the call chain. Azure and Gcp integration classes also accept PolarisPrincipal, but the values are ignored for now.

This will probably also result in relatively increased amount of sts calls as credential requests for the same table by different principals will no longer hit the same cache.

Fixes #3196

Checklist

  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, @tokoko !

Overall the PR looks pretty good to me with some comments as noted below.

Given that it affects credential vending, I'd propose to also send a dev email about it for visibility (a custom for major changes in Polaris). Also, a CHANGELOG entry would be good to have for this.

@dimas-b dimas-b changed the title feat: pass principal name as part of aws subscoped credentials sessio… feat: pass principal name as part of aws subscoped credentials session Dec 8, 2025
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Hi @tokoko : I think this PR is moving closer to completion. I have some more comments, but conceptually this PR LGTM 👍

@dimas-b
Copy link
Contributor

dimas-b commented Dec 8, 2025

CI appears to be stuck 🤷

dimas-b
dimas-b previously approved these changes Dec 8, 2025
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks, @tokoko ! From my POV the PR looks good, but let's collect some more reviews as it's a pretty fundamental change.

.put("polaris.features.\"ALLOW_TABLE_LOCATION_OVERLAP\"", "true")
.put("polaris.features.\"LIST_PAGINATION_ENABLED\"", "true")
.put("polaris.behavior-changes.\"ALLOW_NAMESPACE_CUSTOM_LOCATION\"", "true")
.put("polaris.test.rootAugmentor.enabled", "true")
Copy link
Contributor

Choose a reason for hiding this comment

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

@adutra : do you have any comment on this? As for me, I'm ok with this approach, as I do not have a better alternative off the top of my head 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can achieve the same by simply producing this bean from this profile class:

public static class Profile extends Profiles.DefaultProfile {
  @Override public Map<String, String> getConfigOverrides() {...}
  
  @Produces @RequestScoped produceTestAugmentor() { return new RootPrincipalAugmentor(...); }
}

But the current approach is fine too.

Copy link
Author

Choose a reason for hiding this comment

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

The idea was to change it later from a simple toggle to something that will hold more information. Something like polaris.test.augmentor.identity: test_principal:test_principal_role. I ended up not requiring it, but it could still come in handy later...

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good 👍

pinging @XN137 for awareness since I vaguely recall you were working on turning a bunch of manual setup code into proper Quarkus tests with CDI enabled.

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Dec 8, 2025
.put("polaris.features.\"ALLOW_TABLE_LOCATION_OVERLAP\"", "true")
.put("polaris.features.\"LIST_PAGINATION_ENABLED\"", "true")
.put("polaris.behavior-changes.\"ALLOW_NAMESPACE_CUSTOM_LOCATION\"", "true")
.put("polaris.test.rootAugmentor.enabled", "true")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can achieve the same by simply producing this bean from this profile class:

public static class Profile extends Profiles.DefaultProfile {
  @Override public Map<String, String> getConfigOverrides() {...}
  
  @Produces @RequestScoped produceTestAugmentor() { return new RootPrincipalAugmentor(...); }
}

But the current approach is fine too.

Copy link
Contributor

@adnanhemani adnanhemani left a comment

Choose a reason for hiding this comment

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

LGTM, two nits that don't require a code change but would be quick and easy to do if there is another revision :)

Copy link
Contributor

@adnanhemani adnanhemani left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this great contribution!!

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.

Pass principal name as part of aws subscoped credentials session name

4 participants