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

Cache access token in unftp-sbe-gcs #435

Merged
merged 12 commits into from
Oct 14, 2022
Merged

Cache access token in unftp-sbe-gcs #435

merged 12 commits into from
Oct 14, 2022

Conversation

wgfm
Copy link
Contributor

@wgfm wgfm commented Oct 13, 2022

This PR implements caching for access tokens in the Google Cloud Storage backend.

I'm using an RwLock rather than a Mutex, since the token is read much more often than it's written.

If !433 is accepted, I will change the approach of this PR, since that will make it easier to pull the caching logic out of the CloudStorage struct, and into its own type.

I also changed the name of the workflow_identity module to workload_identity.

I still need to figure out how to properly test this. Any suggestions are welcome.

Resolves #384

@hannesdejager
Copy link
Collaborator

Very nice contribution thanks. It looks good to me although we need to think how to test this. @robklg any suggestions?

@wgfm
Copy link
Contributor Author

wgfm commented Oct 14, 2022

I just extracted the token cache into its own type, and tested that. It doesn't cover the changes I made in CloudStorage, but I'm confident that the caching logic works now.

crates/unftp-sbe-gcs/src/lib.rs Show resolved Hide resolved
crates/unftp-sbe-gcs/src/lib.rs Show resolved Hide resolved
crates/unftp-sbe-gcs/src/lib.rs Show resolved Hide resolved
@hannesdejager
Copy link
Collaborator

I just extracted the token cache into its own type, and tested that. It doesn't cover the changes I made in CloudStorage, but I'm confident that the caching logic works now.

We'll make an RC / Edge release and test it in the environment. If you're happy with this I'd like to merge it

@wgfm
Copy link
Contributor Author

wgfm commented Oct 14, 2022

I'm happy when you are. Feel free to merge.

@hannesdejager hannesdejager merged commit 772d6b7 into master Oct 14, 2022
@hannesdejager hannesdejager deleted the wh/just-cache branch October 14, 2022 12:16
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.

Cache the auth token for GCS backend
4 participants