Repository navigation
TIKA-5006: Support web identity (IRSA) credentials in the S3 plugin - #3439
Conversation
On EKS, pods get AWS access through IAM roles for service accounts (IRSA). The pod is given a web identity token, with AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE set in its environment. The S3 plugin only supports instance, profile and key_secret, so there's no way to use the pod's role. Using instance picks up the node's role instead. This adds an `identity` credentialsProvider to the fetcher, emitter and pipes iterator, backed by the SDK's WebIdentityTokenFileCredentialsProvider. Additionally: * Added the sts module. The web identity provider needs it to exchange the token for credentials, but doesn't look for it until the first request. Without it, the fetcher builds fine and then fails on its first fetch. * Moved the fetcher's provider selection into buildCredentialsProvider, like the emitter has, so it can be tested without AWS.
|
Thank you for opening this. Let me know what you think of my robot's feedback: |
|
My bot was racing your PR, I can share what it came up with wrt "my" if that'd be of any use. |
|
@tballison Thanks! For context, we had forked apache/tika back when tika-pipes was its own project (via @nddipiazza's effort to support work we were doing there) and added the Regarding your machine's feedback, I pushed 3 fixup commits addressing these points:
On items like:
I suppose it's your call? A machine could easily add a helper and refactor, but want to keep the PR scope small. And:
Happy to amend if this is the right PR for it. And finally:
I feel |
|
Awesome. I don't see any pushes? |
|
@tballison Apologies; just pushed. |
|
Would it shock your conscience for me to change identity to |
I have no issue with that :) I was trying to keep things close to what exists. The machine makes a good point wrt |
|
@tballison Appreciate the fast turn around here! We'll validate this end to end under apache/tika as we migrate away from our fork. |
|
Thank you. Please let us know if https://issues.apache.org/jira/browse/TIKA-5001 breaks anything for you. Also, please, please, please chime in on the work by @krickert and @dpol1 to use more typed objects in our protos (v2!) than all the strings we're using now. |
I would love to talk about it more or create a poc ( Davide already had a demo with storm crawler) I'd like to demo how an SPI jar can add a grpc parser I just did the grpc server "fastwarc-grpc" cargo crate in rust. It's an insanely fast warc parser. I wrote that to hope to use in tika. |
On EKS, pods get AWS access through IAM roles for service accounts (IRSA). The pod is given a web identity token, with AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE set in its environment. The S3 plugin only supports instance, profile and key_secret, so there's no way to use the pod's role. Using instance picks up the node's role instead.
This adds an
identitycredentialsProvider to the fetcher, emitter and pipes iterator, backed by the SDK's WebIdentityTokenFileCredentialsProvider.Additionally: