Skip to content

Commit f7b0108

Browse files
committed
Fix up ContainerRegistry Authentication for OCI
Updates the ContainerRegistry authentication logic to work with OCI compliant registries like `ghcr.io`. The changes skip using the Azure environment credentials unless the bearer service ends with `.azurecr.io` as these tokens are only useful for ACR. The Azure AccessToken to Bearer token exchange is also simplified with an unecessary step removed. A new special prefix is used for the username when a credential represents an Azure AccessToken. This is necessary to ensure that only these specific types of credentials will use the Azure specific steps for authentication.
1 parent 73b90e3 commit f7b0108

5 files changed

Lines changed: 249 additions & 174 deletions

File tree

.ci/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
Write-Verbose -Verbose "Setting up secret for Azure Container Registry"
112112
$azt = Get-AzAccessToken
113113
$tenantId = $azt.TenantID
114-
Set-Secret -Name $tenantId -Secret $azt.Token -Verbose
114+
Set-Secret -Name "AzureAccessToken: $tenantId" -Secret $azt.Token -Verbose
115115
$vstsCommandString = "vso[task.setvariable variable=TenantId]$tenantId"
116116
Write-Host "sending " + $vstsCommandString
117117
Write-Host "##$vstsCommandString"

0 commit comments

Comments
 (0)