-
Notifications
You must be signed in to change notification settings - Fork 4
IAM Test #173
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?
IAM Test #173
Conversation
token.isValid() more strict, removed more common.ThrowError calls
Code Coverage ReportTotal Coverage: 25.6% Details
|
| func CreateScopedTokenForEveryProject(projectNames []string) error { | ||
| var tokenError error | ||
| store := NewFileConfigStore() | ||
| tc := NewGopherTokenCreator() | ||
| for _, projectName := range projectNames { | ||
| GetScopedToken(projectName) | ||
| _, err := GetScopedToken(store, tc, projectName) // Getting tokens also caches them for later use | ||
| if err != nil { | ||
| return errors.Join(tokenError, err) | ||
| } | ||
| } | ||
| return nil | ||
| } |
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 function seems to have alot of side effects.
GetScopedToken also seems to write somewhere, which it really shouldn't do.
CreateScopedTokenForEveryProject should probably only create a map[string]string projectName -> Token and then there should be another function that actually saves these token to disk.
Adds tests for the IAM package