Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Default to service account auth #1831

Closed
bootstraponline opened this issue Apr 22, 2021 · 2 comments
Closed

Default to service account auth #1831

bootstraponline opened this issue Apr 22, 2021 · 2 comments

Comments

@bootstraponline
Copy link
Contributor

bootstraponline commented Apr 22, 2021

Author the user story for this feature

As a user, I want to run tests with the same credential as CI so I can have reproducible builds.

Describe the solution

Flank currently uses user auth and falls back to service credential authentication. We should consider the reverse.

https://github.com/Flank/flank/blob/458a12ed4a7b364f481101a749fbf0f7a408c8e8/test_runner/src/main/kotlin/ftl/adapter/google/Credentials.kt

I think there may be some historical context for why user auth is first, will be worth searching the old Flank issues/code to see if this has been discussed.

@adamfilipow92
Copy link
Contributor

adamfilipow92 commented May 21, 2021

I was checking some tickets related to the service account but I can't find any discussion about it. I think this change can potentially fix #1792. I will create pr asap

mergify bot pushed a commit that referenced this issue May 24, 2021
Fixes #1792 #1831 

This pr contains changes requested in #1831 and may fix #1792. 

## Test Plan
> How do we know the code works?

1. Flank firstly should try to use credentials from env variable ```GOOGLE_APPLICATION_CREDENTIALS``` [here](https://github.com/Flank/flank/blob/c643f859e053dfdb890170a087d783c23eacbb11/test_runner/src/main/kotlin/ftl/client/google/Credentials.kt#L22)
1. If this method fails Flank should try to load credentials from ```./user_home/.flank``` directory [here](https://github.com/Flank/flank/blob/c643f859e053dfdb890170a087d783c23eacbb11/test_runner/src/main/kotlin/ftl/client/google/Credentials.kt#L26) or if it's windows from ```%USER_HOME%/.config/gcloud/application_default_credentials.json``` [here](https://github.com/Flank/flank/blob/c643f859e053dfdb890170a087d783c23eacbb11/test_runner/src/main/kotlin/ftl/client/google/Credentials.kt#L34)
@adamfilipow92
Copy link
Contributor

Realized in: #1955.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants