Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

adreed-msft
Copy link
Member

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.

release-pipeline.yml Outdated Show resolved Hide resolved
release-pipeline.yml Outdated Show resolved Hide resolved
release-pipeline.yml Outdated Show resolved Hide resolved
// Inputs

// EventSubscriber = func(OAuthTokenUpdate) EmptyResponse
type OAuthTokenUpdate struct {
Copy link
Member

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}")
Copy link
Member

@gapra-msft gapra-msft Oct 18, 2024

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?)

Copy link
Member

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

@vibhansa-msft vibhansa-msft modified the milestones: 10.27.0, 10.28.0 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants