-
Notifications
You must be signed in to change notification settings - Fork 2.8k
AWS, S3 Signing: Fix leaked credentials when contacting multiple catalogs #14178
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
base: main
Are you sure you want to change the base?
Conversation
FYI @nastra |
sessionCache = newSessionCache(name, properties); | ||
} | ||
|
||
String oauth2ServerUri = properties.get(OAuth2Properties.OAUTH2_SERVER_URI); |
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.
My rationale here is: two auth sessions for 2 different catalogs, but with the same credential, would be wrongly conflated since they would share the same cache key.
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.
isn't that a separate issue from the signer one?
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.
It's connected imo: in the original issue reported by @c-thiel, if both catalogs use the same credential we would still get a 401 from the second one without this change.
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.
is this something we could reproduce in a small test?
sessionCache = newSessionCache(name, properties); | ||
} | ||
|
||
String oauth2ServerUri = properties.get(OAuth2Properties.OAUTH2_SERVER_URI); |
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.
this should be falling back to ResourcePaths.tokens()
because this property is not mandatory
void standaloneTableSessionEmptyProperties() { | ||
Map<String, String> properties = Map.of(); | ||
Map<String, String> properties = | ||
Map.of(OAuth2Properties.OAUTH2_SERVER_URI, "https://auth-server.com/v1/token"); |
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.
I guess this can be reverted, since the test says "empty properties" and we should be falling back to the tokens endpoint if the property isn't specified
Map<String, String> tableProperties = | ||
Map.of( | ||
OAuth2Properties.OAUTH2_SERVER_URI, | ||
"https://auth-server.com/v1/token", |
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.
I don't think we should change this here and further below
Fixes #14100.