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

Device Code Migration to AzIdentity Track 2 #2747

Merged
merged 61 commits into from
Nov 1, 2024
Merged

Conversation

gapra-msft
Copy link
Member

@gapra-msft gapra-msft commented Jul 10, 2024

Resolves #2361

Note: We need to test with personal accounts right now.

gapra-msft and others added 30 commits May 10, 2024 09:18
@vibhansa-msft vibhansa-msft modified the milestones: 10.26.0, 10.27.0 Jul 24, 2024
@vibhansa-msft vibhansa-msft modified the milestones: 10.27.0, 10.28.0 Sep 18, 2024
Copy link
Member

@adreed-msft adreed-msft left a comment

Choose a reason for hiding this comment

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

Tests have some funk about them, but otherwise lgtm. If we don't do anything about it now, I'll go in and do some housekeeping on the testing framework when I get time in December.

return strings.Join(a.RawStdout(), "\n")
}

func RunAzCopyLoginLogout(a Asserter, verb AzCopyVerb) AzCopyStdout {
Copy link
Member

Choose a reason for hiding this comment

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

This is also interesting to me-- Is there a reason to prefer a separate function over integrating with RunAzCopy?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did this mostly because login needs some interactive stdout, whereas RunAzCopy is just reading the stdout. There is probably a clean way to integrate it with the other method. this can be cleaned this up after the PR is merged

@@ -337,8 +342,10 @@ func RunAzCopy(a ScenarioAsserter, commandSpec AzCopyCommand) (AzCopyStdout, *Az
0, command.ProcessState.ExitCode())

a.Cleanup(func(a ScenarioAsserter) {
UploadLogs(a, out, stderr, DerefOrZero(commandSpec.Environment.LogLocation))
_ = os.RemoveAll(DerefOrZero(commandSpec.Environment.LogLocation))
if !commandSpec.Environment.ManualLogin {
Copy link
Member

Choose a reason for hiding this comment

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

This also interests me-- I suspect this is to prevent capturing the login token, but, could we not filter that out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently the new e2e test framework is designed such that each of the scenarios creates a new temp log location. When you log in it creates a file in the log location and we want that log in to be the same across all e2e test framework logs, so we avoid removing the log folder. There is probably a cleaner way to do this that we can look into during a cleanup PR.

@gapra-msft gapra-msft changed the title Device Code Migration to AzIdentity Track 2 [Beta Feature] Device Code Migration to AzIdentity Track 2 Oct 18, 2024
@gapra-msft gapra-msft changed the title [Beta Feature] Device Code Migration to AzIdentity Track 2 Device Code Migration to AzIdentity Track 2 Nov 1, 2024
@gapra-msft gapra-msft merged commit ff026ff into main Nov 1, 2024
22 checks passed
@gapra-msft gapra-msft deleted the gapra/deviceLogin branch November 1, 2024 19:04
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.

Auto-login not persisting token when AZCOPY_AUTO_LOGIN_TYPE=DEVICE
4 participants