fix: fix auth flow when creating project with access token - #1521
fix: fix auth flow when creating project with access token#1521SerseusWasTaken wants to merge 2 commits into
Conversation
Relates to STACKITTPR-761
Relates to STACKITTPR-761
Merging this branch changes the coverage (1 decrease, 1 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
|
|
||
| func GetAuthFlow() (AuthFlow, error) { | ||
| if accessToken := os.Getenv(envAccessTokenName); accessToken != "" { | ||
| return AUTH_FLOW_SERVICE_ACCOUNT_TOKEN, nil |
There was a problem hiding this comment.
I'm not quite sure about this one. Decisions on which AuthFlow to use seem to be done in functions where SetAuthFlow() is called.
What's the reason to include this change?
There was a problem hiding this comment.
My intention was to guarantee that the access token is used when it is set. Before, it as possible to have the token set and still be treated unauthenticated by the CLI which why the original issue came up. I personally don't see a reason not to use the token when it is set.
With this change, GetAuthFlow is now aware of the token's existence. Does that make sense?
Description
Fixes the auth flow for creating projects to be able to use STACKIT_ACCESS_TOKEN for project creation
Relates to STACKITTPR-761 and #1478
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)