-
Notifications
You must be signed in to change notification settings - Fork 1
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
move context to GetAccessToken function #2
Conversation
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.
Great work on this @iwysiu!
Do you think we should move the tokenprovider package to the pkg folder? If not, we should remove the pkg directory.
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.
LGTM!
tokenprovider/token_provider_gce.go
Outdated
func (source *gceSource) getCacheKey() string { | ||
return source.cacheKey | ||
} |
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.
I guess it's a matter of style but if both the function and the property are not exported, what's the point of defining the method?
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 was so tokenProviderImpl
could call it. Alternatively, cacheKey
could just be a string stored on tokenProviderImpl, but this felt neater.
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.
moved to pkg!
tokenprovider/token_provider_gce.go
Outdated
func (source *gceSource) getCacheKey() string { | ||
return source.cacheKey | ||
} |
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 was so tokenProviderImpl
could call it. Alternatively, cacheKey
could just be a string stored on tokenProviderImpl, but this felt neater.
Have context passed to GetAccessToken instead of the initialize functions