Skip to content

azureauth ado token command returns PAT's which seems unexpected #422

@dggsax

Description

@dggsax

There's logic in the azureauth ado token command that checks for environment variables AZUREAUTH_ADO_PAT and SYSTEM_ACCESSTOKEN.

// First attempt using a PAT.
var pat = PatFromEnv.Get(env);
if (pat.Exists)
{
logger.LogDebug($"Using PAT from env var {pat.EnvVarSource}");
logger.LogInformation(FormatToken(pat.Value, this.Output, Authorization.Basic));
return 0;
}

While returning SYSTEM_ACCESSTOKEN makes sense, I was surprised to see it returning the PAT variable if it's set, which was a little unexpected given the token subcommand. I did see a case for one of our customers where SYSTEM_ACCESSTOKEN was set to a PAT which also is unexpected.

Perhaps there could be a flag for the command to ignore environment variables?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions