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

Fix retain runs auth. #1565

Merged
2 commits merged into from
Apr 21, 2021
Merged

Fix retain runs auth. #1565

2 commits merged into from
Apr 21, 2021

Conversation

mitchdenny
Copy link
Contributor

@mitchdenny mitchdenny commented Apr 20, 2021

This PR fixes the auth on the retains run script. The mistake I was making was assuming that the token that the devops API plumbing took was a straight access token when instead it is a base64(username:access_token) string.

@mitchdenny mitchdenny added EngSys This issue is impacting the engineering system. Central-EngSys This issue is owned by the Engineering System team. labels Apr 20, 2021
@mitchdenny mitchdenny self-assigned this Apr 20, 2021
@mitchdenny mitchdenny requested a review from a team as a code owner April 20, 2021 03:25
@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

)

$unencodedAuthToken = "nobody:$AccessToken"
$unencodedAuthTokenBytes = [System.Text.Encoding]::UTF8.GetBytes($unencodedAuthToken)
$encodedAuthToken = [System.Convert]::ToBase64String($unencodedAuthTokenBytes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set the encodedAuthToken as a secret value to ensure it doesn't get dumped out into the logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean? Is there a mechanism in PowerShell to declare a variable as as secret so it is masked out? Or are you suggesting emitting a ##vso secret variable so that Azure DevOps will mask it for us?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made this change, but I'm not entirely comfortable with it. I think that there is some exposure either way here. Fortunately in this context we are using $(System.AccessToken) which is relatively short lived.

@azure-sdk
Copy link
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

@ghost
Copy link

ghost commented Apr 21, 2021

Hello @azure-sdk!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit d43f7dc into Azure:master Apr 21, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team. EngSys This issue is impacting the engineering system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants