-
Notifications
You must be signed in to change notification settings - Fork 222
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
Allow AzCopy to receive OAuth tokens via GRPC for internal integrations #2778
base: main
Are you sure you want to change the base?
Conversation
0510b55
to
6ca14e2
Compare
6ca14e2
to
d5386b2
Compare
// Inputs | ||
|
||
// EventSubscriber = func(OAuthTokenUpdate) EmptyResponse | ||
type OAuthTokenUpdate struct { |
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.
Why not just reference the one in common?
"regexp" | ||
) | ||
|
||
var ormetadataregex = regexp.MustCompile("((([A-F]|[a-f]|[0-9])+-?)+_?){2}") |
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 isn't necessary anymore right? (This was fixed in the SDK I'm assuming?)
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.
Also all the related changes in ste
adds functionality to receive OAuth tokens over a HTTP/1.1 or HTTP/2 grpc message.
All functionality is behind a compile tag,
grpc
.The token is shot in at about once per minute in the currently used integration. Requests trying to get an OAuth token pull a read lock on an RWMutex, and if the token is expired when the read is pulled, they wait up to 3x the validity of the last OAuth token for a fresh one. If no OAuth token is ever received within that timespan, it gives up, and signals to other requests to stop trying.
Injected tokens pull a write lock on the same RWMutex, and signals the
sync.Cond
to inform the requests waiting on a token a fresh one may be available.