From a5bf384c2882bfa952425a4c823bd1d56672f38e Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Fri, 19 Mar 2021 21:19:02 -0700 Subject: [PATCH 01/10] add challenge-based auth policy --- .../ContainerRegistryCredentialsPolicy.cs | 145 +++++ .../Azure.Containers.ContainerRegistry.csproj | 4 +- .../src/ContainerRegistryClient.cs | 24 +- .../Repositories/ContainerRepositoryClient.cs | 31 +- .../Temporary/BasicAuthenticationPolicy.cs | 53 -- ....Containers.ContainerRegistry.Tests.csproj | 6 + .../tests/ContainerRegistryClientLiveTests.cs | 4 +- .../ContainerRegistryRecordedTestSanitizer.cs | 64 ++ .../tests/ContainerRegistryTestEnvironment.cs | 2 - .../ContainerRepositoryClientLiveTests.cs | 79 ++- ...ntainerRegistryClientSamples.HelloWorld.cs | 32 - .../CanGetRepositories.json | 135 +++- .../CanGetRepositoriesAsync.json | 135 +++- .../CanDeleteTag.json | 265 +++++++- .../CanDeleteTagAsync.json | 265 +++++++- .../CanGetRepositoryProperties.json | 144 ++++- .../CanGetRepositoryPropertiesAsync.json | 144 ++++- .../CanGetTagProperties.json | 147 ++++- .../CanGetTagPropertiesAsync.json | 147 ++++- .../CanSetRepositoryProperties.json | 596 +++++++++++++++-- .../CanSetRepositoryPropertiesAsync.json | 596 +++++++++++++++-- .../CanSetTagProperties.json | 608 ++++++++++++++++-- .../CanSetTagPropertiesAsync.json | 608 ++++++++++++++++-- ...earerTokenChallengeAuthenticationPolicy.cs | 15 + 24 files changed, 3814 insertions(+), 435 deletions(-) create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs delete mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Temporary/BasicAuthenticationPolicy.cs create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryRecordedTestSanitizer.cs delete mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Samples/ContainerRegistryClientSamples.HelloWorld.cs diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs new file mode 100644 index 000000000000..3d8e80ad9673 --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Containers.ContainerRegistry +{ + /// + /// Challenge-based authentication policy for Container Registry Service. + /// + /// The challenge-based authorization flow is illustrated in the following steps. + /// For example, GET /api/v1/acr/repositories translates into the following calls. + /// + /// Step 1: GET /api/v1/acr/repositories + /// Return Header: 401: www-authenticate header - Bearer realm="{url}",service="{serviceName}",scope="{scope}",error="invalid_token" + /// + /// Step 2: Retrieve the serviceName, scope from the WWW-Authenticate header. (Parse the string.) + /// + /// Step 3: POST /api/oauth2/exchange + /// Request Body : { service, scope, grant-type, aadToken with ARM scope } + /// Response Body: { acrRefreshToken } + /// + /// Step 4: POST /api/oauth2/token + /// Request Body: { acrRefreshToken, scope, grant-type } + /// Response Body: { acrAccessToken } + /// + /// Step 5: GET /api/v1/acr/repositories + /// Request Header: { Bearer acrTokenAccess } + /// + internal class ContainerRegistryCredentialsPolicy : BearerTokenChallengeAuthenticationPolicy + { + private readonly RefreshTokensRestClient _exchangeRestClient; + private readonly AccessTokensRestClient _tokenRestClient; + + public ContainerRegistryCredentialsPolicy(TokenCredential credential, string aadScope, RefreshTokensRestClient exchangeRestClient, AccessTokensRestClient tokenRestClient) + : base(credential, aadScope) + { + Argument.AssertNotNull(credential, nameof(credential)); + Argument.AssertNotNull(aadScope, nameof(aadScope)); + + _exchangeRestClient = exchangeRestClient; + _tokenRestClient = tokenRestClient; + } + + protected override async ValueTask AuthenticateRequestOnChallengeAsync(HttpMessage message, bool async) + { + // Once we're here, we've completed Step 1. + + // Step 2: Parse challenge string to retrieve serviceName and scope, where scope is the ACR Scope + var service = AuthorizationChallengeParser.GetChallengeParameterFromResponse(message.Response, "Bearer", "service"); + var scope = AuthorizationChallengeParser.GetChallengeParameterFromResponse(message.Response, "Bearer", "scope"); + + string acrAccessToken = string.Empty; + var aadTokenRequestContext = new TokenRequestContext(Scopes, message.Request.ClientRequestId); + if (async) + { + // Step 3: Exchange AAD Access Token for ACR Refresh Token + string acrRefreshToken = await ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, aadTokenRequestContext, true).ConfigureAwait(false); + + // Step 4: Send in acrRefreshToken and get back acrAccessToken + acrAccessToken = await ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, true).ConfigureAwait(false); + } + else + { + // Step 3: Exchange AAD Access Token for ACR Refresh Token + string acrRefreshToken = ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, aadTokenRequestContext, false).EnsureCompleted(); + + // Step 4: Send in acrRefreshToken and get back acrAccessToken + acrAccessToken = ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, false).EnsureCompleted(); + } + + // Step 5 - Authorize Request. Note, we don't use SetAuthorizationHeader here, because it + // sets an AAD access token header, and at this point we're done with AAD and using an ACR access token. + message.Request.Headers.SetValue(HttpHeader.Names.Authorization, $"Bearer {acrAccessToken}"); + + return true; + } + + private async Task ExchangeAadAccessTokenForAcrRefreshTokenAsync(HttpMessage message, string service, TokenRequestContext context, bool async) + { + string aadAuthHeader = await GetAuthorizationHeader(message, context, async).ConfigureAwait(false); + string aadAccessToken = aadAuthHeader.Remove(0, "Bearer ".Length); + + Response acrRefreshToken = null; + if (async) + { + acrRefreshToken = await _exchangeRestClient.GetFromExchangeAsync( + PostContentSchemaGrantType.AccessToken, + service, + accessToken: aadAccessToken).ConfigureAwait(false); + } + else + { + acrRefreshToken = _exchangeRestClient.GetFromExchange( + PostContentSchemaGrantType.AccessToken, + service, + accessToken: aadAccessToken); + } + + return acrRefreshToken.Value.RefreshTokenValue; + } + + private async Task ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string acrRefreshToken, string service, string scope, bool async) + { + Response acrAccessToken = null; + if (async) + { + acrAccessToken = await _tokenRestClient.GetAsync(service, scope, acrRefreshToken).ConfigureAwait(false); + } + else + { + acrAccessToken = _tokenRestClient.Get(service, scope, acrRefreshToken); + } + + return acrAccessToken.Value.AccessTokenValue; + } + + private static Dictionary ParseChallengeValues(HttpMessage message) + { + string bearerValue = string.Empty; + string challenge = string.Empty; + if (message.Response.Headers.TryGetValue(HttpHeader.Names.WwwAuthenticate, out bearerValue)) + { + if (bearerValue.StartsWith("Bearer ", StringComparison.InvariantCulture)) + { + challenge = bearerValue.Remove(0, "Bearer ".Length); + } + } + + string[] elements = challenge.Split(','); + Dictionary challengeValues = new Dictionary(); + foreach (var element in elements) + { + string[] keyAndValue = element.Split('='); + challengeValues[keyAndValue[0]] = keyAndValue[1].Trim('"'); + } + + return challengeValues; + } + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj index 811a3eb0c4ba..230c546c6165 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj @@ -1,4 +1,4 @@ - + Microsoft Azure.Containers.ContainerRegistry client library @@ -15,7 +15,9 @@ + + diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs index 34c907f9cd82..744a017bc3f7 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs @@ -19,25 +19,31 @@ public partial class ContainerRegistryClient private readonly ClientDiagnostics _clientDiagnostics; private readonly ContainerRegistryRestClient _restClient; + private readonly RefreshTokensRestClient _tokenExchangeClient; + private readonly AccessTokensRestClient _acrTokenClient; + private readonly string AcrAadScope = "https://management.core.windows.net/.default"; + /// - /// /// - public ContainerRegistryClient(Uri endpoint, string username, string password) : this(endpoint, username, password, new ContainerRegistryClientOptions()) + public ContainerRegistryClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new ContainerRegistryClientOptions()) { } /// /// - /// - /// - /// - /// - public ContainerRegistryClient(Uri endpoint, string username, string password, ContainerRegistryClientOptions options) + public ContainerRegistryClient(Uri endpoint, TokenCredential credential, ContainerRegistryClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(options, nameof(options)); + Argument.AssertNotNull(credential, nameof(credential)); + + // TODO: Solve: + // 1. What pipeline to use for RefreshTokensRestClient - how to reason about this from a customer perspective? + // 2. Is it ok that we share a ClientDiagnostics type? + + _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); + _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); - _pipeline = HttpPipelineBuilder.Build(options, new BasicAuthenticationPolicy(username, password)); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); _clientDiagnostics = new ClientDiagnostics(options); diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs index 824eb90602bb..a1ba9fbe9776 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs @@ -16,6 +16,10 @@ public partial class ContainerRepositoryClient private readonly ClientDiagnostics _clientDiagnostics; private readonly ContainerRegistryRepositoryRestClient _restClient; + private readonly RefreshTokensRestClient _tokenExchangeClient; + private readonly AccessTokensRestClient _acrTokenClient; + private readonly string AcrAadScope = "https://management.core.windows.net/.default"; + private readonly string _repository; /// @@ -23,31 +27,26 @@ public partial class ContainerRepositoryClient public virtual Uri Endpoint { get; } /// - /// - /// Name of the image (including the namespace). - /// - /// /// - public ContainerRepositoryClient(Uri endpoint, string repository, string username, string password) : this(endpoint, repository, username, password, new ContainerRegistryClientOptions()) + public ContainerRepositoryClient(Uri endpoint, string repository, TokenCredential credential) : this(endpoint, repository, credential, new ContainerRegistryClientOptions()) { } /// - /// - /// Name of the image (including the namespace). - /// - /// - /// /// - public ContainerRepositoryClient(Uri endpoint, string repository, string username, string password, ContainerRegistryClientOptions options) + public ContainerRepositoryClient(Uri endpoint, string repository, TokenCredential credential, ContainerRegistryClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); - Argument.AssertNotNull(repository, nameof(repository)); - Argument.AssertNotNull(username, nameof(username)); - Argument.AssertNotNull(password, nameof(password)); - Argument.AssertNotNull(options, nameof(options)); + Argument.AssertNotNull(credential, nameof(credential)); + + // TODO: Solve: + // 1. What pipeline to use for RefreshTokensRestClient - how to reason about this from a customer perspective? + // 2. Is it ok that we share a ClientDiagnostics type? + + _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); + _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); - _pipeline = HttpPipelineBuilder.Build(options, new BasicAuthenticationPolicy(username, password)); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); _clientDiagnostics = new ClientDiagnostics(options); diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Temporary/BasicAuthenticationPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Temporary/BasicAuthenticationPolicy.cs deleted file mode 100644 index f3e525f663a1..000000000000 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Temporary/BasicAuthenticationPolicy.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.Containers.ContainerRegistry -{ - /// - /// This method of authentication is being deprecated by the service. It is included here to unblock client development - /// while the feature crew works on the correct auth policies for this service. - /// - internal class BasicAuthenticationPolicy : HttpPipelinePolicy - { - private string _userName; - private string _password; - - public BasicAuthenticationPolicy(string userName, string password) - { - _userName = userName; - _password = password; - } - - public override void Process(HttpMessage message, ReadOnlyMemory pipeline) - { - ProcessAsync(message, pipeline, false).EnsureCompleted(); - } - - public override ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline) - { - return ProcessAsync(message, pipeline, true); - } - - private async ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline, bool async) - { - var valueBytes = Encoding.UTF8.GetBytes($"{_userName}:{_password}"); - message.Request.Headers.SetValue(HttpHeader.Names.Authorization, $"Basic {Convert.ToBase64String(valueBytes)}"); - - if (async) - { - await ProcessNextAsync(message, pipeline).ConfigureAwait(false); - } - else - { - ProcessNext(message, pipeline); - } - } - } -} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Azure.Containers.ContainerRegistry.Tests.csproj b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Azure.Containers.ContainerRegistry.Tests.csproj index 67663b70a463..cc6d3c8a810f 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Azure.Containers.ContainerRegistry.Tests.csproj +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Azure.Containers.ContainerRegistry.Tests.csproj @@ -16,4 +16,10 @@ + + + + ..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7\System.Web.dll + + diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryClientLiveTests.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryClientLiveTests.cs index 9c61307d0167..c73dabb67515 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryClientLiveTests.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryClientLiveTests.cs @@ -12,14 +12,14 @@ public class ContainerRegistryClientLiveTests : RecordedTestBase FormEncodedBodySanitizers { get; } = new List(); + + public ContainerRegistryRecordedTestSanitizer() + : base() + { + JsonPathSanitizers.Add("$..access_token"); + JsonPathSanitizers.Add("$..refresh_token"); + + FormEncodedBodySanitizers.Add("access_token"); + FormEncodedBodySanitizers.Add("refresh_token"); + } + + public override string SanitizeTextBody(string contentType, string body) + { + string jsonSanitizedBody = base.SanitizeTextBody(contentType, body); + + if (FormEncodedBodySanitizers.Count == 0) + { + return jsonSanitizedBody; + } + + try + { + if (contentType == "application/x-www-form-urlencoded") + { + string urlEncodedSanitizedBody = string.Empty; + + NameValueCollection queryParams = HttpUtility.ParseQueryString(jsonSanitizedBody); + for (int i = 0; i < queryParams.Keys.Count; i++) + { + string key = queryParams.Keys[i].ToString(); + foreach (string paramToSanitize in FormEncodedBodySanitizers) + { + if (key == paramToSanitize) + { + queryParams[key] = SanitizeValue; + } + } + } + + return queryParams.ToString(); + } + + return jsonSanitizedBody; + } + catch + { + return jsonSanitizedBody; + } + } + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryTestEnvironment.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryTestEnvironment.cs index 24e7f9720caa..73699b8e5a3b 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryTestEnvironment.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryTestEnvironment.cs @@ -11,7 +11,5 @@ public class ContainerRegistryTestEnvironment : TestEnvironment public string UserName => GetRecordedVariable("CONTAINERREGISTRY_USERNAME", options => options.IsSecret()); public string Password => GetRecordedVariable("CONTAINERREGISTRY_PASSWORD", options => options.IsSecret()); public string Registry => GetRecordedVariable("CONTAINERREGISTRY_REGISTRY_NAME"); - - public bool IsTestModeLive => this.Mode != RecordedTestMode.Playback; } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs index d5d91d5fabc4..409140013d69 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs @@ -3,9 +3,7 @@ using System; using System.Collections.Generic; - using Azure.Core.TestFramework; - using Microsoft.Azure.Management.ContainerRegistry; using Microsoft.Azure.Management.ContainerRegistry.Models; using Microsoft.Azure.Management.ResourceManager.Fluent; @@ -21,6 +19,7 @@ public class ContainerRepositoryClientLiveTests : RecordedTestBase() { - Mode = ImportMode.Force, - Source = importSource, - TargetTags = new List() - { $"library/hello-world:{tag}" - } - }); - } + } + }); } [RecordedTest] @@ -98,8 +93,8 @@ public async Task CanSetRepositoryProperties() await client.SetPropertiesAsync( new ContentProperties() { - CanList = false, - CanRead = false, + CanList = true, + CanRead = true, CanWrite = false, CanDelete = false, }); @@ -107,8 +102,8 @@ await client.SetPropertiesAsync( // Assert RepositoryProperties properties = await client.GetPropertiesAsync(); - Assert.IsFalse(properties.WriteableProperties.CanList); - Assert.IsFalse(properties.WriteableProperties.CanRead); + Assert.IsTrue(properties.WriteableProperties.CanList); + Assert.IsTrue(properties.WriteableProperties.CanRead); Assert.IsFalse(properties.WriteableProperties.CanWrite); Assert.IsFalse(properties.WriteableProperties.CanDelete); @@ -148,8 +143,8 @@ await client.SetTagPropertiesAsync( { CanList = false, CanRead = false, - CanWrite = false, - CanDelete = false + CanWrite = true, + CanDelete = true }); // Assert @@ -157,8 +152,8 @@ await client.SetTagPropertiesAsync( Assert.IsFalse(properties.ModifiableProperties.CanList); Assert.IsFalse(properties.ModifiableProperties.CanRead); - Assert.IsFalse(properties.ModifiableProperties.CanWrite); - Assert.IsFalse(properties.ModifiableProperties.CanDelete); + Assert.IsTrue(properties.ModifiableProperties.CanWrite); + Assert.IsTrue(properties.ModifiableProperties.CanDelete); // Cleanup await client.SetTagPropertiesAsync(tag, originalContentProperties); diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Samples/ContainerRegistryClientSamples.HelloWorld.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Samples/ContainerRegistryClientSamples.HelloWorld.cs deleted file mode 100644 index 02472565de83..000000000000 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Samples/ContainerRegistryClientSamples.HelloWorld.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using Azure.Core.TestFramework; -using NUnit.Framework; -using System.Threading.Tasks; - -namespace Azure.Containers.ContainerRegistry.Tests.Samples -{ - public class ContainerRegistryClientSamples: SamplesBase - { - [Test] - public async Task GetRepositories() - { - var endpoint = TestEnvironment.Endpoint; - var userName = TestEnvironment.UserName; - var password = TestEnvironment.Password; - - #region Snippet:GetSecret - var client = new ContainerRegistryClient(new Uri(endpoint), userName, password); - - AsyncPageable repositories = client.GetRepositoriesAsync(); - - await foreach (string repository in repositories) - { - Console.WriteLine(repository); - } - #endregion - } - } -} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json index e67803e8557b..305f948dde73 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-2e4d387ce7b5e14d857a9f3704016099-22e4325a29040643-00", + "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-594f612a1ebb4242-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "0b399c878f6c898299c2287d85da48ea", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "195", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022registry:catalog:*\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "ff9eabc9-acd6-482e-84a7-a221c2829ea8" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "registry", + "Name": "catalog", + "Action": "*" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-1076c2fb1dae144d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "bff6cddb8677f046080c2f69df0d0c05", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "c8363718-06ae-480c-9cf3-a19de231dbb5" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "116", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-aa1f35ea2368ec46-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "a2a7017f0fca9b55add75940d23a1b16", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=registry:catalog:*\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "96f311cd-9221-45e2-90a8-95ca3212b36c" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/_catalog", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-594f612a1ebb4242-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "0b399c878f6c898299c2287d85da48ea", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "41", + "Content-Length": "40", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:10 GMT", + "Date": "Sat, 20 Mar 2021 19:33:10 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,17 +147,17 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "873c2338-81a7-4c70-a836-bbe728fb89fc" + "X-Ms-Correlation-Request-Id": "cbc18af0-9cf6-40b2-9d33-4176300365b5" }, - "ResponseBody": [ - "{\u0022repositories\u0022:[\u0022library/hello-world\u0022]}\n" - ] + "ResponseBody": { + "repositories": [ + "library/hello-world" + ] + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "1946767094" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json index cb1af96159b6..7eea027ce24e 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-dff52186b29a6f489218425a5d4fac58-1cb750a942720d4a-00", + "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-e179220590432c4d-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "d1c947d404b29065d5ea7fcc142ddb07", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "195", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022registry:catalog:*\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "23be2957-5ec0-4cf0-89d7-2f0c525a157f" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "registry", + "Name": "catalog", + "Action": "*" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-bf28854a0dac444b-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "d5a2d1d52c38a62142d4218e7b22dcca", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "df898eaf-967e-4601-9b34-5d4fa7cabb97" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "116", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-7ee93f8c834ec441-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "a56cd05dc143c3afacb828a54c1aa768", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=registry:catalog:*\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "4fd45f16-d354-4ea3-b156-a8751b5d6f78" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/_catalog", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-e179220590432c4d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d1c947d404b29065d5ea7fcc142ddb07", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "41", + "Content-Length": "40", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:10 GMT", + "Date": "Sat, 20 Mar 2021 19:33:11 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,17 +147,17 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "893b35b0-95f5-402b-a206-71d03d724abe" + "X-Ms-Correlation-Request-Id": "1e95202c-2a36-41a8-b7f8-328141926fbe" }, - "ResponseBody": [ - "{\u0022repositories\u0022:[\u0022library/hello-world\u0022]}\n" - ] + "ResponseBody": { + "repositories": [ + "library/hello-world" + ] + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "225985181" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json index 3ee94bf0e8b1..cabcf9db4839 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-533d468148bcd34ab35e6f404e9233ad-eb6501e903b61e4b-00", + "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-8df4f4016beafe42-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "dba6f073d96a2c3d5dd8e75898de3f48", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "214", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:23 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:delete\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "04345a50-4836-4312-8547-475bb6b14973" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "delete" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-4c3f3c62ffa19e4d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "065244d0a522ebc3220a5d1d6f65d67f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:23 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "a2d3ef81-8fe0-42c4-bd61-f6d078c2c83b" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "135", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-e3724c8e64521342-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "0a5ba8fa3f8a79652fd3b308aa0e7906", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:delete\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:23 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "907c3278-02e8-415d-a207-b73b2541b9bd" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/test-delete", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-8df4f4016beafe42-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "dba6f073d96a2c3d5dd8e75898de3f48", "x-ms-return-client-request-id": "true" @@ -25,7 +138,7 @@ ], "Connection": "keep-alive", "Content-Length": "0", - "Date": "Mon, 22 Mar 2021 15:37:22 GMT", + "Date": "Sat, 20 Mar 2021 19:33:23 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,9 +147,9 @@ ], "X-Content-Type-Options": "nosniff", "X-Ms-Client-Request-Id": "dba6f073d96a2c3d5dd8e75898de3f48", - "X-Ms-Correlation-Request-Id": "86abeab2-4cb7-40d1-a248-15e433b1e9e3", + "X-Ms-Correlation-Request-Id": "a13bfc19-6c5d-4022-a24a-a92473ad97c9", "X-Ms-Int-Docker-Content-Digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", - "X-Ms-Request-Id": "ffc84766-2864-45ba-af6a-4f6ad8d947cc" + "X-Ms-Request-Id": "b52d13da-089d-4cd4-a982-d66244ba08de" }, "ResponseBody": [] }, @@ -46,12 +159,125 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-896d3f7b8806ea43979252475b3613d0-1d866ca9edc1b242-00", + "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-fa75b205c21cea47-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "065244d0a522ebc3220a5d1d6f65d67f", + "x-ms-client-request-id": "79d03e146fd4cd3b2cbab8607b1fbcf8", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "b91ecaac-5ff5-40f4-9fba-488e8cb30870" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-43230134a4457f4b-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "f05e6702348291bedfd8d64ef1bb4114", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "7445e90e-9555-4205-9eaa-321a7c3f0a14" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-1fb93c6d6ec13741-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "310957905d948aab6c8dded08604fe10", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "993dfa80-01d1-46e8-a361-cdb3e3d95455" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/test-delete", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-fa75b205c21cea47-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "79d03e146fd4cd3b2cbab8607b1fbcf8", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -64,9 +290,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "81", + "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -74,19 +300,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "8bbff396-711c-42bc-9c4a-fc92cc848b23" + "X-Ms-Correlation-Request-Id": "3bae5727-9ffa-4347-9d71-12e4fecc2e28" }, - "ResponseBody": [ - "{\u0022errors\u0022:[{\u0022code\u0022:\u0022TAG_UNKNOWN\u0022,\u0022message\u0022:\u0022the specified tag does not exist\u0022}]}\n" - ] + "ResponseBody": { + "errors": [ + { + "code": "TAG_UNKNOWN", + "message": "the specified tag does not exist" + } + ] + } } ], "Variables": { "CLIENT_ID": "7a8f56a6-dfdd-481f-a421-93f59d2a29ff", "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", "CONTAINERREGISTRY_REGISTRY_NAME": "annelocontainerregistry", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "1462872878", "RESOURCE_GROUP": "rg-annelocontainerregistry", "SUBSCRIPTION_ID": "faa080af-c1d8-40ad-9cce-e1a450ca5b57", diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json index cc5e598bdb40..29cda8aa20b5 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-a68f98d22b156a49a7493ddbcb67ac55-a005bf60fa00ac41-00", + "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-d624b3535a83c942-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "eaef574b5f8a390ad9119fa02837f3eb", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "214", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:45 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:delete\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "d113a6bc-222f-4916-a7df-d2fba6cc61bf" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "delete" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-53c9848aa614484d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "de124a0c5d9e65fae446ae5353a51778", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:45 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "d7b937cf-4319-40a8-bf47-23282ece9bb1" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "135", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-211903b9152a1a46-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "8005e17ba198a34f103945279de33009", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:delete\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:45 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "1715d15d-f133-4aea-86a3-8a5f43f57dff" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/test-delete", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-d624b3535a83c942-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "eaef574b5f8a390ad9119fa02837f3eb", "x-ms-return-client-request-id": "true" @@ -25,7 +138,7 @@ ], "Connection": "keep-alive", "Content-Length": "0", - "Date": "Mon, 22 Mar 2021 15:37:39 GMT", + "Date": "Sat, 20 Mar 2021 19:33:45 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,9 +147,9 @@ ], "X-Content-Type-Options": "nosniff", "X-Ms-Client-Request-Id": "eaef574b5f8a390ad9119fa02837f3eb", - "X-Ms-Correlation-Request-Id": "cd295848-7b8d-442c-9553-9c4eff13287d", + "X-Ms-Correlation-Request-Id": "7ddcb42b-7367-47aa-a87c-17e1f0327bda", "X-Ms-Int-Docker-Content-Digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", - "X-Ms-Request-Id": "13acec22-b40b-48e9-b777-fe76436000c5" + "X-Ms-Request-Id": "4a090faf-8dc8-484a-af7b-c481e0d8786a" }, "ResponseBody": [] }, @@ -46,12 +159,125 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-e35dd562d8dadb4c96a332ff62fca6f2-6e51d3174231984e-00", + "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-ac7256fb001abf45-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "de124a0c5d9e65fae446ae5353a51778", + "x-ms-client-request-id": "44dc80688a3dee2b5c8a0643b0b7e534", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:50 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "249e7336-0b9e-4cf7-b626-72200277674d" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-8c02b2ea59a14845-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "462527f972316a52fb6fcd6517d2c701", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "15c736db-a6a2-4f31-a6ee-3e566d16948a" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-dea381664d45184b-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "d2eaa515d3c9f03ab616230e9b0bf259", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "5ec9843f-f99d-4d43-a359-fd0f300d4439" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/test-delete", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-ac7256fb001abf45-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "44dc80688a3dee2b5c8a0643b0b7e534", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -64,9 +290,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "81", + "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:44 GMT", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -74,19 +300,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "fe04153d-1571-4bde-8faf-d9edeae7f461" + "X-Ms-Correlation-Request-Id": "0c5c1b2a-65c4-4a77-bb83-33cd2ef3c95d" }, - "ResponseBody": [ - "{\u0022errors\u0022:[{\u0022code\u0022:\u0022TAG_UNKNOWN\u0022,\u0022message\u0022:\u0022the specified tag does not exist\u0022}]}\n" - ] + "ResponseBody": { + "errors": [ + { + "code": "TAG_UNKNOWN", + "message": "the specified tag does not exist" + } + ] + } } ], "Variables": { "CLIENT_ID": "7a8f56a6-dfdd-481f-a421-93f59d2a29ff", "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", "CONTAINERREGISTRY_REGISTRY_NAME": "annelocontainerregistry", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "1329994394", "RESOURCE_GROUP": "rg-annelocontainerregistry", "SUBSCRIPTION_ID": "faa080af-c1d8-40ad-9cce-e1a450ca5b57", diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json index 210563746291..d45348062a12 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-677c0852303d12478641c2f63d6ca592-ab073cda191b8d4e-00", + "traceparent": "00-59c7ca9f82768847b4a228808301c147-4b5a7945c1550046-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "e54d655359012a9fde41fe55b61410cb", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "6bef7b00-9052-4c1b-a352-906dbb4f3387" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-59c7ca9f82768847b4a228808301c147-de65a67e20e12643-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "e7d0a522909dd765c6dd27a4267399e7", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "c3bb2d45-0a14-4c08-970a-e7ed44e3a5fa" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-59c7ca9f82768847b4a228808301c147-0b389036719f884e-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "571f8bca375793634fbbc00d10745f52", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "f92671d9-8906-4d3a-a567-c94c99c5ff8b" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-59c7ca9f82768847b4a228808301c147-4b5a7945c1550046-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e54d655359012a9fde41fe55b61410cb", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "313", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:11 GMT", + "Date": "Sat, 20 Mar 2021 19:33:11 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,17 +147,26 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "e593ed17-6a98-44ef-81c9-c20df685abd9" + "X-Ms-Correlation-Request-Id": "15a0adc9-93a5-4dae-91de-59d656946e14" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:02.5685622Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:32:57.6243214Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "975764582" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json index 264706e9366d..4cc174202751 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-acf85f33aca3a44d892b6a6a0c697805-6ec1a0e45122524e-00", + "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-2e20338cec5f6842-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "1ce1ea6e5ecc87fbf23c279ea2c6cce2", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:33 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "c56b3722-ff89-4afd-b12d-bcf8749ed36a" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-4df6074876f66848-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "25d8634890be6ffdd74fb8e1fcd9dd0e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "07e0f729-8f4e-4c7e-a8c2-4b1bf09b78e0" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-ca0bf9514676424d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "853686acd3ce3b1e11e9e42c73ae31ab", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "a7e5c9fb-4255-4b03-84b1-62722ad5f688" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-2e20338cec5f6842-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "1ce1ea6e5ecc87fbf23c279ea2c6cce2", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "313", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,17 +147,26 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "0d0b7b14-ed09-4ce2-99e6-873008cd6431" + "X-Ms-Correlation-Request-Id": "463b6348-c5b4-4d84-8be5-b57423427a58" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:22.8749376Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "566557399" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json index 6854efccfb6f..1d4a1ba5eeb8 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-b9d7dc45add4f245bc13a74b82f2cc58-295803649da25f43-00", + "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-017a5aa7bbb0f247-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "856a71d8ace1e11d50a9f2ed02514028", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "b27b8c55-0854-4117-8e77-f0944502f9b4" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-ca726c47dcfb4a46-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "5681b71ad398af19a67ecf4bd53ccde2", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:12 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "026f769e-f024-402b-8fb7-f970e99e0533" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-8892213f3102e842-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "4508d86cc45f4beae2941854f4cd95ad", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:12 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "aa67bc4f-b828-46c2-beed-9b1e1dcb2f79" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-017a5aa7bbb0f247-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "856a71d8ace1e11d50a9f2ed02514028", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "403", + "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:11 GMT", + "Date": "Sat, 20 Mar 2021 19:33:12 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,17 +147,29 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "dd4d5efd-cc4c-4a97-aeee-148eaafd0d76" + "X-Ms-Correlation-Request-Id": "b6267ff8-21a1-46e4-8e20-0b94760125a0" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "392676521" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json index f9f097b31777..65ad9b56a715 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-b335a4a5a7b6dd4e8941e7bef4955196-9c6a00401412ed4f-00", + "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-5de15ad37cb3ed4b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "8392bf514252599bf0171a70e5e85f7e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "723e5f41-b173-4ef4-b85f-a75311146cfd" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-a7d5fe856381854b-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "2312808614d61dbbfbb32b381bdb4138", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "70502fce-3d83-4ad5-a9df-0ae3e8bd50fb" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-fa56e3bafa2b2143-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "d7dc80be9616cf532c408963d1facc8c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "f3f66f1a-c620-433a-b6c0-760194f744d0" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-5de15ad37cb3ed4b-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "8392bf514252599bf0171a70e5e85f7e", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "403", + "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,17 +147,29 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "ff87589d-9291-4692-b1d5-2b5a9a8f9754" + "X-Ms-Correlation-Request-Id": "f7f17c83-512a-4a06-9e55-748de4029f2a" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "140310429" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json index 2ea44dfae31f..705de53a85c2 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-ed09f5fb52adc94cbc2426925e256255-8a852d2942e4384b-00", + "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-d20c2bc3215fd944-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "46c518fab7442e2ec3e8a674939ee240", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "daab7e15-086f-4364-9119-dd6d51d47546" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-7d1c41b4629cca4a-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "7225f3a97268aa8c3df55ce8a3af2654", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "cbf0ffb1-1f8c-4468-9973-291b1e912cfd" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-5c3b7e67541c0e40-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "9bd00bd4252805a3e8265896299acb01", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "138d6d58-07c8-492a-835b-43b6090620e2" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-d20c2bc3215fd944-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "46c518fab7442e2ec3e8a674939ee240", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "313", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,11 +147,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "f8b48527-2361-4cd5-8ef6-81a56ba9db89" + "X-Ms-Correlation-Request-Id": "4b9bf17b-ec4e-4338-a616-119ef17a007f" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:14.9038152Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:15.5757437Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", @@ -46,21 +170,141 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "84", + "Content-Length": "82", "Content-Type": "application/json", - "traceparent": "00-3216c3b24cc1a54ea4a1e15c72962ba4-30ea320a1a59d246-00", + "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-3f2930b5ed833b4a-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "7225f3a97268aa8c3df55ce8a3af2654", + "x-ms-client-request-id": "001f348f1d09888f8b1b084e5a458b14", "x-ms-return-client-request-id": "true" }, "RequestBody": { "deleteEnabled": false, "writeEnabled": false, - "listEnabled": false, - "readEnabled": false + "listEnabled": true, + "readEnabled": true + }, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "222", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "e17a1966-a792-447c-a7c4-d4beabb3da00" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-2637dd43355ea148-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "87a052c247cd83184f1f894219f580a3", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "aea7bf7f-ba75-4dd5-bbe8-8d8aa2610117" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-0459cc4c0d0ff846-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "6f595b292590b64a7b480f0d1c54aba2", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "3d88eee1-e7bf-4da8-8c2b-ad4316acf9b9" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "82", + "Content-Type": "application/json", + "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-3f2930b5ed833b4a-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "001f348f1d09888f8b1b084e5a458b14", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": false, + "writeEnabled": false, + "listEnabled": true, + "readEnabled": true }, "StatusCode": 200, "ResponseHeaders": { @@ -71,9 +315,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "317", + "Content-Length": "314", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -81,11 +325,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "34e81034-5a3e-4916-8d2c-6a1ec5acd2b9" + "X-Ms-Correlation-Request-Id": "99eed7fb-da6f-46ba-a03f-a84b4488bc77" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:22.8749376Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": false, + "writeEnabled": false, + "readEnabled": true, + "listEnabled": true + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", @@ -93,12 +348,125 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-972ca39b4ef8d04a8e633d068f19a99c-21b5297e204b9446-00", + "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-e6adb7c48f0eac4a-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "9bd00bd4252805a3e8265896299acb01", + "x-ms-client-request-id": "d7d4449a43f948341b9bb1e9944d6f96", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "6b3e2733-0d9b-4dc5-a981-f1573af17238" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-0ea800cdf69a2345-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "ff25659a1cec9c8307ea0c85370b66fa", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "cab9d9c2-0191-405c-9a7d-a27a3ef60a3c" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-de45b1f4376c7c4e-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "d4a7e674a821e5aa271153f57461222d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "f7fbdb80-af29-42b1-8aca-0adf52d5bd4b" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-e6adb7c48f0eac4a-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "d7d4449a43f948341b9bb1e9944d6f96", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -111,9 +479,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "317", + "Content-Length": "314", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -121,11 +489,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "ea4e6add-7f6a-4307-8888-928da4e62f2b" + "X-Ms-Correlation-Request-Id": "8fda1b14-2092-4eac-9275-e4ca745c1f7d" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:22.8749376Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": false, + "writeEnabled": false, + "readEnabled": true, + "listEnabled": true + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", @@ -135,12 +514,132 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-deee9be90ffd18489921c8f88fc40f0c-8a581e497f4f4644-00", + "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-1e7e66be7549f048-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "001f348f1d09888f8b1b084e5a458b14", + "x-ms-client-request-id": "b77279d8ab2f7eb6c137d00f36af1010", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": true, + "writeEnabled": true, + "listEnabled": true, + "readEnabled": true + }, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "222", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "ed5bf831-2229-403d-8f6e-2e5d2d2d60a8" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-af0057060e742e48-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "ad74b6349aa6f174ba3fd8dac88d27a5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "9e03d374-7d1b-419d-abf0-542e976ef8f2" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-6baaf3d3a89ea743-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "beacdfc7af98c8cb2f2813e9d89aaf78", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "92153760-6869-4487-a85d-92fcdae8fb90" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "80", + "Content-Type": "application/json", + "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-1e7e66be7549f048-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "b77279d8ab2f7eb6c137d00f36af1010", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -158,9 +657,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "313", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -168,17 +667,26 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "81653faa-7766-4143-8502-617cce965012" + "X-Ms-Correlation-Request-Id": "340760cb-f219-4bed-b22d-86ca7346d5c7" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:22.8749376Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "1875560859" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json index 714ab36fe400..c9847b0ef486 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-e46a722a492e644fb468084deca6ac26-5b7c2a922a45f04b-00", + "traceparent": "00-d2a7c90962266544b169010380fd15dc-f084f47134c1284f-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "70cb0d11aaa9ceac9d45067fd9eefbb1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "331f1aee-89b1-4cb5-abfa-1c489d0c51da" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-d2a7c90962266544b169010380fd15dc-15b5da4a2854bd4f-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "239395fe8c9e23f80f0c78eedba3f857", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "2f73336f-8f00-41f9-b22b-123101d118c4" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-d2a7c90962266544b169010380fd15dc-bab868de07517c42-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "4214d0530f66f30d932d17da977bfb6e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "2aa9996c-d161-414e-8255-c2dcbf254a14" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-d2a7c90962266544b169010380fd15dc-f084f47134c1284f-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "70cb0d11aaa9ceac9d45067fd9eefbb1", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "313", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:44 GMT", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,11 +147,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "c9f57fc9-710b-479a-8d4a-fd87fd13ccd1" + "X-Ms-Correlation-Request-Id": "d0d3445d-5e01-457f-a1c0-7e7ae5e2a8c9" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:32.1879784Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:37.7692193Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", @@ -46,21 +170,141 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "84", + "Content-Length": "82", "Content-Type": "application/json", - "traceparent": "00-c55eb21622370c4ba51d1ad234de3517-8a21b54b69223c42-00", + "traceparent": "00-279337b199e77c409bfffca652a15979-8d0ed51a11fa7e40-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "239395fe8c9e23f80f0c78eedba3f857", + "x-ms-client-request-id": "005a637e6e1385d714a7619c32bef2fa", "x-ms-return-client-request-id": "true" }, "RequestBody": { "deleteEnabled": false, "writeEnabled": false, - "listEnabled": false, - "readEnabled": false + "listEnabled": true, + "readEnabled": true + }, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "222", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "b2d022a5-a069-496a-8a05-6f3f6a524921" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-279337b199e77c409bfffca652a15979-ba8720be56439a40-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "082baf4db9d9ef4a88a08f70741e8b94", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "3922768d-2ab0-4169-b857-b5055f6d716e" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-279337b199e77c409bfffca652a15979-ef461fa3dda06d49-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "786f0a11f749e543f98f2dbeae70c0d5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "5a428246-3dc0-4016-9563-a3bcaafece66" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "82", + "Content-Type": "application/json", + "traceparent": "00-279337b199e77c409bfffca652a15979-8d0ed51a11fa7e40-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "005a637e6e1385d714a7619c32bef2fa", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": false, + "writeEnabled": false, + "listEnabled": true, + "readEnabled": true }, "StatusCode": 200, "ResponseHeaders": { @@ -71,9 +315,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "317", + "Content-Length": "314", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:45 GMT", + "Date": "Sat, 20 Mar 2021 19:33:52 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -81,11 +325,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "f9971850-5851-4355-80fc-04d761d3c753" + "X-Ms-Correlation-Request-Id": "30b46530-8f19-4ab4-840b-f72b04d87f34" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:39.7515198Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:45.7784103Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": false, + "writeEnabled": false, + "readEnabled": true, + "listEnabled": true + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", @@ -93,12 +348,125 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-f7770c4e29c5404bb87e22225f6837ba-641bd0280ee8be4e-00", + "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-7a7f251c8301ca4c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "4214d0530f66f30d932d17da977bfb6e", + "x-ms-client-request-id": "e88c1d3af24fc594186a7873df6611f5", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:52 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "9f1cde7f-b02b-4d8f-8b29-8d04e748d596" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-fe7aac149714cc4f-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "288acd1c7a4f55b16b460f4a8b8c4017", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:52 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "dcdda8b5-2daf-49ec-b6d0-e9020b28ab93" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-e4ee8aa789bd034c-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "5636bae0a3911e4475a95fde7fd00592", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:52 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "40f8f22c-265a-43a3-b9c9-fd93b99d89ab" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-7a7f251c8301ca4c-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "e88c1d3af24fc594186a7873df6611f5", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -111,9 +479,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "317", + "Content-Length": "314", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:45 GMT", + "Date": "Sat, 20 Mar 2021 19:33:53 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -121,11 +489,22 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "c2aeeb54-0006-4836-a39c-7b30f05c3f86" + "X-Ms-Correlation-Request-Id": "dc50d49e-c999-4e99-acb2-a13164d7ee80" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:39.7515198Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:45.7784103Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": false, + "writeEnabled": false, + "readEnabled": true, + "listEnabled": true + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", @@ -135,12 +514,132 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-bcb701a0c345d14792461c1021ca456d-77204bc8828ce84b-00", + "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-711f214e765e984d-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "005a637e6e1385d714a7619c32bef2fa", + "x-ms-client-request-id": "e1a2377e98e6bf866c377c09e349398c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": true, + "writeEnabled": true, + "listEnabled": true, + "readEnabled": true + }, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "222", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "99e2db71-d3c6-4a01-88ad-66963d4a2f33" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-2bc0e9f307946848-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "24936029ba307963886bb2a51bd2d59b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "8489d065-e531-462c-9d51-b395c24a403c" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-c8a11ca5899d4247-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "54cc7c405fea47313476ea5a263b3a2b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "47886c79-8648-491f-9cdf-e2e9937a1b28" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "80", + "Content-Type": "application/json", + "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-711f214e765e984d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "e1a2377e98e6bf866c377c09e349398c", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -158,9 +657,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "313", + "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:45 GMT", + "Date": "Sat, 20 Mar 2021 19:33:53 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -168,17 +667,26 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "4623e7ac-016c-439b-a821-534734edb223" + "X-Ms-Correlation-Request-Id": "b44b4a16-a25c-4a9d-814f-e1ffd5820413" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022createdTime\u0022:\u00222021-03-11T23:39:48.4064552Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-22T15:37:39.7515198Z\u0022,\u0022manifestCount\u0022:10,\u0022tagCount\u0022:1,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "createdTime": "2021-03-11T23:39:48.4064552Z", + "lastUpdateTime": "2021-03-20T19:33:45.7784103Z", + "manifestCount": 10, + "tagCount": 1, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "1375061687" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json index a88976c060a3..df81bb7e8a08 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-93233b965507fb4ca4e84d5e379280ba-351bbdf72f191b47-00", + "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-8ec2f3a21804654a-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "5c47a10ec1a6080c584daa6f7d8f5709", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "81dd8714-b8b2-43a8-be1b-b5826940fb28" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-0d6803c66c864844-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "a9cac790cc30fc5aab7fe53029b83f0a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "a210c240-527b-47cb-aed8-ffe539a032f0" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-a073b70b7523934e-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "1f6ecb5d5dad53825f78f76d6093bd40", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "e073dc6e-2b9a-4cb0-ad01-1239d05ff979" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-8ec2f3a21804654a-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "5c47a10ec1a6080c584daa6f7d8f5709", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "403", + "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,11 +147,25 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "9aeaf96d-839c-435e-bbb4-9557c46b6bbb" + "X-Ms-Correlation-Request-Id": "7c3bb221-86f6-467d-8457-c0ae11c17c02" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", @@ -46,19 +173,139 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "84", + "Content-Length": "82", "Content-Type": "application/json", - "traceparent": "00-141695ca4493bd4faf9f5a4bfc86ab4d-9a6f34c9ee405243-00", + "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-0b29ff47bfaa7b4d-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "a9cac790cc30fc5aab7fe53029b83f0a", + "x-ms-client-request-id": "047c53ea7a0d41ac474bb026dbdbdf9f", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "deleteEnabled": false, - "writeEnabled": false, + "deleteEnabled": true, + "writeEnabled": true, + "listEnabled": false, + "readEnabled": false + }, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "222", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "086334d6-62c4-4eac-9b4d-ddb9e1e3b2b9" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-2d1cc96986cd0742-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "b1129f0d3820325c45774ab8d4ec9b17", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "ae2b565b-e319-4258-a29e-9c2c6aef5512" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-181860f62ddca242-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "d545a5c13a3ce2fc1f2dd762ad5b7783", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "54eb9c58-23e8-48e2-b13c-b93603859e52" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "82", + "Content-Type": "application/json", + "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-0b29ff47bfaa7b4d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "047c53ea7a0d41ac474bb026dbdbdf9f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": true, + "writeEnabled": true, "listEnabled": false, "readEnabled": false }, @@ -71,9 +318,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "407", + "Content-Length": "404", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -81,11 +328,25 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "010e266b-be2a-4e3c-a7de-2099a75e9458" + "X-Ms-Correlation-Request-Id": "a8ac52e5-deaa-4361-970f-938afc217bbe" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": false, + "listEnabled": false + } + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", @@ -93,12 +354,125 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-eaa315c32133504a9d84b7c69bf39ccf-58c67d4dceb81241-00", + "traceparent": "00-f377cb12e3be19448928f73eb8d17816-80b6c3b1b2547c45-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "1f6ecb5d5dad53825f78f76d6093bd40", + "x-ms-client-request-id": "c06058980b81b21ff749bf9630f36c5b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "0acf30cf-d862-4363-b462-daa4102f2ec6" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-f377cb12e3be19448928f73eb8d17816-9483a95a23934249-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "366598af0996d263a32f92f260f985ea", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "37e9e286-c20f-4be5-ab04-0e49cfc649cb" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-f377cb12e3be19448928f73eb8d17816-1e6364c91ee8a74b-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "7c1fc6ffda8bb5958593ddf27b66b22b", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "649e5cd2-ecda-4a74-bcf3-b77bd1957413" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-f377cb12e3be19448928f73eb8d17816-80b6c3b1b2547c45-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "c06058980b81b21ff749bf9630f36c5b", "x-ms-return-client-request-id": "true" }, "RequestBody": null, @@ -111,9 +485,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "407", + "Content-Length": "404", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -121,11 +495,25 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "98dd19b9-f4b8-4cf3-b72d-c140aec33504" + "X-Ms-Correlation-Request-Id": "2fb43de5-4c73-4386-9225-b2561e94eaae" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": false, + "listEnabled": false + } + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", @@ -135,12 +523,132 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-10ebcb48736726499a44031ba1bf33ed-74f3b1d16b01964c-00", + "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-a7e6a5e5464b6146-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "047c53ea7a0d41ac474bb026dbdbdf9f", + "x-ms-client-request-id": "14b37cc041f68fedf58d1d52792d51fe", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": true, + "writeEnabled": true, + "listEnabled": true, + "readEnabled": true + }, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "222", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "bfb7a4aa-ae0d-4801-b09e-eabb43fa7264" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-4a70c8967e17864e-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "6a96d5c4f0d3d4cf02afb0022b70573d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "07514522-ae7c-4ce5-8d9c-f0e8afcbe2bb" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-9ee2f260fec37240-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "e432667d7046bef4d89087febd433c58", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "064cec1a-b4a1-481d-a62e-f3df0e070297" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "80", + "Content-Type": "application/json", + "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-a7e6a5e5464b6146-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "14b37cc041f68fedf58d1d52792d51fe", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -158,9 +666,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "403", + "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:28 GMT", + "Date": "Sat, 20 Mar 2021 19:33:33 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -168,17 +676,29 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "8389024e-879c-4dd7-993e-9c0cb201bced" + "X-Ms-Correlation-Request-Id": "6988b56b-a4c7-4f94-9e65-3bc89ec3f803" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "416639128" } } \ No newline at end of file diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json index 1083660598ac..297c4719fa89 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json @@ -6,10 +6,123 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-05b5a1d21e642648bacde06ed3f53b7f-f26b4301df02de49-00", + "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-9d6c4e9fa307a94d-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "c90ebe782f976d2b4e4c007ed2d7dc1e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "454fb804-84f0-47f8-8599-983e520999c3" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-3eb4ce9e83849e4f-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "01a0674006624c5c5249c88376f5bf1c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "6491b987-01a1-4de6-aaae-8d48d5d8b552" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-1d97e81bd8f20c41-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "ffb212e67aff03ad43a648c2ddacf558", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "45eadb23-df8c-4a34-b24f-10adba1564bb" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-9d6c4e9fa307a94d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "c90ebe782f976d2b4e4c007ed2d7dc1e", "x-ms-return-client-request-id": "true" @@ -24,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "403", + "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:45 GMT", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -34,11 +147,25 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "c0594671-c2a0-42c0-9340-92c78007134a" + "X-Ms-Correlation-Request-Id": "ba8cae20-8243-4b95-88b4-5c1cc3b05a51" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", @@ -46,19 +173,139 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "84", + "Content-Length": "82", "Content-Type": "application/json", - "traceparent": "00-b32bc75ef29287449eab56a1db83c4d7-7898be417bc7b340-00", + "traceparent": "00-b95220283d462747b31a81efedbc8377-6d31b99b3a465641-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "01a0674006624c5c5249c88376f5bf1c", + "x-ms-client-request-id": "88c41f6d9ad1712461c1774d67a7f759", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": true, + "writeEnabled": true, + "listEnabled": false, + "readEnabled": false + }, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "222", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "76ca0228-dfd7-47d5-af8f-59c3a55fd764" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-b95220283d462747b31a81efedbc8377-6b98d34884e31845-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "bf97e38ddd24c61eb99dbdbcbd9a6ea6", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "7b6fb9f9-f26b-4e72-bd15-0c41eae07a45" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-b95220283d462747b31a81efedbc8377-b78cdd1b1083074e-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "56166f5437314c4aed419d3d035f9b9c", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "ccc8aa7c-d7d1-4d21-a932-2213823f823b" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "82", + "Content-Type": "application/json", + "traceparent": "00-b95220283d462747b31a81efedbc8377-6d31b99b3a465641-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "88c41f6d9ad1712461c1774d67a7f759", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "deleteEnabled": false, - "writeEnabled": false, + "deleteEnabled": true, + "writeEnabled": true, "listEnabled": false, "readEnabled": false }, @@ -71,9 +318,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "407", + "Content-Length": "404", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:45 GMT", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -81,11 +328,25 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "1dc7dc86-ab72-4f15-9516-dbaee6f7f7db" + "X-Ms-Correlation-Request-Id": "9c2046a7-f841-4e72-808e-bff2dafbc816" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": false, + "listEnabled": false + } + } + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", @@ -93,16 +354,190 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-b144bf22c2325d41b10b1ce4c696d5a6-5fabc5f9937d204b-00", + "traceparent": "00-0759cd461cb7384e9396fe43c730135f-6e0bced9eb246346-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "ffb212e67aff03ad43a648c2ddacf558", + "x-ms-client-request-id": "f935efaf36158f3300fece34dc68b3c7", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 401, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "209f8749-dfaf-4e4a-9d1a-068629eec830" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_read" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-0759cd461cb7384e9396fe43c730135f-cc4fa710ace4e84d-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "f7f9d152a0915527994bd1e340e1c35a", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "1483d7f1-d17f-48f0-8d92-763ea8ad5a5a" + }, + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "142", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-0759cd461cb7384e9396fe43c730135f-dcc74cf7a5ace946-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "ce0d210175651e913c86553369166f85", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "b4f1910f-3425-4eb9-adcc-bdfe7c1eec35" + }, + "ResponseBody": { + "access_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-0759cd461cb7384e9396fe43c730135f-6e0bced9eb246346-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "f935efaf36158f3300fece34dc68b3c7", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Expose-Headers": [ + "Docker-Content-Digest", + "WWW-Authenticate", + "Link", + "X-Ms-Correlation-Request-Id" + ], + "Connection": "close", + "Content-Length": "404", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Docker-Distribution-Api-Version": "registry/2.0", + "Server": "openresty", + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains", + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": "nosniff", + "X-Ms-Correlation-Request-Id": "c99c5a84-199f-4df0-87d9-b8a7d4a7d14e" + }, + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": false, + "listEnabled": false + } + } + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", + "RequestMethod": "PATCH", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Content-Length": "80", + "Content-Type": "application/json", + "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-5755724fa4886b42-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "31ead58da4650e0bc7df60c964504f1f", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "deleteEnabled": true, + "writeEnabled": true, + "listEnabled": true, + "readEnabled": true + }, + "StatusCode": 401, "ResponseHeaders": { "Access-Control-Expose-Headers": [ "Docker-Content-Digest", @@ -111,21 +546,94 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "407", + "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:45 GMT", + "Date": "Sat, 20 Mar 2021 19:33:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains", "max-age=31536000; includeSubDomains" ], + "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "d5bbd636-f960-40b0-982a-6063955f65f2" + "X-Ms-Correlation-Request-Id": "4a4e6af1-b840-4a03-a4e1-6a7236532694" + }, + "ResponseBody": { + "errors": [ + { + "code": "UNAUTHORIZED", + "message": "authentication required, visit https://aka.ms/acr/authorization for more information.", + "detail": [ + { + "Type": "repository", + "Name": "library/hello-world", + "Action": "metadata_write" + } + ] + } + ] + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/exchange", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "89", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-2dbefc4c1859b549-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "bb32733ae55add6240dbba0a4af4ec82", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=access_token\u0026service=annelocontainerregistry.azurecr.io\u0026access_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:55 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "edc96bc7-ddb0-4401-acda-304b3822e303" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:false,\u0022writeEnabled\u0022:false,\u0022readEnabled\u0022:false,\u0022listEnabled\u0022:false}}}\n" - ] + "ResponseBody": { + "refresh_token": "Sanitized" + } + }, + { + "RequestUri": "https://annelocontainerregistry.azurecr.io/oauth2/token", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Content-Length": "143", + "Content-Type": "application/x-www-form-urlencoded", + "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-b5f9d15f5e55d04f-00", + "User-Agent": [ + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" + ], + "x-ms-client-request-id": "6a564cdc91f65df516ff068514c7b9ec", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "StatusCode": 200, + "ResponseHeaders": { + "Connection": "keep-alive", + "Content-Type": "application/json; charset=utf-8", + "Date": "Sat, 20 Mar 2021 19:33:55 GMT", + "Server": "openresty", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "Transfer-Encoding": "chunked", + "X-Ms-Correlation-Request-Id": "aca22150-c638-4349-9bbd-5fcd7133157a" + }, + "ResponseBody": { + "access_token": "Sanitized" + } }, { "RequestUri": "https://annelocontainerregistry.azurecr.io/acr/v1/library%2Fhello-world/_tags/latest", @@ -135,12 +643,12 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-384c97fc3674b4499bfb904aca5657f2-5bbb8b67c8740f46-00", + "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-5755724fa4886b42-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210322.1", - "(.NET Core 4.6.29812.02; Microsoft Windows 10.0.19042 )" + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], - "x-ms-client-request-id": "88c41f6d9ad1712461c1774d67a7f759", + "x-ms-client-request-id": "31ead58da4650e0bc7df60c964504f1f", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -158,9 +666,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "403", + "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Mon, 22 Mar 2021 15:37:46 GMT", + "Date": "Sat, 20 Mar 2021 19:33:55 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -168,17 +676,29 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "bf2466a2-4e6a-4430-95c1-1c0ffcd15654" + "X-Ms-Correlation-Request-Id": "afc6e13b-658e-4763-81d9-0b5e8efbdda1" }, - "ResponseBody": [ - "{\u0022registry\u0022:\u0022annelocontainerregistry.azurecr.io\u0022,\u0022imageName\u0022:\u0022library/hello-world\u0022,\u0022tag\u0022:{\u0022name\u0022:\u0022latest\u0022,\u0022digest\u0022:\u0022sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24\u0022,\u0022createdTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022lastUpdateTime\u0022:\u00222021-03-20T04:04:46.2118653Z\u0022,\u0022signed\u0022:false,\u0022changeableAttributes\u0022:{\u0022deleteEnabled\u0022:true,\u0022writeEnabled\u0022:true,\u0022readEnabled\u0022:true,\u0022listEnabled\u0022:true}}}\n" - ] + "ResponseBody": { + "registry": "annelocontainerregistry.azurecr.io", + "imageName": "library/hello-world", + "tag": { + "name": "latest", + "digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", + "createdTime": "2021-03-20T04:04:46.2118653Z", + "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", + "signed": false, + "changeableAttributes": { + "deleteEnabled": true, + "writeEnabled": true, + "readEnabled": true, + "listEnabled": true + } + } + } } ], "Variables": { "CONTAINERREGISTRY_ENDPOINT": "https://annelocontainerregistry.azurecr.io", - "CONTAINERREGISTRY_PASSWORD": "Sanitized", - "CONTAINERREGISTRY_USERNAME": "Sanitized", "RandomSeed": "335295993" } } \ No newline at end of file diff --git a/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs b/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs index 91c9fe845da0..7b303149f535 100644 --- a/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs +++ b/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs @@ -142,6 +142,21 @@ protected async Task SetAuthorizationHeader(HttpMessage message, TokenRequestCon message.Request.Headers.SetValue(HttpHeader.Names.Authorization, headerValue); } + protected async Task GetAuthorizationHeader(HttpMessage message, TokenRequestContext context, bool async) + { + string headerValue; + if (async) + { + headerValue = await _accessTokenCache.GetHeaderValueAsync(message, context, async).ConfigureAwait(false); + } + else + { + headerValue = _accessTokenCache.GetHeaderValueAsync(message, context, async).EnsureCompleted(); + } + + return headerValue; + } + private class AccessTokenCache { private readonly object _syncObj = new object(); From f04218277d0daab61bfd347048689cc8a0697b11 Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Tue, 23 Mar 2021 11:19:48 -0700 Subject: [PATCH 02/10] retrieve aad access token from request header. --- .../ContainerRegistryCredentialsPolicy.cs | 34 ++++++------------- ...earerTokenChallengeAuthenticationPolicy.cs | 15 -------- 2 files changed, 10 insertions(+), 39 deletions(-) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs index 3d8e80ad9673..946a732890a3 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs @@ -12,7 +12,7 @@ namespace Azure.Containers.ContainerRegistry /// /// Challenge-based authentication policy for Container Registry Service. /// - /// The challenge-based authorization flow is illustrated in the following steps. + /// The challenge-based authorization flow for ACR is illustrated in the following steps. /// For example, GET /api/v1/acr/repositories translates into the following calls. /// /// Step 1: GET /api/v1/acr/repositories @@ -55,11 +55,10 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt var scope = AuthorizationChallengeParser.GetChallengeParameterFromResponse(message.Response, "Bearer", "scope"); string acrAccessToken = string.Empty; - var aadTokenRequestContext = new TokenRequestContext(Scopes, message.Request.ClientRequestId); if (async) { // Step 3: Exchange AAD Access Token for ACR Refresh Token - string acrRefreshToken = await ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, aadTokenRequestContext, true).ConfigureAwait(false); + string acrRefreshToken = await ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, true).ConfigureAwait(false); // Step 4: Send in acrRefreshToken and get back acrAccessToken acrAccessToken = await ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, true).ConfigureAwait(false); @@ -67,7 +66,7 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt else { // Step 3: Exchange AAD Access Token for ACR Refresh Token - string acrRefreshToken = ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, aadTokenRequestContext, false).EnsureCompleted(); + string acrRefreshToken = ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, false).EnsureCompleted(); // Step 4: Send in acrRefreshToken and get back acrAccessToken acrAccessToken = ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, false).EnsureCompleted(); @@ -80,10 +79,9 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt return true; } - private async Task ExchangeAadAccessTokenForAcrRefreshTokenAsync(HttpMessage message, string service, TokenRequestContext context, bool async) + private async Task ExchangeAadAccessTokenForAcrRefreshTokenAsync(HttpMessage message, string service, bool async) { - string aadAuthHeader = await GetAuthorizationHeader(message, context, async).ConfigureAwait(false); - string aadAccessToken = aadAuthHeader.Remove(0, "Bearer ".Length); + string aadAccessToken = GetAuthorizationHeader(message); Response acrRefreshToken = null; if (async) @@ -119,27 +117,15 @@ private async Task ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string return acrAccessToken.Value.AccessTokenValue; } - private static Dictionary ParseChallengeValues(HttpMessage message) + private static string GetAuthorizationHeader(HttpMessage message) { - string bearerValue = string.Empty; - string challenge = string.Empty; - if (message.Response.Headers.TryGetValue(HttpHeader.Names.WwwAuthenticate, out bearerValue)) + string aadAuthHeader; + if (!message.Request.Headers.TryGetValue(HttpHeader.Names.Authorization, out aadAuthHeader)) { - if (bearerValue.StartsWith("Bearer ", StringComparison.InvariantCulture)) - { - challenge = bearerValue.Remove(0, "Bearer ".Length); - } + throw new InvalidOperationException("Failed to retrieve Authentication header from message request.") } - string[] elements = challenge.Split(','); - Dictionary challengeValues = new Dictionary(); - foreach (var element in elements) - { - string[] keyAndValue = element.Split('='); - challengeValues[keyAndValue[0]] = keyAndValue[1].Trim('"'); - } - - return challengeValues; + return aadAuthHeader.Remove(0, "Bearer ".Length); } } } diff --git a/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs b/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs index 7b303149f535..91c9fe845da0 100644 --- a/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs +++ b/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs @@ -142,21 +142,6 @@ protected async Task SetAuthorizationHeader(HttpMessage message, TokenRequestCon message.Request.Headers.SetValue(HttpHeader.Names.Authorization, headerValue); } - protected async Task GetAuthorizationHeader(HttpMessage message, TokenRequestContext context, bool async) - { - string headerValue; - if (async) - { - headerValue = await _accessTokenCache.GetHeaderValueAsync(message, context, async).ConfigureAwait(false); - } - else - { - headerValue = _accessTokenCache.GetHeaderValueAsync(message, context, async).EnsureCompleted(); - } - - return headerValue; - } - private class AccessTokenCache { private readonly object _syncObj = new object(); From ba63a01e91f1b159636a2b687a78845c6824eae3 Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Tue, 23 Mar 2021 12:27:41 -0700 Subject: [PATCH 03/10] use two http pipelines --- .../Azure.Containers.ContainerRegistry.csproj | 2 +- .../src/ContainerRegistryClient.cs | 16 ++++++---------- .../Repositories/ContainerRepositoryClient.cs | 18 ++++++++---------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj index 230c546c6165..46c4ff4d7fe5 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj @@ -6,7 +6,7 @@ Azure Container Registry;$(PackageCommonTags) $(RequiredTargetFrameworks) - + diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs index 744a017bc3f7..18f4c7adb555 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs @@ -16,6 +16,7 @@ public partial class ContainerRegistryClient { private readonly Uri _endpoint; private readonly HttpPipeline _pipeline; + private readonly HttpPipeline _acrAuthPipeline; private readonly ClientDiagnostics _clientDiagnostics; private readonly ContainerRegistryRestClient _restClient; @@ -36,19 +37,14 @@ public ContainerRegistryClient(Uri endpoint, TokenCredential credential, Contain Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(credential, nameof(credential)); - // TODO: Solve: - // 1. What pipeline to use for RefreshTokensRestClient - how to reason about this from a customer perspective? - // 2. Is it ok that we share a ClientDiagnostics type? - - _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); - _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); - - _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); - + _endpoint = endpoint; _clientDiagnostics = new ClientDiagnostics(options); - _endpoint = endpoint; + _acrAuthPipeline = HttpPipelineBuilder.Build(options); + _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); + _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); _restClient = new ContainerRegistryRestClient(_clientDiagnostics, _pipeline, _endpoint.AbsoluteUri); } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs index a1ba9fbe9776..a1acc77a9f7e 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs @@ -13,6 +13,7 @@ namespace Azure.Containers.ContainerRegistry public partial class ContainerRepositoryClient { private readonly HttpPipeline _pipeline; + private readonly HttpPipeline _acrAuthPipeline; private readonly ClientDiagnostics _clientDiagnostics; private readonly ContainerRegistryRepositoryRestClient _restClient; @@ -37,22 +38,19 @@ public partial class ContainerRepositoryClient public ContainerRepositoryClient(Uri endpoint, string repository, TokenCredential credential, ContainerRegistryClientOptions options) { Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(repository, nameof(repository)); Argument.AssertNotNull(credential, nameof(credential)); - // TODO: Solve: - // 1. What pipeline to use for RefreshTokensRestClient - how to reason about this from a customer perspective? - // 2. Is it ok that we share a ClientDiagnostics type? - - _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); - _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, HttpPipelineBuilder.Build(options), endpoint.AbsoluteUri); - - _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); + Endpoint = endpoint; + _repository = repository; _clientDiagnostics = new ClientDiagnostics(options); - Endpoint = endpoint; - _repository = repository; + _acrAuthPipeline = HttpPipelineBuilder.Build(options); + _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _pipeline, endpoint.AbsoluteUri); + _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _pipeline, endpoint.AbsoluteUri); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); _restClient = new ContainerRegistryRepositoryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); } From 9558c37d5f0a092359f4462a32286a44604c2616 Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Tue, 23 Mar 2021 12:48:39 -0700 Subject: [PATCH 04/10] test cleanup and re-record --- .../ContainerRegistryCredentialsPolicy.cs | 2 +- .../src/ContainerRegistryClient.cs | 1 + .../Repositories/ContainerRepositoryClient.cs | 5 +- .../ContainerRepositoryClientLiveTests.cs | 30 +-- .../CanGetRepositories.json | 36 ++-- .../CanGetRepositoriesAsync.json | 36 ++-- .../CanDeleteTag.json | 74 ++++---- .../CanDeleteTagAsync.json | 74 ++++---- .../CanGetRepositoryProperties.json | 38 ++-- .../CanGetRepositoryPropertiesAsync.json | 38 ++-- .../CanGetTagProperties.json | 36 ++-- .../CanGetTagPropertiesAsync.json | 36 ++-- .../CanSetRepositoryProperties.json | 178 +++++++++--------- .../CanSetRepositoryPropertiesAsync.json | 176 ++++++++--------- .../CanSetTagProperties.json | 168 ++++++++--------- .../CanSetTagPropertiesAsync.json | 168 ++++++++--------- 16 files changed, 553 insertions(+), 543 deletions(-) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs index 946a732890a3..a8a235cb6d90 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs @@ -122,7 +122,7 @@ private static string GetAuthorizationHeader(HttpMessage message) string aadAuthHeader; if (!message.Request.Headers.TryGetValue(HttpHeader.Names.Authorization, out aadAuthHeader)) { - throw new InvalidOperationException("Failed to retrieve Authentication header from message request.") + throw new InvalidOperationException("Failed to retrieve Authentication header from message request."); } return aadAuthHeader.Remove(0, "Bearer ".Length); diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs index 18f4c7adb555..875b78503806 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs @@ -36,6 +36,7 @@ public ContainerRegistryClient(Uri endpoint, TokenCredential credential, Contain { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(credential, nameof(credential)); + Argument.AssertNotNull(options, nameof(options)); _endpoint = endpoint; _clientDiagnostics = new ClientDiagnostics(options); diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs index a1acc77a9f7e..bc1b38f37f33 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs @@ -40,6 +40,7 @@ public ContainerRepositoryClient(Uri endpoint, string repository, TokenCredentia Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNull(repository, nameof(repository)); Argument.AssertNotNull(credential, nameof(credential)); + Argument.AssertNotNull(options, nameof(options)); Endpoint = endpoint; _repository = repository; @@ -47,8 +48,8 @@ public ContainerRepositoryClient(Uri endpoint, string repository, TokenCredentia _clientDiagnostics = new ClientDiagnostics(options); _acrAuthPipeline = HttpPipelineBuilder.Build(options); - _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _pipeline, endpoint.AbsoluteUri); - _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _pipeline, endpoint.AbsoluteUri); + _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); + _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); _restClient = new ContainerRegistryRepositoryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs index 409140013d69..5ece8c449250 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs @@ -93,8 +93,8 @@ public async Task CanSetRepositoryProperties() await client.SetPropertiesAsync( new ContentProperties() { - CanList = true, - CanRead = true, + CanList = false, + CanRead = false, CanWrite = false, CanDelete = false, }); @@ -102,8 +102,8 @@ await client.SetPropertiesAsync( // Assert RepositoryProperties properties = await client.GetPropertiesAsync(); - Assert.IsTrue(properties.WriteableProperties.CanList); - Assert.IsTrue(properties.WriteableProperties.CanRead); + Assert.IsFalse(properties.WriteableProperties.CanList); + Assert.IsFalse(properties.WriteableProperties.CanRead); Assert.IsFalse(properties.WriteableProperties.CanWrite); Assert.IsFalse(properties.WriteableProperties.CanDelete); @@ -143,8 +143,8 @@ await client.SetTagPropertiesAsync( { CanList = false, CanRead = false, - CanWrite = true, - CanDelete = true + CanWrite = false, + CanDelete = false }); // Assert @@ -152,8 +152,8 @@ await client.SetTagPropertiesAsync( Assert.IsFalse(properties.ModifiableProperties.CanList); Assert.IsFalse(properties.ModifiableProperties.CanRead); - Assert.IsTrue(properties.ModifiableProperties.CanWrite); - Assert.IsTrue(properties.ModifiableProperties.CanDelete); + Assert.IsFalse(properties.ModifiableProperties.CanWrite); + Assert.IsFalse(properties.ModifiableProperties.CanDelete); // Cleanup await client.SetTagPropertiesAsync(tag, originalContentProperties); @@ -165,15 +165,23 @@ public async Task CanDeleteTag() // Arrange ContainerRepositoryClient client = CreateClient(); string tag = "test-delete"; - await ImportImage(tag); + + if (this.Mode != RecordedTestMode.Playback) + { + await ImportImage(tag); + } // Act await client.DeleteTagAsync(tag); // Assert - // The delete takes some time, so if we call GetTagProperties() without a delay, we get a 200 response. - await Task.Delay(5000); + // This will be removed, pending investigation into potential race condition. + // https://github.com/azure/azure-sdk-for-net/issues/19699 + if (this.Mode != RecordedTestMode.Playback) + { + await Task.Delay(5000); + } Assert.ThrowsAsync(async () => { await client.GetTagPropertiesAsync(tag); }); } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json index 305f948dde73..e5609494ee32 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositories.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-594f612a1ebb4242-00", + "traceparent": "00-dd374b9357b72340b1183d9897712ce9-3e2d1ee1bc4e6646-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "0b399c878f6c898299c2287d85da48ea", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "195", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Date": "Tue, 23 Mar 2021 19:42:53 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022registry:catalog:*\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "ff9eabc9-acd6-482e-84a7-a221c2829ea8" + "X-Ms-Correlation-Request-Id": "171f6500-9df4-43e9-8fab-0483cfa65ce4" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-1076c2fb1dae144d-00", + "traceparent": "00-dd374b9357b72340b1183d9897712ce9-d5d0f444583ca247-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "bff6cddb8677f046080c2f69df0d0c05", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Date": "Tue, 23 Mar 2021 19:42:53 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "c8363718-06ae-480c-9cf3-a19de231dbb5" + "X-Ms-Correlation-Request-Id": "de9d0a44-f348-4c68-8bca-249161b1d9aa" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "116", + "Content-Length": "120", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-aa1f35ea2368ec46-00", + "traceparent": "00-dd374b9357b72340b1183d9897712ce9-42ad338c2a6cd345-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "a2a7017f0fca9b55add75940d23a1b16", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=registry:catalog:*\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=registry%3acatalog%3a*\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Date": "Tue, 23 Mar 2021 19:42:53 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "96f311cd-9221-45e2-90a8-95ca3212b36c" + "X-Ms-Correlation-Request-Id": "43e0ec3f-2be5-4570-a2cf-5b250cc36031" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-8da1f69bb1f4bb43868360282f41a2be-594f612a1ebb4242-00", + "traceparent": "00-dd374b9357b72340b1183d9897712ce9-3e2d1ee1bc4e6646-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "0b399c878f6c898299c2287d85da48ea", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "40", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Date": "Tue, 23 Mar 2021 19:42:53 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,7 +147,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "cbc18af0-9cf6-40b2-9d33-4176300365b5" + "X-Ms-Correlation-Request-Id": "6b372027-8623-449a-ace4-3d91213bbd49" }, "ResponseBody": { "repositories": [ diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json index 7eea027ce24e..0c468413b01b 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRegistryClientLiveTests/CanGetRepositoriesAsync.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-e179220590432c4d-00", + "traceparent": "00-4052c03655c8164abb37737ce5afbc9f-a674cf39df11664c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d1c947d404b29065d5ea7fcc142ddb07", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "195", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022registry:catalog:*\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "23be2957-5ec0-4cf0-89d7-2f0c525a157f" + "X-Ms-Correlation-Request-Id": "9ddcb0e2-e288-47e8-893f-a8f1e33318e3" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-bf28854a0dac444b-00", + "traceparent": "00-4052c03655c8164abb37737ce5afbc9f-c5bc48f2a2af8945-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d5a2d1d52c38a62142d4218e7b22dcca", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "df898eaf-967e-4601-9b34-5d4fa7cabb97" + "X-Ms-Correlation-Request-Id": "40cf31e8-43fa-4e14-b035-e58b546e1f66" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "116", + "Content-Length": "120", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-7ee93f8c834ec441-00", + "traceparent": "00-4052c03655c8164abb37737ce5afbc9f-9c219c64320dad42-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "a56cd05dc143c3afacb828a54c1aa768", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=registry:catalog:*\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=registry%3acatalog%3a*\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:10 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "4fd45f16-d354-4ea3-b156-a8751b5d6f78" + "X-Ms-Correlation-Request-Id": "63c49dbc-45b8-473f-88c8-c3119f228d4b" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-0adf7f082a0dac46bd3d82811dbb9bce-e179220590432c4d-00", + "traceparent": "00-4052c03655c8164abb37737ce5afbc9f-a674cf39df11664c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d1c947d404b29065d5ea7fcc142ddb07", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "40", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,7 +147,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "1e95202c-2a36-41a8-b7f8-328141926fbe" + "X-Ms-Correlation-Request-Id": "202da2aa-7a56-4e74-82bf-a758452fcc66" }, "ResponseBody": { "repositories": [ diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json index cabcf9db4839..47d20d7210d7 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTag.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-8df4f4016beafe42-00", + "traceparent": "00-9fb7e94fce0b2546bb17eea3f63fd55d-ed9ea4711031d740-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "dba6f073d96a2c3d5dd8e75898de3f48", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "214", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:23 GMT", + "Date": "Tue, 23 Mar 2021 19:43:06 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:delete\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "04345a50-4836-4312-8547-475bb6b14973" + "X-Ms-Correlation-Request-Id": "2686c1a8-0008-472f-a987-21a8079283fb" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-4c3f3c62ffa19e4d-00", + "traceparent": "00-9fb7e94fce0b2546bb17eea3f63fd55d-42dfcb22919e6945-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "065244d0a522ebc3220a5d1d6f65d67f", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:23 GMT", + "Date": "Tue, 23 Mar 2021 19:43:06 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "a2d3ef81-8fe0-42c4-bd61-f6d078c2c83b" + "X-Ms-Correlation-Request-Id": "c712a663-d167-414e-96e8-f7ac5022d11a" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "135", + "Content-Length": "141", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-e3724c8e64521342-00", + "traceparent": "00-9fb7e94fce0b2546bb17eea3f63fd55d-541fc80c08bc8047-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "0a5ba8fa3f8a79652fd3b308aa0e7906", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:delete\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3adelete\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:23 GMT", + "Date": "Tue, 23 Mar 2021 19:43:06 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "907c3278-02e8-415d-a207-b73b2541b9bd" + "X-Ms-Correlation-Request-Id": "f8084cf4-d1ab-487f-b3ab-c34f03bb6dab" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-6cec28b7653c6a4ba07ffc00d0e6f89f-8df4f4016beafe42-00", + "traceparent": "00-9fb7e94fce0b2546bb17eea3f63fd55d-ed9ea4711031d740-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "dba6f073d96a2c3d5dd8e75898de3f48", @@ -138,7 +138,7 @@ ], "Connection": "keep-alive", "Content-Length": "0", - "Date": "Sat, 20 Mar 2021 19:33:23 GMT", + "Date": "Tue, 23 Mar 2021 19:43:07 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,9 +147,9 @@ ], "X-Content-Type-Options": "nosniff", "X-Ms-Client-Request-Id": "dba6f073d96a2c3d5dd8e75898de3f48", - "X-Ms-Correlation-Request-Id": "a13bfc19-6c5d-4022-a24a-a92473ad97c9", + "X-Ms-Correlation-Request-Id": "0b2bf324-3b0b-47eb-9077-c1f514925d16", "X-Ms-Int-Docker-Content-Digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", - "X-Ms-Request-Id": "b52d13da-089d-4cd4-a982-d66244ba08de" + "X-Ms-Request-Id": "38e0051c-f677-49f3-984a-df54af7d16ad" }, "ResponseBody": [] }, @@ -159,9 +159,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-fa75b205c21cea47-00", + "traceparent": "00-1837f71716639145bf09769f0fe64a62-a58cdab6c97fa549-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "79d03e146fd4cd3b2cbab8607b1fbcf8", @@ -179,7 +179,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -188,7 +188,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "b91ecaac-5ff5-40f4-9fba-488e8cb30870" + "X-Ms-Correlation-Request-Id": "46dac962-ba5b-4f88-9e3e-47333afb39c0" }, "ResponseBody": { "errors": [ @@ -213,9 +213,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-43230134a4457f4b-00", + "traceparent": "00-1837f71716639145bf09769f0fe64a62-8cfcb79340223f44-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "f05e6702348291bedfd8d64ef1bb4114", @@ -226,11 +226,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "7445e90e-9555-4205-9eaa-321a7c3f0a14" + "X-Ms-Correlation-Request-Id": "acf527bf-3e84-42c0-8333-daa1ac9da099" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -241,26 +241,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-1fb93c6d6ec13741-00", + "traceparent": "00-1837f71716639145bf09769f0fe64a62-863e3dfe6257ca45-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "310957905d948aab6c8dded08604fe10", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "993dfa80-01d1-46e8-a361-cdb3e3d95455" + "X-Ms-Correlation-Request-Id": "4a084b19-04a8-41d4-8972-e1960843af73" }, "ResponseBody": { "access_token": "Sanitized" @@ -272,9 +272,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-ad71728ac7075f4fb24baafe9dfff231-fa75b205c21cea47-00", + "traceparent": "00-1837f71716639145bf09769f0fe64a62-a58cdab6c97fa549-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "79d03e146fd4cd3b2cbab8607b1fbcf8", @@ -292,7 +292,7 @@ "Connection": "keep-alive", "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -300,7 +300,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "3bae5727-9ffa-4347-9d71-12e4fecc2e28" + "X-Ms-Correlation-Request-Id": "30043057-08ea-46d9-b275-45c9aa62aeb5" }, "ResponseBody": { "errors": [ diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json index 29cda8aa20b5..a8c0396d3691 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanDeleteTagAsync.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-d624b3535a83c942-00", + "traceparent": "00-f0a544f38f060447b3d6c23f9e85e264-9fef11de49f2a74e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "eaef574b5f8a390ad9119fa02837f3eb", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "214", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:45 GMT", + "Date": "Tue, 23 Mar 2021 19:43:27 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:delete\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "d113a6bc-222f-4916-a7df-d2fba6cc61bf" + "X-Ms-Correlation-Request-Id": "fb750c2f-7d4e-4299-a8a9-875ad553b7a7" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-53c9848aa614484d-00", + "traceparent": "00-f0a544f38f060447b3d6c23f9e85e264-952426bd1e5a2c4e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "de124a0c5d9e65fae446ae5353a51778", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:45 GMT", + "Date": "Tue, 23 Mar 2021 19:43:27 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "d7b937cf-4319-40a8-bf47-23282ece9bb1" + "X-Ms-Correlation-Request-Id": "12b0e404-422a-48f4-9caf-b07af08ae75a" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "135", + "Content-Length": "141", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-211903b9152a1a46-00", + "traceparent": "00-f0a544f38f060447b3d6c23f9e85e264-35d6a4ce26627b46-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "8005e17ba198a34f103945279de33009", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:delete\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3adelete\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:45 GMT", + "Date": "Tue, 23 Mar 2021 19:43:27 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "1715d15d-f133-4aea-86a3-8a5f43f57dff" + "X-Ms-Correlation-Request-Id": "1b23383f-0a9a-4002-aa59-8f2f22fd32dd" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-89ff9bda3357f3418ee9cd04c302e1f0-d624b3535a83c942-00", + "traceparent": "00-f0a544f38f060447b3d6c23f9e85e264-9fef11de49f2a74e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "eaef574b5f8a390ad9119fa02837f3eb", @@ -138,7 +138,7 @@ ], "Connection": "keep-alive", "Content-Length": "0", - "Date": "Sat, 20 Mar 2021 19:33:45 GMT", + "Date": "Tue, 23 Mar 2021 19:43:27 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,9 +147,9 @@ ], "X-Content-Type-Options": "nosniff", "X-Ms-Client-Request-Id": "eaef574b5f8a390ad9119fa02837f3eb", - "X-Ms-Correlation-Request-Id": "7ddcb42b-7367-47aa-a87c-17e1f0327bda", + "X-Ms-Correlation-Request-Id": "3c9c5183-e201-43d8-a303-2549863f08a8", "X-Ms-Int-Docker-Content-Digest": "sha256:308866a43596e83578c7dfa15e27a73011bdd402185a84c5cd7f32a88b501a24", - "X-Ms-Request-Id": "4a090faf-8dc8-484a-af7b-c481e0d8786a" + "X-Ms-Request-Id": "0b420f12-dbe9-46c7-b55b-008da1391755" }, "ResponseBody": [] }, @@ -159,9 +159,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-ac7256fb001abf45-00", + "traceparent": "00-22b8708cef48f6459af8873d51cbc36d-59ddeb83f4f16845-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "44dc80688a3dee2b5c8a0643b0b7e534", @@ -179,7 +179,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:50 GMT", + "Date": "Tue, 23 Mar 2021 19:43:32 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -188,7 +188,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "249e7336-0b9e-4cf7-b626-72200277674d" + "X-Ms-Correlation-Request-Id": "c9f745ee-f634-4a04-ae45-f37375abf545" }, "ResponseBody": { "errors": [ @@ -213,9 +213,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-8c02b2ea59a14845-00", + "traceparent": "00-22b8708cef48f6459af8873d51cbc36d-19bc7590f20e154d-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "462527f972316a52fb6fcd6517d2c701", @@ -226,11 +226,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:32 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "15c736db-a6a2-4f31-a6ee-3e566d16948a" + "X-Ms-Correlation-Request-Id": "a9a9c1cd-94ef-48e1-bd1b-fe5f6e9d97bc" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -241,26 +241,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-dea381664d45184b-00", + "traceparent": "00-22b8708cef48f6459af8873d51cbc36d-71ab2681ab5ea14d-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d2eaa515d3c9f03ab616230e9b0bf259", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:32 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "5ec9843f-f99d-4d43-a359-fd0f300d4439" + "X-Ms-Correlation-Request-Id": "f6f01821-391e-4f4c-b53e-96d304f022e8" }, "ResponseBody": { "access_token": "Sanitized" @@ -272,9 +272,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5da5bdcb9ea86a48a62ad2406a036aaf-ac7256fb001abf45-00", + "traceparent": "00-22b8708cef48f6459af8873d51cbc36d-59ddeb83f4f16845-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "44dc80688a3dee2b5c8a0643b0b7e534", @@ -292,7 +292,7 @@ "Connection": "keep-alive", "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -300,7 +300,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "0c5c1b2a-65c4-4a77-bb83-33cd2ef3c95d" + "X-Ms-Correlation-Request-Id": "9c76eb9d-5c1e-4a7d-af8a-cf90e0d1d243" }, "ResponseBody": { "errors": [ diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json index d45348062a12..1529cabead05 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryProperties.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-59c7ca9f82768847b4a228808301c147-4b5a7945c1550046-00", + "traceparent": "00-0b1af9688fcf5e44a3c48c6934b00b05-d6b7b97dd4ddf144-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e54d655359012a9fde41fe55b61410cb", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "6bef7b00-9052-4c1b-a352-906dbb4f3387" + "X-Ms-Correlation-Request-Id": "dcfc850a-e2e0-4422-a815-b10b6e22cd30" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-59c7ca9f82768847b4a228808301c147-de65a67e20e12643-00", + "traceparent": "00-0b1af9688fcf5e44a3c48c6934b00b05-c4750e2cc158b648-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e7d0a522909dd765c6dd27a4267399e7", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "c3bb2d45-0a14-4c08-970a-e7ed44e3a5fa" + "X-Ms-Correlation-Request-Id": "be200418-bfc5-43f6-a08e-a0340732f180" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-59c7ca9f82768847b4a228808301c147-0b389036719f884e-00", + "traceparent": "00-0b1af9688fcf5e44a3c48c6934b00b05-c942eaca78102341-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "571f8bca375793634fbbc00d10745f52", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "f92671d9-8906-4d3a-a567-c94c99c5ff8b" + "X-Ms-Correlation-Request-Id": "008e91cf-1b65-44ef-b5af-4def9e73cc1f" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-59c7ca9f82768847b4a228808301c147-4b5a7945c1550046-00", + "traceparent": "00-0b1af9688fcf5e44a3c48c6934b00b05-d6b7b97dd4ddf144-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e54d655359012a9fde41fe55b61410cb", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,13 +147,13 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "15a0adc9-93a5-4dae-91de-59d656946e14" + "X-Ms-Correlation-Request-Id": "20b66c07-1ffe-4cf2-89be-8c72870e1b8c" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:32:57.6243214Z", + "lastUpdateTime": "2021-03-23T19:42:42.1333253Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json index 4cc174202751..171be2fab76b 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetRepositoryPropertiesAsync.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-2e20338cec5f6842-00", + "traceparent": "00-e794c9a8e7349e48b341251f8aa4e62d-518f82a80385254b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "1ce1ea6e5ecc87fbf23c279ea2c6cce2", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:33 GMT", + "Date": "Tue, 23 Mar 2021 19:43:15 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "c56b3722-ff89-4afd-b12d-bcf8749ed36a" + "X-Ms-Correlation-Request-Id": "9805b1bc-ed21-4255-80be-72ca3a11caf0" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-4df6074876f66848-00", + "traceparent": "00-e794c9a8e7349e48b341251f8aa4e62d-e07e87531e92a042-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "25d8634890be6ffdd74fb8e1fcd9dd0e", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Date": "Tue, 23 Mar 2021 19:43:15 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "07e0f729-8f4e-4c7e-a8c2-4b1bf09b78e0" + "X-Ms-Correlation-Request-Id": "e8516c98-68de-418e-8c85-cba2a65e92d1" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-ca0bf9514676424d-00", + "traceparent": "00-e794c9a8e7349e48b341251f8aa4e62d-b77633369a64e043-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "853686acd3ce3b1e11e9e42c73ae31ab", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Date": "Tue, 23 Mar 2021 19:43:15 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "a7e5c9fb-4255-4b03-84b1-62722ad5f688" + "X-Ms-Correlation-Request-Id": "9c1308a9-1bc5-4e99-8cba-feabd6e08b77" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-755b87ac93ba20409062a8e193ae68cd-2e20338cec5f6842-00", + "traceparent": "00-e794c9a8e7349e48b341251f8aa4e62d-518f82a80385254b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "1ce1ea6e5ecc87fbf23c279ea2c6cce2", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Date": "Tue, 23 Mar 2021 19:43:15 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,13 +147,13 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "463b6348-c5b4-4d84-8be5-b57423427a58" + "X-Ms-Correlation-Request-Id": "3b8fa2eb-bd1f-4663-8a8f-d24290e4ea9c" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "lastUpdateTime": "2021-03-23T19:43:07.0254955Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json index 1d4a1ba5eeb8..da3bfa41dacc 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagProperties.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-017a5aa7bbb0f247-00", + "traceparent": "00-72ee9911c997ef4baee0c065cecc87aa-af0061082ead984b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "856a71d8ace1e11d50a9f2ed02514028", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:11 GMT", + "Date": "Tue, 23 Mar 2021 19:42:54 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "b27b8c55-0854-4117-8e77-f0944502f9b4" + "X-Ms-Correlation-Request-Id": "6556e68c-9c3a-494f-af25-73637bd741fb" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-ca726c47dcfb4a46-00", + "traceparent": "00-72ee9911c997ef4baee0c065cecc87aa-cb768e5fd6a93840-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "5681b71ad398af19a67ecf4bd53ccde2", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:12 GMT", + "Date": "Tue, 23 Mar 2021 19:42:55 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "026f769e-f024-402b-8fb7-f970e99e0533" + "X-Ms-Correlation-Request-Id": "4f8da842-1d25-4ba3-bf35-04b19d38f396" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-8892213f3102e842-00", + "traceparent": "00-72ee9911c997ef4baee0c065cecc87aa-8ce5cb4e0826d949-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "4508d86cc45f4beae2941854f4cd95ad", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:12 GMT", + "Date": "Tue, 23 Mar 2021 19:42:55 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "aa67bc4f-b828-46c2-beed-9b1e1dcb2f79" + "X-Ms-Correlation-Request-Id": "1d7d8677-bb5c-4634-895f-561b38238ef7" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-4c7b3122aa032f4c977c38c400462f68-017a5aa7bbb0f247-00", + "traceparent": "00-72ee9911c997ef4baee0c065cecc87aa-af0061082ead984b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "856a71d8ace1e11d50a9f2ed02514028", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:12 GMT", + "Date": "Tue, 23 Mar 2021 19:42:55 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,7 +147,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "b6267ff8-21a1-46e4-8e20-0b94760125a0" + "X-Ms-Correlation-Request-Id": "66cdf315-015a-4a31-84b7-7b2922df4299" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json index 65ad9b56a715..3d9149fa1924 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanGetTagPropertiesAsync.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-5de15ad37cb3ed4b-00", + "traceparent": "00-142d69c4f6104646a229731fbab5762c-71e610474459f048-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "8392bf514252599bf0171a70e5e85f7e", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Date": "Tue, 23 Mar 2021 19:43:16 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "723e5f41-b173-4ef4-b85f-a75311146cfd" + "X-Ms-Correlation-Request-Id": "cd8e310a-8ad2-461f-8eea-38fdeaaea945" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-a7d5fe856381854b-00", + "traceparent": "00-142d69c4f6104646a229731fbab5762c-1fd845f4d994da4e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "2312808614d61dbbfbb32b381bdb4138", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Date": "Tue, 23 Mar 2021 19:43:16 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "70502fce-3d83-4ad5-a9df-0ae3e8bd50fb" + "X-Ms-Correlation-Request-Id": "7c01ef6a-db86-4459-a526-5546b4e86a72" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-fa56e3bafa2b2143-00", + "traceparent": "00-142d69c4f6104646a229731fbab5762c-9af80ad29dc9df4e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d7dc80be9616cf532c408963d1facc8c", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Date": "Tue, 23 Mar 2021 19:43:16 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "f3f66f1a-c620-433a-b6c0-760194f744d0" + "X-Ms-Correlation-Request-Id": "d608619e-5ad4-4add-b7a5-c33247f977e4" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-ca15994429a84f4c8006da1d24c46cb4-5de15ad37cb3ed4b-00", + "traceparent": "00-142d69c4f6104646a229731fbab5762c-71e610474459f048-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "8392bf514252599bf0171a70e5e85f7e", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:34 GMT", + "Date": "Tue, 23 Mar 2021 19:43:16 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,7 +147,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "f7f17c83-512a-4a06-9e55-748de4029f2a" + "X-Ms-Correlation-Request-Id": "f4620aab-6e13-4229-a4a3-df6cee407a8f" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json index 705de53a85c2..b733caaddd65 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryProperties.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-d20c2bc3215fd944-00", + "traceparent": "00-cbe4abeec2ff854885b491524e2685b6-5f6b8ff8e5163d4b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "46c518fab7442e2ec3e8a674939ee240", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "daab7e15-086f-4364-9119-dd6d51d47546" + "X-Ms-Correlation-Request-Id": "42b42309-3686-479c-a715-e8b030a3514e" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-7d1c41b4629cca4a-00", + "traceparent": "00-cbe4abeec2ff854885b491524e2685b6-4a16df6916ed5746-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "7225f3a97268aa8c3df55ce8a3af2654", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "cbf0ffb1-1f8c-4468-9973-291b1e912cfd" + "X-Ms-Correlation-Request-Id": "35a2ce29-80e3-4b22-800b-49a633d7c8f3" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-5c3b7e67541c0e40-00", + "traceparent": "00-cbe4abeec2ff854885b491524e2685b6-e24f05d816729246-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "9bd00bd4252805a3e8265896299acb01", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "138d6d58-07c8-492a-835b-43b6090620e2" + "X-Ms-Correlation-Request-Id": "e617623c-c6a8-4eba-9837-f9172195c034" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-af626c5d3a105c4fb877c74d8316bfa5-d20c2bc3215fd944-00", + "traceparent": "00-cbe4abeec2ff854885b491524e2685b6-5f6b8ff8e5163d4b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "46c518fab7442e2ec3e8a674939ee240", @@ -137,9 +137,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "312", + "Content-Length": "310", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,13 +147,13 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "4b9bf17b-ec4e-4338-a616-119ef17a007f" + "X-Ms-Correlation-Request-Id": "14f83555-9183-453b-a477-32107a67afa6" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:15.5757437Z", + "lastUpdateTime": "2021-03-23T19:43:00.95477Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { @@ -170,11 +170,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-3f2930b5ed833b4a-00", + "traceparent": "00-0ac45298141074438afc05c2cfb4f977-18e80b339f746246-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "001f348f1d09888f8b1b084e5a458b14", @@ -183,8 +183,8 @@ "RequestBody": { "deleteEnabled": false, "writeEnabled": false, - "listEnabled": true, - "readEnabled": true + "listEnabled": false, + "readEnabled": false }, "StatusCode": 401, "ResponseHeaders": { @@ -197,7 +197,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:12 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -206,7 +206,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "e17a1966-a792-447c-a7c4-d4beabb3da00" + "X-Ms-Correlation-Request-Id": "af2042c2-9775-46ed-bf32-7a6bdf333427" }, "ResponseBody": { "errors": [ @@ -231,9 +231,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-2637dd43355ea148-00", + "traceparent": "00-0ac45298141074438afc05c2cfb4f977-d4d94cf6e1988e46-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "87a052c247cd83184f1f894219f580a3", @@ -244,11 +244,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "aea7bf7f-ba75-4dd5-bbe8-8d8aa2610117" + "X-Ms-Correlation-Request-Id": "16558ae9-7e18-49ad-adff-5fee2acb81ef" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -259,26 +259,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-0459cc4c0d0ff846-00", + "traceparent": "00-0ac45298141074438afc05c2cfb4f977-9f3f25a8c91ed147-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "6f595b292590b64a7b480f0d1c54aba2", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:29 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "3d88eee1-e7bf-4da8-8c2b-ad4316acf9b9" + "X-Ms-Correlation-Request-Id": "ecf6c850-a71d-43b0-a3d0-0f4d43114cc4" }, "ResponseBody": { "access_token": "Sanitized" @@ -290,11 +290,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-bfa92ed381c4534fb8be6f02dca2ed5a-3f2930b5ed833b4a-00", + "traceparent": "00-0ac45298141074438afc05c2cfb4f977-18e80b339f746246-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "001f348f1d09888f8b1b084e5a458b14", @@ -303,8 +303,8 @@ "RequestBody": { "deleteEnabled": false, "writeEnabled": false, - "listEnabled": true, - "readEnabled": true + "listEnabled": false, + "readEnabled": false }, "StatusCode": 200, "ResponseHeaders": { @@ -315,9 +315,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "314", + "Content-Length": "316", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -325,20 +325,20 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "99eed7fb-da6f-46ba-a03f-a84b4488bc77" + "X-Ms-Correlation-Request-Id": "4dbcc858-c381-4d84-b432-5dab007b55a1" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "lastUpdateTime": "2021-03-23T19:43:07.0254955Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { "deleteEnabled": false, "writeEnabled": false, - "readEnabled": true, - "listEnabled": true + "readEnabled": false, + "listEnabled": false } } }, @@ -348,9 +348,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-e6adb7c48f0eac4a-00", + "traceparent": "00-96a130e6f75c3949901818cd2d6a5a7a-e84a7545a861a742-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d7d4449a43f948341b9bb1e9944d6f96", @@ -368,7 +368,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -377,7 +377,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "6b3e2733-0d9b-4dc5-a981-f1573af17238" + "X-Ms-Correlation-Request-Id": "6ecf3a50-cdbe-411f-aeb7-eeb25368d6ce" }, "ResponseBody": { "errors": [ @@ -402,9 +402,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-0ea800cdf69a2345-00", + "traceparent": "00-96a130e6f75c3949901818cd2d6a5a7a-083749dca59c054e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "ff25659a1cec9c8307ea0c85370b66fa", @@ -415,11 +415,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "cab9d9c2-0191-405c-9a7d-a27a3ef60a3c" + "X-Ms-Correlation-Request-Id": "ff09a967-b85b-4f8c-a302-ba300bb02dc9" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -430,26 +430,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-de45b1f4376c7c4e-00", + "traceparent": "00-96a130e6f75c3949901818cd2d6a5a7a-82b39279dff0f444-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d4a7e674a821e5aa271153f57461222d", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "f7fbdb80-af29-42b1-8aca-0adf52d5bd4b" + "X-Ms-Correlation-Request-Id": "6fda850c-6cc9-40a4-9890-ee8263158de6" }, "ResponseBody": { "access_token": "Sanitized" @@ -461,9 +461,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-9e4ad8fabb354b48861540c7e37f091e-e6adb7c48f0eac4a-00", + "traceparent": "00-96a130e6f75c3949901818cd2d6a5a7a-e84a7545a861a742-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d7d4449a43f948341b9bb1e9944d6f96", @@ -479,9 +479,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "314", + "Content-Length": "316", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -489,20 +489,20 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "8fda1b14-2092-4eac-9275-e4ca745c1f7d" + "X-Ms-Correlation-Request-Id": "833087cd-fde3-4169-8159-f1c103c7471b" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "lastUpdateTime": "2021-03-23T19:43:07.0254955Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { "deleteEnabled": false, "writeEnabled": false, - "readEnabled": true, - "listEnabled": true + "readEnabled": false, + "listEnabled": false } } }, @@ -514,9 +514,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-1e7e66be7549f048-00", + "traceparent": "00-ac4cd4a0bec38b49b19fe4467a5ebf8d-17deb87e7521284c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "b77279d8ab2f7eb6c137d00f36af1010", @@ -539,7 +539,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -548,7 +548,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "ed5bf831-2229-403d-8f6e-2e5d2d2d60a8" + "X-Ms-Correlation-Request-Id": "52964957-12a8-4376-b2f5-3225272ed393" }, "ResponseBody": { "errors": [ @@ -573,9 +573,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-af0057060e742e48-00", + "traceparent": "00-ac4cd4a0bec38b49b19fe4467a5ebf8d-2bcafabfbc73c34d-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "ad74b6349aa6f174ba3fd8dac88d27a5", @@ -586,11 +586,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "9e03d374-7d1b-419d-abf0-542e976ef8f2" + "X-Ms-Correlation-Request-Id": "d84e41c9-4049-49eb-b2eb-2881fa632c63" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -601,26 +601,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-6baaf3d3a89ea743-00", + "traceparent": "00-ac4cd4a0bec38b49b19fe4467a5ebf8d-eb239a0ac39ce94b-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "beacdfc7af98c8cb2f2813e9d89aaf78", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:30 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "92153760-6869-4487-a85d-92fcdae8fb90" + "X-Ms-Correlation-Request-Id": "321bb936-f09a-480f-b0ad-5d97d1a2d477" }, "ResponseBody": { "access_token": "Sanitized" @@ -634,9 +634,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-a11036af7928cf4997ff89d8f36c1a84-1e7e66be7549f048-00", + "traceparent": "00-ac4cd4a0bec38b49b19fe4467a5ebf8d-17deb87e7521284c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "b77279d8ab2f7eb6c137d00f36af1010", @@ -659,7 +659,7 @@ "Connection": "keep-alive", "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -667,13 +667,13 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "340760cb-f219-4bed-b22d-86ca7346d5c7" + "X-Ms-Correlation-Request-Id": "d3ba15e6-0bdb-4eac-8381-5c31b1b93311" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:23.9050228Z", + "lastUpdateTime": "2021-03-23T19:43:07.0254955Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json index c9847b0ef486..7998105b9cde 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetRepositoryPropertiesAsync.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-d2a7c90962266544b169010380fd15dc-f084f47134c1284f-00", + "traceparent": "00-3be144290e63c3449bfc68c85d80e360-2730799b71ddca49-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "70cb0d11aaa9ceac9d45067fd9eefbb1", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "331f1aee-89b1-4cb5-abfa-1c489d0c51da" + "X-Ms-Correlation-Request-Id": "015b338f-7e63-4846-9937-d12ab12959a0" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-d2a7c90962266544b169010380fd15dc-15b5da4a2854bd4f-00", + "traceparent": "00-3be144290e63c3449bfc68c85d80e360-8cbf12c2a11cf844-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "239395fe8c9e23f80f0c78eedba3f857", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "2f73336f-8f00-41f9-b22b-123101d118c4" + "X-Ms-Correlation-Request-Id": "5d085d98-622a-45be-8f8c-a725ab411fa0" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-d2a7c90962266544b169010380fd15dc-bab868de07517c42-00", + "traceparent": "00-3be144290e63c3449bfc68c85d80e360-8a1ba9e88b93ce42-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "4214d0530f66f30d932d17da977bfb6e", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "2aa9996c-d161-414e-8255-c2dcbf254a14" + "X-Ms-Correlation-Request-Id": "e70246af-f0e8-4d5e-aa22-bf6e9e9484a6" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-d2a7c90962266544b169010380fd15dc-f084f47134c1284f-00", + "traceparent": "00-3be144290e63c3449bfc68c85d80e360-2730799b71ddca49-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "70cb0d11aaa9ceac9d45067fd9eefbb1", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,13 +147,13 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "d0d3445d-5e01-457f-a1c0-7e7ae5e2a8c9" + "X-Ms-Correlation-Request-Id": "4313985d-bc97-4199-9479-b02ba5fb978d" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:37.7692193Z", + "lastUpdateTime": "2021-03-23T19:43:19.6079301Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { @@ -170,11 +170,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-279337b199e77c409bfffca652a15979-8d0ed51a11fa7e40-00", + "traceparent": "00-a88c3d06d02b7a43a405b388b5b734c5-22a69b5391e9404f-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "005a637e6e1385d714a7619c32bef2fa", @@ -183,8 +183,8 @@ "RequestBody": { "deleteEnabled": false, "writeEnabled": false, - "listEnabled": true, - "readEnabled": true + "listEnabled": false, + "readEnabled": false }, "StatusCode": 401, "ResponseHeaders": { @@ -197,7 +197,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -206,7 +206,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "b2d022a5-a069-496a-8a05-6f3f6a524921" + "X-Ms-Correlation-Request-Id": "3b3e7b51-d25f-433d-a153-fd25c9ba45ce" }, "ResponseBody": { "errors": [ @@ -231,9 +231,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-279337b199e77c409bfffca652a15979-ba8720be56439a40-00", + "traceparent": "00-a88c3d06d02b7a43a405b388b5b734c5-70bd9eded2c79545-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "082baf4db9d9ef4a88a08f70741e8b94", @@ -244,11 +244,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "3922768d-2ab0-4169-b857-b5055f6d716e" + "X-Ms-Correlation-Request-Id": "c571ef38-d50c-4c90-b260-35bf08c7023e" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -259,26 +259,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-279337b199e77c409bfffca652a15979-ef461fa3dda06d49-00", + "traceparent": "00-a88c3d06d02b7a43a405b388b5b734c5-00f81b5bb885df49-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "786f0a11f749e543f98f2dbeae70c0d5", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:51 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "5a428246-3dc0-4016-9563-a3bcaafece66" + "X-Ms-Correlation-Request-Id": "64eb1dac-bf98-4f9a-8c26-5f8e4003e2a0" }, "ResponseBody": { "access_token": "Sanitized" @@ -290,11 +290,11 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-279337b199e77c409bfffca652a15979-8d0ed51a11fa7e40-00", + "traceparent": "00-a88c3d06d02b7a43a405b388b5b734c5-22a69b5391e9404f-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "005a637e6e1385d714a7619c32bef2fa", @@ -303,8 +303,8 @@ "RequestBody": { "deleteEnabled": false, "writeEnabled": false, - "listEnabled": true, - "readEnabled": true + "listEnabled": false, + "readEnabled": false }, "StatusCode": 200, "ResponseHeaders": { @@ -315,9 +315,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "314", + "Content-Length": "316", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:52 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -325,20 +325,20 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "30b46530-8f19-4ab4-840b-f72b04d87f34" + "X-Ms-Correlation-Request-Id": "59256942-d00e-4174-a979-dd81db18f306" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:45.7784103Z", + "lastUpdateTime": "2021-03-23T19:43:27.5541996Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { "deleteEnabled": false, "writeEnabled": false, - "readEnabled": true, - "listEnabled": true + "readEnabled": false, + "listEnabled": false } } }, @@ -348,9 +348,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-7a7f251c8301ca4c-00", + "traceparent": "00-ef5725a9d19ce144bd490dc18b27f2d5-da071991759d004e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e88c1d3af24fc594186a7873df6611f5", @@ -368,7 +368,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:52 GMT", + "Date": "Tue, 23 Mar 2021 19:43:33 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -377,7 +377,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "9f1cde7f-b02b-4d8f-8b29-8d04e748d596" + "X-Ms-Correlation-Request-Id": "e3fe4515-3ead-4b8f-b5fe-c6fa721c12fc" }, "ResponseBody": { "errors": [ @@ -402,9 +402,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-fe7aac149714cc4f-00", + "traceparent": "00-ef5725a9d19ce144bd490dc18b27f2d5-2725021ccf3aa045-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "288acd1c7a4f55b16b460f4a8b8c4017", @@ -415,11 +415,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:52 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "dcdda8b5-2daf-49ec-b6d0-e9020b28ab93" + "X-Ms-Correlation-Request-Id": "2544bb01-19e3-4605-a0cb-dcfa8970eba5" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -430,26 +430,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-e4ee8aa789bd034c-00", + "traceparent": "00-ef5725a9d19ce144bd490dc18b27f2d5-57982e269f70f245-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "5636bae0a3911e4475a95fde7fd00592", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:52 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "40f8f22c-265a-43a3-b9c9-fd93b99d89ab" + "X-Ms-Correlation-Request-Id": "b33278ef-5ae1-48e0-bee9-e9a8994d7172" }, "ResponseBody": { "access_token": "Sanitized" @@ -461,9 +461,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5177dd3ab90c234cae522ee2135d145c-7a7f251c8301ca4c-00", + "traceparent": "00-ef5725a9d19ce144bd490dc18b27f2d5-da071991759d004e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e88c1d3af24fc594186a7873df6611f5", @@ -479,9 +479,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "314", + "Content-Length": "316", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -489,20 +489,20 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "dc50d49e-c999-4e99-acb2-a13164d7ee80" + "X-Ms-Correlation-Request-Id": "fb2f1e5c-5799-4fca-9d44-965daffa22ad" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:45.7784103Z", + "lastUpdateTime": "2021-03-23T19:43:27.5541996Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { "deleteEnabled": false, "writeEnabled": false, - "readEnabled": true, - "listEnabled": true + "readEnabled": false, + "listEnabled": false } } }, @@ -514,9 +514,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-711f214e765e984d-00", + "traceparent": "00-29d5b1326d489349b0ccd20bdc6174dd-2e86b345e2287a44-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e1a2377e98e6bf866c377c09e349398c", @@ -539,7 +539,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -548,7 +548,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "99e2db71-d3c6-4a01-88ad-66963d4a2f33" + "X-Ms-Correlation-Request-Id": "4e765533-95b5-4721-827f-6429b76314fa" }, "ResponseBody": { "errors": [ @@ -573,9 +573,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-2bc0e9f307946848-00", + "traceparent": "00-29d5b1326d489349b0ccd20bdc6174dd-e7ab19b1fd85654e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "24936029ba307963886bb2a51bd2d59b", @@ -586,11 +586,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "8489d065-e531-462c-9d51-b395c24a403c" + "X-Ms-Correlation-Request-Id": "f717452d-b741-4d2a-aeef-c7ebd4c7cd78" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -601,26 +601,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-c8a11ca5899d4247-00", + "traceparent": "00-29d5b1326d489349b0ccd20bdc6174dd-187b912805f16241-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "54cc7c405fea47313476ea5a263b3a2b", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "47886c79-8648-491f-9cdf-e2e9937a1b28" + "X-Ms-Correlation-Request-Id": "fb8755f4-9961-4093-93ea-4ee48e33d82f" }, "ResponseBody": { "access_token": "Sanitized" @@ -634,9 +634,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-95c8cf32aa611547bd0d7e38bc650134-711f214e765e984d-00", + "traceparent": "00-29d5b1326d489349b0ccd20bdc6174dd-2e86b345e2287a44-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e1a2377e98e6bf866c377c09e349398c", @@ -659,7 +659,7 @@ "Connection": "keep-alive", "Content-Length": "312", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -667,13 +667,13 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "b44b4a16-a25c-4a9d-814f-e1ffd5820413" + "X-Ms-Correlation-Request-Id": "b79d2ecc-3b49-4dde-ac8a-bf34946b743e" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", "imageName": "library/hello-world", "createdTime": "2021-03-11T23:39:48.4064552Z", - "lastUpdateTime": "2021-03-20T19:33:45.7784103Z", + "lastUpdateTime": "2021-03-23T19:43:27.5541996Z", "manifestCount": 10, "tagCount": 1, "changeableAttributes": { diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json index df81bb7e8a08..c8bdb28d6b12 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagProperties.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-8ec2f3a21804654a-00", + "traceparent": "00-19d0da0bd852a0429ea4f44f1a21d13b-0c47b96bb63abd4f-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "5c47a10ec1a6080c584daa6f7d8f5709", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:13 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "81dd8714-b8b2-43a8-be1b-b5826940fb28" + "X-Ms-Correlation-Request-Id": "dc61b73d-6932-42f2-b29b-daa375d001bc" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-0d6803c66c864844-00", + "traceparent": "00-19d0da0bd852a0429ea4f44f1a21d13b-57ca511c7ef17246-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "a9cac790cc30fc5aab7fe53029b83f0a", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "a210c240-527b-47cb-aed8-ffe539a032f0" + "X-Ms-Correlation-Request-Id": "901a25da-ce39-4a30-94a3-aafe6ad54185" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-a073b70b7523934e-00", + "traceparent": "00-19d0da0bd852a0429ea4f44f1a21d13b-6817a69594911246-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "1f6ecb5d5dad53825f78f76d6093bd40", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "e073dc6e-2b9a-4cb0-ad01-1239d05ff979" + "X-Ms-Correlation-Request-Id": "7699b3a3-6c98-4581-9f11-68b4139723f8" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-5715794b20e4de4ab0f049aaf01820d2-8ec2f3a21804654a-00", + "traceparent": "00-19d0da0bd852a0429ea4f44f1a21d13b-0c47b96bb63abd4f-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "5c47a10ec1a6080c584daa6f7d8f5709", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,7 +147,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "7c3bb221-86f6-467d-8457-c0ae11c17c02" + "X-Ms-Correlation-Request-Id": "4043f830-57d4-4a97-893b-34cdae1bca0b" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", @@ -173,19 +173,19 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-0b29ff47bfaa7b4d-00", + "traceparent": "00-a3ad87f40741d544bd133e9136576200-978d0944d6b4fc47-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "047c53ea7a0d41ac474bb026dbdbdf9f", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "listEnabled": false, "readEnabled": false }, @@ -200,7 +200,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -209,7 +209,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "086334d6-62c4-4eac-9b4d-ddb9e1e3b2b9" + "X-Ms-Correlation-Request-Id": "acf371f0-9828-4746-838d-5b47f4627b7b" }, "ResponseBody": { "errors": [ @@ -234,9 +234,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-2d1cc96986cd0742-00", + "traceparent": "00-a3ad87f40741d544bd133e9136576200-96d58049740e8441-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "b1129f0d3820325c45774ab8d4ec9b17", @@ -247,11 +247,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "ae2b565b-e319-4258-a29e-9c2c6aef5512" + "X-Ms-Correlation-Request-Id": "17c93e73-5d15-4297-b52c-5a9f232f1f13" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -262,26 +262,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-181860f62ddca242-00", + "traceparent": "00-a3ad87f40741d544bd133e9136576200-acf5bed5457e2246-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "d545a5c13a3ce2fc1f2dd762ad5b7783", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:31 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "54eb9c58-23e8-48e2-b13c-b93603859e52" + "X-Ms-Correlation-Request-Id": "954845c8-1b41-4172-97b6-89e43a6200c0" }, "ResponseBody": { "access_token": "Sanitized" @@ -293,19 +293,19 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-888e2fcecd01de4dace80f17467cd80a-0b29ff47bfaa7b4d-00", + "traceparent": "00-a3ad87f40741d544bd133e9136576200-978d0944d6b4fc47-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "047c53ea7a0d41ac474bb026dbdbdf9f", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "listEnabled": false, "readEnabled": false }, @@ -318,9 +318,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "404", + "Content-Length": "406", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -328,7 +328,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "a8ac52e5-deaa-4361-970f-938afc217bbe" + "X-Ms-Correlation-Request-Id": "c1b207ec-c64c-4ebd-bea9-c014b3a0391e" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", @@ -340,8 +340,8 @@ "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", "signed": false, "changeableAttributes": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "readEnabled": false, "listEnabled": false } @@ -354,9 +354,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-f377cb12e3be19448928f73eb8d17816-80b6c3b1b2547c45-00", + "traceparent": "00-ad2326feef39ec439a8a3c1823eb5e9e-3f3a139ced325340-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "c06058980b81b21ff749bf9630f36c5b", @@ -374,7 +374,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -383,7 +383,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "0acf30cf-d862-4363-b462-daa4102f2ec6" + "X-Ms-Correlation-Request-Id": "39c7eb10-dd89-4198-8344-58ea38ef8ab7" }, "ResponseBody": { "errors": [ @@ -408,9 +408,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-f377cb12e3be19448928f73eb8d17816-9483a95a23934249-00", + "traceparent": "00-ad2326feef39ec439a8a3c1823eb5e9e-9de5bd2f1ac64745-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "366598af0996d263a32f92f260f985ea", @@ -421,11 +421,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "37e9e286-c20f-4be5-ab04-0e49cfc649cb" + "X-Ms-Correlation-Request-Id": "ac3b496f-5ad3-486e-949a-fff9fdb33a0c" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -436,26 +436,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-f377cb12e3be19448928f73eb8d17816-1e6364c91ee8a74b-00", + "traceparent": "00-ad2326feef39ec439a8a3c1823eb5e9e-bc349f730c990f4a-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "7c1fc6ffda8bb5958593ddf27b66b22b", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "649e5cd2-ecda-4a74-bcf3-b77bd1957413" + "X-Ms-Correlation-Request-Id": "499b731e-2532-4f78-9f34-08f0523b2038" }, "ResponseBody": { "access_token": "Sanitized" @@ -467,9 +467,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-f377cb12e3be19448928f73eb8d17816-80b6c3b1b2547c45-00", + "traceparent": "00-ad2326feef39ec439a8a3c1823eb5e9e-3f3a139ced325340-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "c06058980b81b21ff749bf9630f36c5b", @@ -485,9 +485,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "404", + "Content-Length": "406", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -495,7 +495,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "2fb43de5-4c73-4386-9225-b2561e94eaae" + "X-Ms-Correlation-Request-Id": "1e6ebe15-9e32-45f5-890c-dc333637e996" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", @@ -507,8 +507,8 @@ "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", "signed": false, "changeableAttributes": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "readEnabled": false, "listEnabled": false } @@ -523,9 +523,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-a7e6a5e5464b6146-00", + "traceparent": "00-88776a0ae9cd234bbfa052e536d9a374-feb5e282b792f549-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "14b37cc041f68fedf58d1d52792d51fe", @@ -548,7 +548,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -557,7 +557,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "bfb7a4aa-ae0d-4801-b09e-eabb43fa7264" + "X-Ms-Correlation-Request-Id": "a086ec1a-79a8-4385-b7a8-c99b153c6079" }, "ResponseBody": { "errors": [ @@ -582,9 +582,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-4a70c8967e17864e-00", + "traceparent": "00-88776a0ae9cd234bbfa052e536d9a374-2b44ee7491a9d747-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "6a96d5c4f0d3d4cf02afb0022b70573d", @@ -595,11 +595,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "07514522-ae7c-4ce5-8d9c-f0e8afcbe2bb" + "X-Ms-Correlation-Request-Id": "f8f3c112-5ca2-48fc-9e06-2bed63c4b582" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -610,26 +610,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-9ee2f260fec37240-00", + "traceparent": "00-88776a0ae9cd234bbfa052e536d9a374-b2b20b230adc1343-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "e432667d7046bef4d89087febd433c58", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:32 GMT", + "Date": "Tue, 23 Mar 2021 19:43:14 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "064cec1a-b4a1-481d-a62e-f3df0e070297" + "X-Ms-Correlation-Request-Id": "8cd29d1b-a645-4eb2-8746-8e6e7191326c" }, "ResponseBody": { "access_token": "Sanitized" @@ -643,9 +643,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-0bb51fb812965f44a1eecdd315e713b2-a7e6a5e5464b6146-00", + "traceparent": "00-88776a0ae9cd234bbfa052e536d9a374-feb5e282b792f549-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "14b37cc041f68fedf58d1d52792d51fe", @@ -668,7 +668,7 @@ "Connection": "keep-alive", "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:33 GMT", + "Date": "Tue, 23 Mar 2021 19:43:15 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -676,7 +676,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "6988b56b-a4c7-4f94-9e65-3bc89ec3f803" + "X-Ms-Correlation-Request-Id": "e32b3468-3555-4270-b21f-eea52b71838d" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json index 297c4719fa89..e6ecd913f25c 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/SessionRecords/ContainerRepositoryClientLiveTests/CanSetTagPropertiesAsync.json @@ -6,9 +6,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-9d6c4e9fa307a94d-00", + "traceparent": "00-2f5c2ffc2a3d654086cb10ca76031e18-a2a74578356d684e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "c90ebe782f976d2b4e4c007ed2d7dc1e", @@ -26,7 +26,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:53 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -35,7 +35,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "454fb804-84f0-47f8-8599-983e520999c3" + "X-Ms-Correlation-Request-Id": "9d9efb31-8a8c-4466-b663-e0e42d1e8eb0" }, "ResponseBody": { "errors": [ @@ -60,9 +60,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-3eb4ce9e83849e4f-00", + "traceparent": "00-2f5c2ffc2a3d654086cb10ca76031e18-80b7642a91dd574a-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "01a0674006624c5c5249c88376f5bf1c", @@ -73,11 +73,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "6491b987-01a1-4de6-aaae-8d48d5d8b552" + "X-Ms-Correlation-Request-Id": "c414174e-5fad-4754-b603-aa0a73d8366b" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -88,26 +88,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-1d97e81bd8f20c41-00", + "traceparent": "00-2f5c2ffc2a3d654086cb10ca76031e18-313ef0d7baa17045-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "ffb212e67aff03ad43a648c2ddacf558", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "45eadb23-df8c-4a34-b24f-10adba1564bb" + "X-Ms-Correlation-Request-Id": "9f1addf8-57c6-4ebc-a142-de52799cc2b2" }, "ResponseBody": { "access_token": "Sanitized" @@ -119,9 +119,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-bcb68c52e01b0c449dee29ebca7ff956-9d6c4e9fa307a94d-00", + "traceparent": "00-2f5c2ffc2a3d654086cb10ca76031e18-a2a74578356d684e-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "c90ebe782f976d2b4e4c007ed2d7dc1e", @@ -139,7 +139,7 @@ "Connection": "keep-alive", "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -147,7 +147,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "ba8cae20-8243-4b95-88b4-5c1cc3b05a51" + "X-Ms-Correlation-Request-Id": "acdf5e74-296b-4e58-8678-8ad6f3c0f2b0" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", @@ -173,19 +173,19 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-b95220283d462747b31a81efedbc8377-6d31b99b3a465641-00", + "traceparent": "00-2d38197a78ee5a41865a2ef54172c8b8-387d47472d46d842-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "88c41f6d9ad1712461c1774d67a7f759", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "listEnabled": false, "readEnabled": false }, @@ -200,7 +200,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:34 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -209,7 +209,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "76ca0228-dfd7-47d5-af8f-59c3a55fd764" + "X-Ms-Correlation-Request-Id": "a20ef2dd-e711-4cd4-8ba0-eaf94d6cac8a" }, "ResponseBody": { "errors": [ @@ -234,9 +234,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-b95220283d462747b31a81efedbc8377-6b98d34884e31845-00", + "traceparent": "00-2d38197a78ee5a41865a2ef54172c8b8-4ddac6c862efc545-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "bf97e38ddd24c61eb99dbdbcbd9a6ea6", @@ -247,11 +247,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "7b6fb9f9-f26b-4e72-bd15-0c41eae07a45" + "X-Ms-Correlation-Request-Id": "d883e141-0db3-427b-bd56-aae60070e536" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -262,26 +262,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-b95220283d462747b31a81efedbc8377-b78cdd1b1083074e-00", + "traceparent": "00-2d38197a78ee5a41865a2ef54172c8b8-7deb7dfeb663a74a-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "56166f5437314c4aed419d3d035f9b9c", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "ccc8aa7c-d7d1-4d21-a932-2213823f823b" + "X-Ms-Correlation-Request-Id": "039764a8-cb12-45cc-8a09-e969d33da3a3" }, "ResponseBody": { "access_token": "Sanitized" @@ -293,19 +293,19 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Content-Length": "82", + "Content-Length": "84", "Content-Type": "application/json", - "traceparent": "00-b95220283d462747b31a81efedbc8377-6d31b99b3a465641-00", + "traceparent": "00-2d38197a78ee5a41865a2ef54172c8b8-387d47472d46d842-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "88c41f6d9ad1712461c1774d67a7f759", "x-ms-return-client-request-id": "true" }, "RequestBody": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "listEnabled": false, "readEnabled": false }, @@ -318,9 +318,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "keep-alive", - "Content-Length": "404", + "Content-Length": "406", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -328,7 +328,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "9c2046a7-f841-4e72-808e-bff2dafbc816" + "X-Ms-Correlation-Request-Id": "6c19ac18-4bcd-4067-ac10-d32c89410adf" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", @@ -340,8 +340,8 @@ "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", "signed": false, "changeableAttributes": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "readEnabled": false, "listEnabled": false } @@ -354,9 +354,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-0759cd461cb7384e9396fe43c730135f-6e0bced9eb246346-00", + "traceparent": "00-24f0b512c892614092af22d36a6a49f1-8f84c9f70b18d94f-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "f935efaf36158f3300fece34dc68b3c7", @@ -374,7 +374,7 @@ "Connection": "keep-alive", "Content-Length": "221", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -383,7 +383,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_read\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "209f8749-dfaf-4e4a-9d1a-068629eec830" + "X-Ms-Correlation-Request-Id": "8b320365-50ed-4df9-9890-45f3881b8ec0" }, "ResponseBody": { "errors": [ @@ -408,9 +408,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-0759cd461cb7384e9396fe43c730135f-cc4fa710ace4e84d-00", + "traceparent": "00-24f0b512c892614092af22d36a6a49f1-37067cadf0656940-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "f7f9d152a0915527994bd1e340e1c35a", @@ -421,11 +421,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "1483d7f1-d17f-48f0-8d92-763ea8ad5a5a" + "X-Ms-Correlation-Request-Id": "fbb7f3a8-9a9f-4414-ab7b-5835be0e628d" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -436,26 +436,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "142", + "Content-Length": "148", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-0759cd461cb7384e9396fe43c730135f-dcc74cf7a5ace946-00", + "traceparent": "00-24f0b512c892614092af22d36a6a49f1-ef43a925cb4a0147-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "ce0d210175651e913c86553369166f85", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_read\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_read\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "b4f1910f-3425-4eb9-adcc-bdfe7c1eec35" + "X-Ms-Correlation-Request-Id": "02964916-6608-402e-98b5-e9e4f3f4303d" }, "ResponseBody": { "access_token": "Sanitized" @@ -467,9 +467,9 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-0759cd461cb7384e9396fe43c730135f-6e0bced9eb246346-00", + "traceparent": "00-24f0b512c892614092af22d36a6a49f1-8f84c9f70b18d94f-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "f935efaf36158f3300fece34dc68b3c7", @@ -485,9 +485,9 @@ "X-Ms-Correlation-Request-Id" ], "Connection": "close", - "Content-Length": "404", + "Content-Length": "406", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -495,7 +495,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "c99c5a84-199f-4df0-87d9-b8a7d4a7d14e" + "X-Ms-Correlation-Request-Id": "679d7697-b9de-48bf-a97b-df2f6ac6c183" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", @@ -507,8 +507,8 @@ "lastUpdateTime": "2021-03-20T04:04:46.2118653Z", "signed": false, "changeableAttributes": { - "deleteEnabled": true, - "writeEnabled": true, + "deleteEnabled": false, + "writeEnabled": false, "readEnabled": false, "listEnabled": false } @@ -523,9 +523,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-5755724fa4886b42-00", + "traceparent": "00-a16c25d320d0064cbedace8176d36684-20b6e9cee7c51b4c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "31ead58da4650e0bc7df60c964504f1f", @@ -548,7 +548,7 @@ "Connection": "keep-alive", "Content-Length": "222", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:54 GMT", + "Date": "Tue, 23 Mar 2021 19:43:35 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -557,7 +557,7 @@ ], "WWW-Authenticate": "Bearer realm=\u0022https://annelocontainerregistry.azurecr.io/oauth2/token\u0022,service=\u0022annelocontainerregistry.azurecr.io\u0022,scope=\u0022repository:library/hello-world:metadata_write\u0022,error=\u0022invalid_token\u0022", "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "4a4e6af1-b840-4a03-a4e1-6a7236532694" + "X-Ms-Correlation-Request-Id": "f264b621-97db-4f9c-94d0-a905a36f4b6d" }, "ResponseBody": { "errors": [ @@ -582,9 +582,9 @@ "Accept": "application/json", "Content-Length": "89", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-2dbefc4c1859b549-00", + "traceparent": "00-a16c25d320d0064cbedace8176d36684-7d89cd229835954c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "bb32733ae55add6240dbba0a4af4ec82", @@ -595,11 +595,11 @@ "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:55 GMT", + "Date": "Tue, 23 Mar 2021 19:43:36 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "edc96bc7-ddb0-4401-acda-304b3822e303" + "X-Ms-Correlation-Request-Id": "d81d26d2-d410-4a30-999e-7e9b61e3bf69" }, "ResponseBody": { "refresh_token": "Sanitized" @@ -610,26 +610,26 @@ "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json", - "Content-Length": "143", + "Content-Length": "149", "Content-Type": "application/x-www-form-urlencoded", - "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-b5f9d15f5e55d04f-00", + "traceparent": "00-a16c25d320d0064cbedace8176d36684-ce3e83db6211de45-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "6a564cdc91f65df516ff068514c7b9ec", "x-ms-return-client-request-id": "true" }, - "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository:library/hello-world:metadata_write\u0026refresh_token=Sanitized", + "RequestBody": "grant_type=refresh_token\u0026service=annelocontainerregistry.azurecr.io\u0026scope=repository%3alibrary%2fhello-world%3ametadata_write\u0026refresh_token=Sanitized", "StatusCode": 200, "ResponseHeaders": { "Connection": "keep-alive", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:55 GMT", + "Date": "Tue, 23 Mar 2021 19:43:36 GMT", "Server": "openresty", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Transfer-Encoding": "chunked", - "X-Ms-Correlation-Request-Id": "aca22150-c638-4349-9bbd-5fcd7133157a" + "X-Ms-Correlation-Request-Id": "a1b15c2a-4f3d-4c0d-9434-1533901e8f22" }, "ResponseBody": { "access_token": "Sanitized" @@ -643,9 +643,9 @@ "Authorization": "Sanitized", "Content-Length": "80", "Content-Type": "application/json", - "traceparent": "00-45e19bf8e3b0e840b640c8a2d9cecef7-5755724fa4886b42-00", + "traceparent": "00-a16c25d320d0064cbedace8176d36684-20b6e9cee7c51b4c-00", "User-Agent": [ - "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210320.1", + "azsdk-net-Containers.ContainerRegistry/1.0.0-alpha.20210323.1", "(.NET 5.0.4; Microsoft Windows 10.0.19042)" ], "x-ms-client-request-id": "31ead58da4650e0bc7df60c964504f1f", @@ -668,7 +668,7 @@ "Connection": "keep-alive", "Content-Length": "402", "Content-Type": "application/json; charset=utf-8", - "Date": "Sat, 20 Mar 2021 19:33:55 GMT", + "Date": "Tue, 23 Mar 2021 19:43:36 GMT", "Docker-Distribution-Api-Version": "registry/2.0", "Server": "openresty", "Strict-Transport-Security": [ @@ -676,7 +676,7 @@ "max-age=31536000; includeSubDomains" ], "X-Content-Type-Options": "nosniff", - "X-Ms-Correlation-Request-Id": "afc6e13b-658e-4763-81d9-0b5e8efbdda1" + "X-Ms-Correlation-Request-Id": "dcd0f63b-cac2-4259-82cc-3e7296c9488b" }, "ResponseBody": { "registry": "annelocontainerregistry.azurecr.io", From 2f371f108bc700106372a7abfb77571c31180e12 Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Tue, 23 Mar 2021 13:01:07 -0700 Subject: [PATCH 05/10] update api --- .../Azure.Containers.ContainerRegistry.netstandard2.0.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs index 346e02ba53dc..9b2805789e29 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs @@ -3,8 +3,8 @@ namespace Azure.Containers.ContainerRegistry public partial class ContainerRegistryClient { protected ContainerRegistryClient() { } - public ContainerRegistryClient(System.Uri endpoint, string username, string password) { } - public ContainerRegistryClient(System.Uri endpoint, string username, string password, Azure.Containers.ContainerRegistry.ContainerRegistryClientOptions options) { } + public ContainerRegistryClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ContainerRegistryClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Containers.ContainerRegistry.ContainerRegistryClientOptions options) { } public virtual Azure.Pageable GetRepositories(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetRepositoriesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -19,8 +19,8 @@ public enum ServiceVersion public partial class ContainerRepositoryClient { protected ContainerRepositoryClient() { } - public ContainerRepositoryClient(System.Uri endpoint, string repository, string username, string password) { } - public ContainerRepositoryClient(System.Uri endpoint, string repository, string username, string password, Azure.Containers.ContainerRegistry.ContainerRegistryClientOptions options) { } + public ContainerRepositoryClient(System.Uri endpoint, string repository, Azure.Core.TokenCredential credential) { } + public ContainerRepositoryClient(System.Uri endpoint, string repository, Azure.Core.TokenCredential credential, Azure.Containers.ContainerRegistry.ContainerRegistryClientOptions options) { } public virtual System.Uri Endpoint { get { throw null; } } public virtual Azure.Response DeleteTag(string tag, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteTagAsync(string tag, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } From f6d2e08e8420fe4be82ecce14bafbe0d5668d24a Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Tue, 23 Mar 2021 17:44:21 -0700 Subject: [PATCH 06/10] rename policy and begin work on test. --- ...rRegistryChallengeAuthenticationPolicy.cs} | 4 ++-- .../src/ContainerRegistryClient.cs | 2 +- .../Repositories/ContainerRepositoryClient.cs | 2 +- .../src/properties/AssemblyInfo.cs | 1 + ...gistryChallengeAuthenticationPolicyTest.cs | 21 +++++++++++++++++++ 5 files changed, 26 insertions(+), 4 deletions(-) rename sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/{ContainerRegistryCredentialsPolicy.cs => ContainerRegistryChallengeAuthenticationPolicy.cs} (94%) create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs similarity index 94% rename from sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs rename to sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs index a8a235cb6d90..c5c6fc24897a 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryCredentialsPolicy.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs @@ -31,12 +31,12 @@ namespace Azure.Containers.ContainerRegistry /// Step 5: GET /api/v1/acr/repositories /// Request Header: { Bearer acrTokenAccess } /// - internal class ContainerRegistryCredentialsPolicy : BearerTokenChallengeAuthenticationPolicy + internal class ContainerRegistryChallengeAuthenticationPolicy : BearerTokenChallengeAuthenticationPolicy { private readonly RefreshTokensRestClient _exchangeRestClient; private readonly AccessTokensRestClient _tokenRestClient; - public ContainerRegistryCredentialsPolicy(TokenCredential credential, string aadScope, RefreshTokensRestClient exchangeRestClient, AccessTokensRestClient tokenRestClient) + public ContainerRegistryChallengeAuthenticationPolicy(TokenCredential credential, string aadScope, RefreshTokensRestClient exchangeRestClient, AccessTokensRestClient tokenRestClient) : base(credential, aadScope) { Argument.AssertNotNull(credential, nameof(credential)); diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs index 875b78503806..2364fe376176 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs @@ -45,7 +45,7 @@ public ContainerRegistryClient(Uri endpoint, TokenCredential credential, Contain _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); - _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryChallengeAuthenticationPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); _restClient = new ContainerRegistryRestClient(_clientDiagnostics, _pipeline, _endpoint.AbsoluteUri); } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs index bc1b38f37f33..93e13f445f25 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs @@ -51,7 +51,7 @@ public ContainerRepositoryClient(Uri endpoint, string repository, TokenCredentia _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); - _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryCredentialsPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryChallengeAuthenticationPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); _restClient = new ContainerRegistryRepositoryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/properties/AssemblyInfo.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/properties/AssemblyInfo.cs index 47ed2085a083..992876fb05b5 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/properties/AssemblyInfo.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/properties/AssemblyInfo.cs @@ -4,3 +4,4 @@ using System.Runtime.CompilerServices; [assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.ContainerRegistry")] +[assembly: InternalsVisibleTo("Azure.Containers.ContainerRegistry.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs new file mode 100644 index 000000000000..ec417ceab433 --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Containers.ContainerRegistry.Tests +{ + public class ContainerRegistryChallengeAuthenticationPolicyTest : SyncAsyncPolicyTestBase + { + public ContainerRegistryChallengeAuthenticationPolicyTest(bool isAsync) : base(isAsync) { } + + [Test] + public async Task ChallengePolicySetsToken() + { + // TODO: understand how to handle REST calls that happen as part of the policy. + var policy = new ContainerRegistryChallengeAuthenticationPolicy(credential, "scope"); + } + } +} From 56761114606efb6da2bc61b6751621cc5cbf6e19 Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Wed, 24 Mar 2021 10:04:03 -0700 Subject: [PATCH 07/10] upgrade to latest swagger to reduce number of auth clients --- ...erRegistryChallengeAuthenticationPolicy.cs | 34 ++--- .../src/ContainerRegistryClient.cs | 8 +- ...tClient.cs => AuthenticationRestClient.cs} | 112 ++++++++------- .../src/Generated/Models/AccessToken.cs | 28 ---- ...ion.cs => AcrAccessToken.Serialization.cs} | 6 +- .../src/Generated/Models/AcrAccessToken.cs | 28 ++++ .../Models/AcrManifests.Serialization.cs | 8 +- .../src/Generated/Models/AcrManifests.cs | 6 +- ...on.cs => AcrRefreshToken.Serialization.cs} | 6 +- .../src/Generated/Models/AcrRefreshToken.cs | 28 ++++ .../ManifestAttributesBase.Serialization.cs | 38 +++-- .../Models/ManifestAttributesBase.cs | 39 +++-- ...ributesManifestReferences.Serialization.cs | 41 ++++++ .../ManifestAttributesManifestReferences.cs | 30 +++- ...tentApplicationXWwwFormUrlencodedSchema.cs | 23 +-- ...tentApplicationXWwwFormUrlencodedSchema.cs | 14 +- .../Models/PostContentSchemaGrantType.cs | 54 ------- .../src/Generated/Models/RefreshToken.cs | 28 ---- ...egistryArtifactProperties.Serialization.cs | 46 +++--- .../Models/RegistryArtifactProperties.cs | 49 +++++-- .../RepositoryProperties.Serialization.cs | 38 +---- .../Generated/Models/RepositoryProperties.cs | 34 +++-- .../Models/TagAttributesBase.Serialization.cs | 16 +-- .../src/Generated/Models/TagAttributesBase.cs | 18 ++- .../Generated/Models/TagList.Serialization.cs | 10 +- .../src/Generated/Models/TagList.cs | 17 ++- .../Models/TagProperties.Serialization.cs | 24 +--- .../src/Generated/Models/TagProperties.cs | 30 ++-- .../src/Generated/RefreshTokensRestClient.cs | 133 ------------------ .../Repositories/ContainerRepositoryClient.cs | 8 +- .../src/autorest.md | 2 +- ...gistryChallengeAuthenticationPolicyTest.cs | 12 +- .../ContainerRepositoryClientLiveTests.cs | 12 +- 33 files changed, 415 insertions(+), 565 deletions(-) rename sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/{AccessTokensRestClient.cs => AuthenticationRestClient.cs} (68%) delete mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AccessToken.cs rename sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/{AccessToken.Serialization.cs => AcrAccessToken.Serialization.cs} (76%) create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrAccessToken.cs rename sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/{RefreshToken.Serialization.cs => AcrRefreshToken.Serialization.cs} (75%) create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrRefreshToken.cs create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs delete mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PostContentSchemaGrantType.cs delete mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RefreshToken.cs delete mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/RefreshTokensRestClient.cs diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs index c5c6fc24897a..c59d0157caa3 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs @@ -33,17 +33,15 @@ namespace Azure.Containers.ContainerRegistry /// internal class ContainerRegistryChallengeAuthenticationPolicy : BearerTokenChallengeAuthenticationPolicy { - private readonly RefreshTokensRestClient _exchangeRestClient; - private readonly AccessTokensRestClient _tokenRestClient; + private readonly AuthenticationRestClient _authenticationClient; - public ContainerRegistryChallengeAuthenticationPolicy(TokenCredential credential, string aadScope, RefreshTokensRestClient exchangeRestClient, AccessTokensRestClient tokenRestClient) + public ContainerRegistryChallengeAuthenticationPolicy(TokenCredential credential, string aadScope, AuthenticationRestClient authenticationClient) : base(credential, aadScope) { Argument.AssertNotNull(credential, nameof(credential)); Argument.AssertNotNull(aadScope, nameof(aadScope)); - _exchangeRestClient = exchangeRestClient; - _tokenRestClient = tokenRestClient; + _authenticationClient = authenticationClient; } protected override async ValueTask AuthenticateRequestOnChallengeAsync(HttpMessage message, bool async) @@ -81,43 +79,37 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt private async Task ExchangeAadAccessTokenForAcrRefreshTokenAsync(HttpMessage message, string service, bool async) { - string aadAccessToken = GetAuthorizationHeader(message); + string aadAccessToken = GetAuthorizationToken(message); - Response acrRefreshToken = null; + Response acrRefreshToken = null; if (async) { - acrRefreshToken = await _exchangeRestClient.GetFromExchangeAsync( - PostContentSchemaGrantType.AccessToken, - service, - accessToken: aadAccessToken).ConfigureAwait(false); + acrRefreshToken = await _authenticationClient.ExchangeAadAccessTokenForAcrRefreshTokenAsync(service, aadAccessToken).ConfigureAwait(false); } else { - acrRefreshToken = _exchangeRestClient.GetFromExchange( - PostContentSchemaGrantType.AccessToken, - service, - accessToken: aadAccessToken); + acrRefreshToken = _authenticationClient.ExchangeAadAccessTokenForAcrRefreshToken(service, aadAccessToken); } - return acrRefreshToken.Value.RefreshTokenValue; + return acrRefreshToken.Value.RefreshToken; } private async Task ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string acrRefreshToken, string service, string scope, bool async) { - Response acrAccessToken = null; + Response acrAccessToken = null; if (async) { - acrAccessToken = await _tokenRestClient.GetAsync(service, scope, acrRefreshToken).ConfigureAwait(false); + acrAccessToken = await _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessTokenAsync(service, scope, acrRefreshToken).ConfigureAwait(false); } else { - acrAccessToken = _tokenRestClient.Get(service, scope, acrRefreshToken); + acrAccessToken = _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessToken(service, scope, acrRefreshToken); } - return acrAccessToken.Value.AccessTokenValue; + return acrAccessToken.Value.AccessToken; } - private static string GetAuthorizationHeader(HttpMessage message) + private static string GetAuthorizationToken(HttpMessage message) { string aadAuthHeader; if (!message.Request.Headers.TryGetValue(HttpHeader.Names.Authorization, out aadAuthHeader)) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs index 2364fe376176..d3832d260b2f 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs @@ -20,8 +20,7 @@ public partial class ContainerRegistryClient private readonly ClientDiagnostics _clientDiagnostics; private readonly ContainerRegistryRestClient _restClient; - private readonly RefreshTokensRestClient _tokenExchangeClient; - private readonly AccessTokensRestClient _acrTokenClient; + private readonly AuthenticationRestClient _acrAuthClient; private readonly string AcrAadScope = "https://management.core.windows.net/.default"; /// @@ -42,10 +41,9 @@ public ContainerRegistryClient(Uri endpoint, TokenCredential credential, Contain _clientDiagnostics = new ClientDiagnostics(options); _acrAuthPipeline = HttpPipelineBuilder.Build(options); - _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); - _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); + _acrAuthClient = new AuthenticationRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); - _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryChallengeAuthenticationPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryChallengeAuthenticationPolicy(credential, AcrAadScope, _acrAuthClient)); _restClient = new ContainerRegistryRestClient(_clientDiagnostics, _pipeline, _endpoint.AbsoluteUri); } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/AccessTokensRestClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/AuthenticationRestClient.cs similarity index 68% rename from sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/AccessTokensRestClient.cs rename to sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/AuthenticationRestClient.cs index 51a3395d0868..c4e5dd3c81c8 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/AccessTokensRestClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/AuthenticationRestClient.cs @@ -15,18 +15,18 @@ namespace Azure.Containers.ContainerRegistry { - internal partial class AccessTokensRestClient + internal partial class AuthenticationRestClient { private string url; private ClientDiagnostics _clientDiagnostics; private HttpPipeline _pipeline; - /// Initializes a new instance of AccessTokensRestClient. + /// Initializes a new instance of AuthenticationRestClient. /// The handler for diagnostic messaging in the client. /// The HTTP pipeline for sending and receiving REST requests and responses. /// Registry login URL. /// is null. - public AccessTokensRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url) + public AuthenticationRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url) { if (url == null) { @@ -38,56 +38,50 @@ public AccessTokensRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline _pipeline = pipeline; } - internal HttpMessage CreateGetRequest(string service, string scope, string refreshToken) + internal HttpMessage CreateExchangeAadAccessTokenForAcrRefreshTokenRequest(string service, string accessToken) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.AppendRaw(url, false); - uri.AppendPath("/oauth2/token", false); + uri.AppendPath("/oauth2/exchange", false); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); var content = new FormUrlEncodedContent(); - content.Add("grant_type", "refresh_token"); + content.Add("grant_type", "access_token"); content.Add("service", service); - content.Add("scope", scope); - content.Add("refresh_token", refreshToken); + content.Add("access_token", accessToken); request.Content = content; return message; } - /// Exchange ACR Refresh token for an ACR Access Token. + /// Exchange AAD tokens for an ACR refresh Token. /// Indicates the name of your Azure container registry. - /// Which is expected to be a valid scope, and can be specified more than once for multiple scope requests. You obtained this from the Www-Authenticate response header from the challenge. - /// Must be a valid ACR refresh token. + /// AAD access token, mandatory when grant_type is access_token_refresh_token or access_token. /// The cancellation token to use. - /// , , or is null. - public async Task> GetAsync(string service, string scope, string refreshToken, CancellationToken cancellationToken = default) + /// or is null. + public async Task> ExchangeAadAccessTokenForAcrRefreshTokenAsync(string service, string accessToken, CancellationToken cancellationToken = default) { if (service == null) { throw new ArgumentNullException(nameof(service)); } - if (scope == null) - { - throw new ArgumentNullException(nameof(scope)); - } - if (refreshToken == null) + if (accessToken == null) { - throw new ArgumentNullException(nameof(refreshToken)); + throw new ArgumentNullException(nameof(accessToken)); } - using var message = CreateGetRequest(service, scope, refreshToken); + using var message = CreateExchangeAadAccessTokenForAcrRefreshTokenRequest(service, accessToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccessToken value = default; + AcrRefreshToken value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccessToken.DeserializeAccessToken(document.RootElement); + value = AcrRefreshToken.DeserializeAcrRefreshToken(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -95,36 +89,31 @@ public async Task> GetAsync(string service, string scope, } } - /// Exchange ACR Refresh token for an ACR Access Token. + /// Exchange AAD tokens for an ACR refresh Token. /// Indicates the name of your Azure container registry. - /// Which is expected to be a valid scope, and can be specified more than once for multiple scope requests. You obtained this from the Www-Authenticate response header from the challenge. - /// Must be a valid ACR refresh token. + /// AAD access token, mandatory when grant_type is access_token_refresh_token or access_token. /// The cancellation token to use. - /// , , or is null. - public Response Get(string service, string scope, string refreshToken, CancellationToken cancellationToken = default) + /// or is null. + public Response ExchangeAadAccessTokenForAcrRefreshToken(string service, string accessToken, CancellationToken cancellationToken = default) { if (service == null) { throw new ArgumentNullException(nameof(service)); } - if (scope == null) - { - throw new ArgumentNullException(nameof(scope)); - } - if (refreshToken == null) + if (accessToken == null) { - throw new ArgumentNullException(nameof(refreshToken)); + throw new ArgumentNullException(nameof(accessToken)); } - using var message = CreateGetRequest(service, scope, refreshToken); + using var message = CreateExchangeAadAccessTokenForAcrRefreshTokenRequest(service, accessToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccessToken value = default; + AcrRefreshToken value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccessToken.DeserializeAccessToken(document.RootElement); + value = AcrRefreshToken.DeserializeAcrRefreshToken(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -132,27 +121,33 @@ public Response Get(string service, string scope, string refreshTok } } - internal HttpMessage CreateGetFromLoginRequest(string service, string scope) + internal HttpMessage CreateExchangeAcrRefreshTokenForAcrAccessTokenRequest(string service, string scope, string refreshToken) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.AppendRaw(url, false); uri.AppendPath("/oauth2/token", false); - uri.AppendQuery("service", service, true); - uri.AppendQuery("scope", scope, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); + var content = new FormUrlEncodedContent(); + content.Add("grant_type", "refresh_token"); + content.Add("service", service); + content.Add("scope", scope); + content.Add("refresh_token", refreshToken); + request.Content = content; return message; } - /// Exchange Username, Password and Scope an ACR Access Token. + /// Exchange ACR Refresh token for an ACR Access Token. /// Indicates the name of your Azure container registry. - /// Expected to be a valid scope, and can be specified more than once for multiple scope requests. You can obtain this from the Www-Authenticate response header from the challenge. + /// Which is expected to be a valid scope, and can be specified more than once for multiple scope requests. You obtained this from the Www-Authenticate response header from the challenge. + /// Must be a valid ACR refresh token. /// The cancellation token to use. - /// or is null. - public async Task> GetFromLoginAsync(string service, string scope, CancellationToken cancellationToken = default) + /// , , or is null. + public async Task> ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string service, string scope, string refreshToken, CancellationToken cancellationToken = default) { if (service == null) { @@ -162,16 +157,20 @@ public async Task> GetFromLoginAsync(string service, strin { throw new ArgumentNullException(nameof(scope)); } + if (refreshToken == null) + { + throw new ArgumentNullException(nameof(refreshToken)); + } - using var message = CreateGetFromLoginRequest(service, scope); + using var message = CreateExchangeAcrRefreshTokenForAcrAccessTokenRequest(service, scope, refreshToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - AccessToken value = default; + AcrAccessToken value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AccessToken.DeserializeAccessToken(document.RootElement); + value = AcrAccessToken.DeserializeAcrAccessToken(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -179,12 +178,13 @@ public async Task> GetFromLoginAsync(string service, strin } } - /// Exchange Username, Password and Scope an ACR Access Token. + /// Exchange ACR Refresh token for an ACR Access Token. /// Indicates the name of your Azure container registry. - /// Expected to be a valid scope, and can be specified more than once for multiple scope requests. You can obtain this from the Www-Authenticate response header from the challenge. + /// Which is expected to be a valid scope, and can be specified more than once for multiple scope requests. You obtained this from the Www-Authenticate response header from the challenge. + /// Must be a valid ACR refresh token. /// The cancellation token to use. - /// or is null. - public Response GetFromLogin(string service, string scope, CancellationToken cancellationToken = default) + /// , , or is null. + public Response ExchangeAcrRefreshTokenForAcrAccessToken(string service, string scope, string refreshToken, CancellationToken cancellationToken = default) { if (service == null) { @@ -194,16 +194,20 @@ public Response GetFromLogin(string service, string scope, Cancella { throw new ArgumentNullException(nameof(scope)); } + if (refreshToken == null) + { + throw new ArgumentNullException(nameof(refreshToken)); + } - using var message = CreateGetFromLoginRequest(service, scope); + using var message = CreateExchangeAcrRefreshTokenForAcrAccessTokenRequest(service, scope, refreshToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - AccessToken value = default; + AcrAccessToken value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AccessToken.DeserializeAccessToken(document.RootElement); + value = AcrAccessToken.DeserializeAcrAccessToken(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AccessToken.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AccessToken.cs deleted file mode 100644 index 889c430fbec2..000000000000 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AccessToken.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Containers.ContainerRegistry -{ - /// The AccessToken. - internal partial class AccessToken - { - /// Initializes a new instance of AccessToken. - internal AccessToken() - { - } - - /// Initializes a new instance of AccessToken. - /// The access token for performing authenticated requests. - internal AccessToken(string accessTokenValue) - { - AccessTokenValue = accessTokenValue; - } - - /// The access token for performing authenticated requests. - public string AccessTokenValue { get; } - } -} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AccessToken.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrAccessToken.Serialization.cs similarity index 76% rename from sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AccessToken.Serialization.cs rename to sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrAccessToken.Serialization.cs index 399a366885e5..dbee9e52ccd7 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AccessToken.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrAccessToken.Serialization.cs @@ -10,9 +10,9 @@ namespace Azure.Containers.ContainerRegistry { - internal partial class AccessToken + internal partial class AcrAccessToken { - internal static AccessToken DeserializeAccessToken(JsonElement element) + internal static AcrAccessToken DeserializeAcrAccessToken(JsonElement element) { Optional accessToken = default; foreach (var property in element.EnumerateObject()) @@ -23,7 +23,7 @@ internal static AccessToken DeserializeAccessToken(JsonElement element) continue; } } - return new AccessToken(accessToken.Value); + return new AcrAccessToken(accessToken.Value); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrAccessToken.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrAccessToken.cs new file mode 100644 index 000000000000..a5aa45e4a8a1 --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrAccessToken.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Containers.ContainerRegistry +{ + /// The AcrAccessToken. + internal partial class AcrAccessToken + { + /// Initializes a new instance of AcrAccessToken. + internal AcrAccessToken() + { + } + + /// Initializes a new instance of AcrAccessToken. + /// The access token for performing authenticated requests. + internal AcrAccessToken(string accessToken) + { + AccessToken = accessToken; + } + + /// The access token for performing authenticated requests. + public string AccessToken { get; } + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.Serialization.cs index 373edf8ac3f4..ce83d77068c0 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.Serialization.cs @@ -15,17 +15,11 @@ internal partial class AcrManifests { internal static AcrManifests DeserializeAcrManifests(JsonElement element) { - Optional registry = default; Optional imageName = default; Optional> manifests = default; Optional link = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("registry")) - { - registry = property.Value.GetString(); - continue; - } if (property.NameEquals("imageName")) { imageName = property.Value.GetString(); @@ -52,7 +46,7 @@ internal static AcrManifests DeserializeAcrManifests(JsonElement element) continue; } } - return new AcrManifests(registry.Value, imageName.Value, Optional.ToList(manifests), link.Value); + return new AcrManifests(imageName.Value, Optional.ToList(manifests), link.Value); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.cs index 31222c263ada..a1497f2ab95c 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrManifests.cs @@ -20,20 +20,16 @@ internal AcrManifests() } /// Initializes a new instance of AcrManifests. - /// Registry name. /// Image name. /// List of manifests. /// . - internal AcrManifests(string registry, string repository, IReadOnlyList manifests, string link) + internal AcrManifests(string repository, IReadOnlyList manifests, string link) { - Registry = registry; Repository = repository; Manifests = manifests; Link = link; } - /// Registry name. - public string Registry { get; } /// Image name. public string Repository { get; } /// List of manifests. diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RefreshToken.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrRefreshToken.Serialization.cs similarity index 75% rename from sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RefreshToken.Serialization.cs rename to sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrRefreshToken.Serialization.cs index 6b1f3b1e600c..dba1204d49ca 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RefreshToken.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrRefreshToken.Serialization.cs @@ -10,9 +10,9 @@ namespace Azure.Containers.ContainerRegistry { - internal partial class RefreshToken + internal partial class AcrRefreshToken { - internal static RefreshToken DeserializeRefreshToken(JsonElement element) + internal static AcrRefreshToken DeserializeAcrRefreshToken(JsonElement element) { Optional refreshToken = default; foreach (var property in element.EnumerateObject()) @@ -23,7 +23,7 @@ internal static RefreshToken DeserializeRefreshToken(JsonElement element) continue; } } - return new RefreshToken(refreshToken.Value); + return new AcrRefreshToken(refreshToken.Value); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrRefreshToken.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrRefreshToken.cs new file mode 100644 index 000000000000..74e16f149836 --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/AcrRefreshToken.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Containers.ContainerRegistry +{ + /// The AcrRefreshToken. + internal partial class AcrRefreshToken + { + /// Initializes a new instance of AcrRefreshToken. + internal AcrRefreshToken() + { + } + + /// Initializes a new instance of AcrRefreshToken. + /// The refresh token to be used for generating access tokens. + internal AcrRefreshToken(string refreshToken) + { + RefreshToken = refreshToken; + } + + /// The refresh token to be used for generating access tokens. + public string RefreshToken { get; } + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.Serialization.cs index 421c8d0ed379..bbbfcfc179de 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.Serialization.cs @@ -16,16 +16,15 @@ internal partial class ManifestAttributesBase { internal static ManifestAttributesBase DeserializeManifestAttributesBase(JsonElement element) { - Optional digest = default; + string digest = default; Optional imageSize = default; Optional createdTime = default; Optional lastUpdateTime = default; Optional architecture = default; Optional os = default; - Optional mediaType = default; - Optional configMediaType = default; - Optional> tags = default; - Optional changeableAttributes = default; + Optional> references = default; + IReadOnlyList tags = default; + ContentProperties changeableAttributes = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("digest")) @@ -73,23 +72,23 @@ internal static ManifestAttributesBase DeserializeManifestAttributesBase(JsonEle os = property.Value.GetString(); continue; } - if (property.NameEquals("mediaType")) - { - mediaType = property.Value.GetString(); - continue; - } - if (property.NameEquals("configMediaType")) - { - configMediaType = property.Value.GetString(); - continue; - } - if (property.NameEquals("tags")) + if (property.NameEquals("references")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManifestAttributesManifestReferences.DeserializeManifestAttributesManifestReferences(item)); + } + references = array; + continue; + } + if (property.NameEquals("tags")) + { List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -100,16 +99,11 @@ internal static ManifestAttributesBase DeserializeManifestAttributesBase(JsonEle } if (property.NameEquals("changeableAttributes")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } changeableAttributes = ContentProperties.DeserializeContentProperties(property.Value); continue; } } - return new ManifestAttributesBase(digest.Value, Optional.ToNullable(imageSize), Optional.ToNullable(createdTime), Optional.ToNullable(lastUpdateTime), architecture.Value, os.Value, mediaType.Value, configMediaType.Value, Optional.ToList(tags), changeableAttributes.Value); + return new ManifestAttributesBase(digest, Optional.ToNullable(imageSize), Optional.ToNullable(createdTime), Optional.ToNullable(lastUpdateTime), architecture.Value, os.Value, Optional.ToList(references), tags, changeableAttributes); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.cs index f47b3d0a1253..15c4da5f8b37 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesBase.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; namespace Azure.Containers.ContainerRegistry @@ -15,9 +16,29 @@ namespace Azure.Containers.ContainerRegistry internal partial class ManifestAttributesBase { /// Initializes a new instance of ManifestAttributesBase. - internal ManifestAttributesBase() + /// Manifest. + /// List of tags. + /// Changeable attributes. + /// , , or is null. + internal ManifestAttributesBase(string digest, IEnumerable tags, ContentProperties manifestProperties) { - Tags = new ChangeTrackingList(); + if (digest == null) + { + throw new ArgumentNullException(nameof(digest)); + } + if (tags == null) + { + throw new ArgumentNullException(nameof(tags)); + } + if (manifestProperties == null) + { + throw new ArgumentNullException(nameof(manifestProperties)); + } + + Digest = digest; + RegistryArtifacts = new ChangeTrackingList(); + Tags = tags.ToList(); + ManifestProperties = manifestProperties; } /// Initializes a new instance of ManifestAttributesBase. @@ -27,11 +48,10 @@ internal ManifestAttributesBase() /// Last update time. /// CPU architecture. /// Operating system. - /// Media type. - /// Config blob media type. + /// List of manifest attributes details. /// List of tags. /// Changeable attributes. - internal ManifestAttributesBase(string digest, long? size, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, string cpuArchitecture, string operatingSystem, string manifestMediaType, string configMediaType, IReadOnlyList tags, ContentProperties manifestProperties) + internal ManifestAttributesBase(string digest, long? size, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, string cpuArchitecture, string operatingSystem, IReadOnlyList registryArtifacts, IReadOnlyList tags, ContentProperties manifestProperties) { Digest = digest; Size = size; @@ -39,8 +59,7 @@ internal ManifestAttributesBase(string digest, long? size, DateTimeOffset? creat LastUpdatedOn = lastUpdatedOn; CpuArchitecture = cpuArchitecture; OperatingSystem = operatingSystem; - ManifestMediaType = manifestMediaType; - ConfigMediaType = configMediaType; + RegistryArtifacts = registryArtifacts; Tags = tags; ManifestProperties = manifestProperties; } @@ -57,10 +76,8 @@ internal ManifestAttributesBase(string digest, long? size, DateTimeOffset? creat public string CpuArchitecture { get; } /// Operating system. public string OperatingSystem { get; } - /// Media type. - public string ManifestMediaType { get; } - /// Config blob media type. - public string ConfigMediaType { get; } + /// List of manifest attributes details. + public IReadOnlyList RegistryArtifacts { get; } /// List of tags. public IReadOnlyList Tags { get; } /// Changeable attributes. diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs new file mode 100644 index 000000000000..e9574379742d --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Containers.ContainerRegistry +{ + public partial class ManifestAttributesManifestReferences + { + internal static ManifestAttributesManifestReferences DeserializeManifestAttributesManifestReferences(JsonElement element) + { + string digest = default; + string architecture = default; + string os = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("digest")) + { + digest = property.Value.GetString(); + continue; + } + if (property.NameEquals("architecture")) + { + architecture = property.Value.GetString(); + continue; + } + if (property.NameEquals("os")) + { + os = property.Value.GetString(); + continue; + } + } + return new ManifestAttributesManifestReferences(digest, architecture, os); + } + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs index bd80b5144240..868e9ea1fe6f 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs @@ -5,21 +5,43 @@ #nullable disable +using System; + namespace Azure.Containers.ContainerRegistry { /// Manifest attributes details. - internal partial class ManifestAttributesManifestReferences + public partial class ManifestAttributesManifestReferences { /// Initializes a new instance of ManifestAttributesManifestReferences. - internal ManifestAttributesManifestReferences() + /// Manifest digest. + /// CPU architecture. + /// Operating system. + /// , , or is null. + internal ManifestAttributesManifestReferences(string digest, string cpuArchitecture, string operatingSystem) { + if (digest == null) + { + throw new ArgumentNullException(nameof(digest)); + } + if (cpuArchitecture == null) + { + throw new ArgumentNullException(nameof(cpuArchitecture)); + } + if (operatingSystem == null) + { + throw new ArgumentNullException(nameof(operatingSystem)); + } + + Digest = digest; + CpuArchitecture = cpuArchitecture; + OperatingSystem = operatingSystem; } /// Manifest digest. public string Digest { get; } /// CPU architecture. - public string Architecture { get; } + public string CpuArchitecture { get; } /// Operating system. - public string Os { get; } + public string OperatingSystem { get; } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs index 92984e362985..b100ee72c92a 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs @@ -13,29 +13,30 @@ namespace Azure.Containers.ContainerRegistry internal partial class Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema { /// Initializes a new instance of Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema. - /// Can take a value of access_token_refresh_token, or access_token, or refresh_token. /// Indicates the name of your Azure container registry. - /// is null. - internal Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema(PostContentSchemaGrantType grantType, string service) + /// AAD access token, mandatory when grant_type is access_token_refresh_token or access_token. + /// or is null. + internal Paths108HwamOauth2ExchangePostRequestbodyContentApplicationXWwwFormUrlencodedSchema(string service, string aadAccesstoken) { if (service == null) { throw new ArgumentNullException(nameof(service)); } + if (aadAccesstoken == null) + { + throw new ArgumentNullException(nameof(aadAccesstoken)); + } - GrantType = grantType; + GrantType = "access_token"; Service = service; + AadAccesstoken = aadAccesstoken; } - /// Can take a value of access_token_refresh_token, or access_token, or refresh_token. - public PostContentSchemaGrantType GrantType { get; } + /// Can take a value of access_token. + public string GrantType { get; } /// Indicates the name of your Azure container registry. public string Service { get; } - /// AAD tenant associated to the AAD credentials. - public string Tenant { get; } - /// AAD refresh token, mandatory when grant_type is access_token_refresh_token or refresh_token. - public string RefreshToken { get; } /// AAD access token, mandatory when grant_type is access_token_refresh_token or access_token. - public string AccessToken { get; } + public string AadAccesstoken { get; } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs index 826882f757e4..9bf7d4f6ffc8 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencodedSchema.cs @@ -15,9 +15,9 @@ internal partial class PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXW /// Initializes a new instance of PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencodedSchema. /// Indicates the name of your Azure container registry. /// Which is expected to be a valid scope, and can be specified more than once for multiple scope requests. You obtained this from the Www-Authenticate response header from the challenge. - /// Must be a valid ACR refresh token. - /// , , or is null. - internal PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencodedSchema(string service, string scope, string refreshToken) + /// Must be a valid ACR refresh token. + /// , , or is null. + internal PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencodedSchema(string service, string scope, string acrRefreshToken) { if (service == null) { @@ -27,15 +27,15 @@ internal PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencod { throw new ArgumentNullException(nameof(scope)); } - if (refreshToken == null) + if (acrRefreshToken == null) { - throw new ArgumentNullException(nameof(refreshToken)); + throw new ArgumentNullException(nameof(acrRefreshToken)); } GrantType = "refresh_token"; Service = service; Scope = scope; - RefreshToken = refreshToken; + AcrRefreshToken = acrRefreshToken; } /// Grant type is expected to be refresh_token. @@ -45,6 +45,6 @@ internal PathsV3R3RxOauth2TokenPostRequestbodyContentApplicationXWwwFormUrlencod /// Which is expected to be a valid scope, and can be specified more than once for multiple scope requests. You obtained this from the Www-Authenticate response header from the challenge. public string Scope { get; } /// Must be a valid ACR refresh token. - public string RefreshToken { get; } + public string AcrRefreshToken { get; } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PostContentSchemaGrantType.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PostContentSchemaGrantType.cs deleted file mode 100644 index 006b15ddcfa1..000000000000 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/PostContentSchemaGrantType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.Containers.ContainerRegistry -{ - /// Can take a value of access_token_refresh_token, or access_token, or refresh_token. - internal readonly partial struct PostContentSchemaGrantType : IEquatable - { - private readonly string _value; - - /// Determines if two values are the same. - /// is null. - public PostContentSchemaGrantType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AccessTokenRefreshTokenValue = "access_token_refresh_token"; - private const string AccessTokenValue = "access_token"; - private const string RefreshTokenValue = "refresh_token"; - - /// access_token_refresh_token. - public static PostContentSchemaGrantType AccessTokenRefreshToken { get; } = new PostContentSchemaGrantType(AccessTokenRefreshTokenValue); - /// access_token. - public static PostContentSchemaGrantType AccessToken { get; } = new PostContentSchemaGrantType(AccessTokenValue); - /// refresh_token. - public static PostContentSchemaGrantType RefreshToken { get; } = new PostContentSchemaGrantType(RefreshTokenValue); - /// Determines if two values are the same. - public static bool operator ==(PostContentSchemaGrantType left, PostContentSchemaGrantType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PostContentSchemaGrantType left, PostContentSchemaGrantType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PostContentSchemaGrantType(string value) => new PostContentSchemaGrantType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PostContentSchemaGrantType other && Equals(other); - /// - public bool Equals(PostContentSchemaGrantType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RefreshToken.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RefreshToken.cs deleted file mode 100644 index b161621b0382..000000000000 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RefreshToken.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.Containers.ContainerRegistry -{ - /// The RefreshToken. - internal partial class RefreshToken - { - /// Initializes a new instance of RefreshToken. - internal RefreshToken() - { - } - - /// Initializes a new instance of RefreshToken. - /// The refresh token to be used for generating access tokens. - internal RefreshToken(string refreshTokenValue) - { - RefreshTokenValue = refreshTokenValue; - } - - /// The refresh token to be used for generating access tokens. - public string RefreshTokenValue { get; } - } -} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.Serialization.cs index a1bf43c8baff..8951197f1b8c 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.Serialization.cs @@ -16,25 +16,18 @@ internal partial class RegistryArtifactProperties { internal static RegistryArtifactProperties DeserializeRegistryArtifactProperties(JsonElement element) { - Optional registry = default; - Optional imageName = default; - Optional digest = default; + string imageName = default; + string digest = default; Optional imageSize = default; Optional createdTime = default; Optional lastUpdateTime = default; Optional architecture = default; Optional os = default; - Optional mediaType = default; - Optional configMediaType = default; - Optional> tags = default; - Optional changeableAttributes = default; + Optional> references = default; + IReadOnlyList tags = default; + ContentProperties changeableAttributes = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("registry")) - { - registry = property.Value.GetString(); - continue; - } if (property.NameEquals("imageName")) { imageName = property.Value.GetString(); @@ -94,23 +87,23 @@ internal static RegistryArtifactProperties DeserializeRegistryArtifactProperties os = property0.Value.GetString(); continue; } - if (property0.NameEquals("mediaType")) - { - mediaType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("configMediaType")) - { - configMediaType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("tags")) + if (property0.NameEquals("references")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ManifestAttributesManifestReferences.DeserializeManifestAttributesManifestReferences(item)); + } + references = array; + continue; + } + if (property0.NameEquals("tags")) + { List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { @@ -121,11 +114,6 @@ internal static RegistryArtifactProperties DeserializeRegistryArtifactProperties } if (property0.NameEquals("changeableAttributes")) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } changeableAttributes = ContentProperties.DeserializeContentProperties(property0.Value); continue; } @@ -133,7 +121,7 @@ internal static RegistryArtifactProperties DeserializeRegistryArtifactProperties continue; } } - return new RegistryArtifactProperties(registry.Value, imageName.Value, digest.Value, Optional.ToNullable(imageSize), Optional.ToNullable(createdTime), Optional.ToNullable(lastUpdateTime), architecture.Value, os.Value, mediaType.Value, configMediaType.Value, Optional.ToList(tags), changeableAttributes.Value); + return new RegistryArtifactProperties(imageName, digest, Optional.ToNullable(imageSize), Optional.ToNullable(createdTime), Optional.ToNullable(lastUpdateTime), architecture.Value, os.Value, Optional.ToList(references), tags, changeableAttributes); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.cs index 2a5972cf4f6e..ef988fd371f0 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RegistryArtifactProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; namespace Azure.Containers.ContainerRegistry @@ -15,13 +16,38 @@ namespace Azure.Containers.ContainerRegistry internal partial class RegistryArtifactProperties { /// Initializes a new instance of RegistryArtifactProperties. - internal RegistryArtifactProperties() + /// Image name. + /// Manifest. + /// List of tags. + /// Changeable attributes. + /// , , , or is null. + internal RegistryArtifactProperties(string repository, string digest, IEnumerable tags, ContentProperties manifestProperties) { - Tags = new ChangeTrackingList(); + if (repository == null) + { + throw new ArgumentNullException(nameof(repository)); + } + if (digest == null) + { + throw new ArgumentNullException(nameof(digest)); + } + if (tags == null) + { + throw new ArgumentNullException(nameof(tags)); + } + if (manifestProperties == null) + { + throw new ArgumentNullException(nameof(manifestProperties)); + } + + Repository = repository; + Digest = digest; + RegistryArtifacts = new ChangeTrackingList(); + Tags = tags.ToList(); + ManifestProperties = manifestProperties; } /// Initializes a new instance of RegistryArtifactProperties. - /// Registry name. /// Image name. /// Manifest. /// Image size. @@ -29,13 +55,11 @@ internal RegistryArtifactProperties() /// Last update time. /// CPU architecture. /// Operating system. - /// Media type. - /// Config blob media type. + /// List of manifest attributes details. /// List of tags. /// Changeable attributes. - internal RegistryArtifactProperties(string registry, string repository, string digest, long? size, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, string cpuArchitecture, string operatingSystem, string manifestMediaType, string configMediaType, IReadOnlyList tags, ContentProperties manifestProperties) + internal RegistryArtifactProperties(string repository, string digest, long? size, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, string cpuArchitecture, string operatingSystem, IReadOnlyList registryArtifacts, IReadOnlyList tags, ContentProperties manifestProperties) { - Registry = registry; Repository = repository; Digest = digest; Size = size; @@ -43,14 +67,11 @@ internal RegistryArtifactProperties(string registry, string repository, string d LastUpdatedOn = lastUpdatedOn; CpuArchitecture = cpuArchitecture; OperatingSystem = operatingSystem; - ManifestMediaType = manifestMediaType; - ConfigMediaType = configMediaType; + RegistryArtifacts = registryArtifacts; Tags = tags; ManifestProperties = manifestProperties; } - /// Registry name. - public string Registry { get; } /// Image name. public string Repository { get; } /// Manifest. @@ -65,10 +86,8 @@ internal RegistryArtifactProperties(string registry, string repository, string d public string CpuArchitecture { get; } /// Operating system. public string OperatingSystem { get; } - /// Media type. - public string ManifestMediaType { get; } - /// Config blob media type. - public string ConfigMediaType { get; } + /// List of manifest attributes details. + public IReadOnlyList RegistryArtifacts { get; } /// List of tags. public IReadOnlyList Tags { get; } /// Changeable attributes. diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.Serialization.cs index 12b4cde8ad61..635e1e5995de 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.Serialization.cs @@ -15,20 +15,14 @@ public partial class RepositoryProperties { internal static RepositoryProperties DeserializeRepositoryProperties(JsonElement element) { - Optional registry = default; - Optional imageName = default; - Optional createdTime = default; + string imageName = default; + DateTimeOffset createdTime = default; Optional lastUpdateTime = default; - Optional manifestCount = default; - Optional tagCount = default; - Optional changeableAttributes = default; + int manifestCount = default; + int tagCount = default; + ContentProperties changeableAttributes = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("registry")) - { - registry = property.Value.GetString(); - continue; - } if (property.NameEquals("imageName")) { imageName = property.Value.GetString(); @@ -36,11 +30,6 @@ internal static RepositoryProperties DeserializeRepositoryProperties(JsonElement } if (property.NameEquals("createdTime")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } createdTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -56,36 +45,21 @@ internal static RepositoryProperties DeserializeRepositoryProperties(JsonElement } if (property.NameEquals("manifestCount")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } manifestCount = property.Value.GetInt32(); continue; } if (property.NameEquals("tagCount")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } tagCount = property.Value.GetInt32(); continue; } if (property.NameEquals("changeableAttributes")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } changeableAttributes = ContentProperties.DeserializeContentProperties(property.Value); continue; } } - return new RepositoryProperties(registry.Value, imageName.Value, Optional.ToNullable(createdTime), Optional.ToNullable(lastUpdateTime), Optional.ToNullable(manifestCount), Optional.ToNullable(tagCount), changeableAttributes.Value); + return new RepositoryProperties(imageName, createdTime, Optional.ToNullable(lastUpdateTime), manifestCount, tagCount, changeableAttributes); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.cs index 4b5b9d219fe2..1f10e217af3a 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/RepositoryProperties.cs @@ -13,21 +13,39 @@ namespace Azure.Containers.ContainerRegistry public partial class RepositoryProperties { /// Initializes a new instance of RepositoryProperties. - internal RepositoryProperties() + /// Image name. + /// Image created time. + /// Number of the manifests. + /// Number of the tags. + /// Changeable attributes. + /// or is null. + internal RepositoryProperties(string name, DateTimeOffset createdOn, int registryArtifactCount, int tagCount, ContentProperties writeableProperties) { + if (name == null) + { + throw new ArgumentNullException(nameof(name)); + } + if (writeableProperties == null) + { + throw new ArgumentNullException(nameof(writeableProperties)); + } + + Name = name; + CreatedOn = createdOn; + RegistryArtifactCount = registryArtifactCount; + TagCount = tagCount; + WriteableProperties = writeableProperties; } /// Initializes a new instance of RepositoryProperties. - /// Registry name. /// Image name. /// Image created time. /// Image last update time. /// Number of the manifests. /// Number of the tags. /// Changeable attributes. - internal RepositoryProperties(string registry, string name, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, int? registryArtifactCount, int? tagCount, ContentProperties writeableProperties) + internal RepositoryProperties(string name, DateTimeOffset createdOn, DateTimeOffset? lastUpdatedOn, int registryArtifactCount, int tagCount, ContentProperties writeableProperties) { - Registry = registry; Name = name; CreatedOn = createdOn; LastUpdatedOn = lastUpdatedOn; @@ -36,18 +54,16 @@ internal RepositoryProperties(string registry, string name, DateTimeOffset? crea WriteableProperties = writeableProperties; } - /// Registry name. - public string Registry { get; } /// Image name. public string Name { get; } /// Image created time. - public DateTimeOffset? CreatedOn { get; } + public DateTimeOffset CreatedOn { get; } /// Image last update time. public DateTimeOffset? LastUpdatedOn { get; } /// Number of the manifests. - public int? RegistryArtifactCount { get; } + public int RegistryArtifactCount { get; } /// Number of the tags. - public int? TagCount { get; } + public int TagCount { get; } /// Changeable attributes. public ContentProperties WriteableProperties { get; } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.Serialization.cs index 1691db587fd4..d8cc0ae97eea 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.Serialization.cs @@ -17,8 +17,8 @@ internal static TagAttributesBase DeserializeTagAttributesBase(JsonElement eleme { Optional name = default; Optional digest = default; - Optional createdTime = default; - Optional lastUpdateTime = default; + DateTimeOffset createdTime = default; + DateTimeOffset lastUpdateTime = default; Optional changeableAttributes = default; foreach (var property in element.EnumerateObject()) { @@ -34,21 +34,11 @@ internal static TagAttributesBase DeserializeTagAttributesBase(JsonElement eleme } if (property.NameEquals("createdTime")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } createdTime = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("lastUpdateTime")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } lastUpdateTime = property.Value.GetDateTimeOffset("O"); continue; } @@ -63,7 +53,7 @@ internal static TagAttributesBase DeserializeTagAttributesBase(JsonElement eleme continue; } } - return new TagAttributesBase(name.Value, digest.Value, Optional.ToNullable(createdTime), Optional.ToNullable(lastUpdateTime), changeableAttributes.Value); + return new TagAttributesBase(name.Value, digest.Value, createdTime, lastUpdateTime, changeableAttributes.Value); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.cs index d6bfe1b60d24..1d4d2c04ec52 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagAttributesBase.cs @@ -13,8 +13,12 @@ namespace Azure.Containers.ContainerRegistry internal partial class TagAttributesBase { /// Initializes a new instance of TagAttributesBase. - internal TagAttributesBase() + /// Tag created time. + /// Tag last update time. + internal TagAttributesBase(DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn) { + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; } /// Initializes a new instance of TagAttributesBase. @@ -22,14 +26,14 @@ internal TagAttributesBase() /// Tag digest. /// Tag created time. /// Tag last update time. - /// Changeable attributes. - internal TagAttributesBase(string name, string digest, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, ContentProperties modifiableProperties) + /// Changeable attributes. + internal TagAttributesBase(string name, string digest, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ContentProperties writeableProperties) { Name = name; Digest = digest; CreatedOn = createdOn; LastUpdatedOn = lastUpdatedOn; - ModifiableProperties = modifiableProperties; + WriteableProperties = writeableProperties; } /// Tag name. @@ -37,10 +41,10 @@ internal TagAttributesBase(string name, string digest, DateTimeOffset? createdOn /// Tag digest. public string Digest { get; } /// Tag created time. - public DateTimeOffset? CreatedOn { get; } + public DateTimeOffset CreatedOn { get; } /// Tag last update time. - public DateTimeOffset? LastUpdatedOn { get; } + public DateTimeOffset LastUpdatedOn { get; } /// Changeable attributes. - public ContentProperties ModifiableProperties { get; } + public ContentProperties WriteableProperties { get; } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.Serialization.cs index b178f657e218..4c3891b807ff 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.Serialization.cs @@ -15,17 +15,11 @@ internal partial class TagList { internal static TagList DeserializeTagList(JsonElement element) { - Optional registry = default; - Optional imageName = default; + string imageName = default; Optional> tags = default; Optional link = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("registry")) - { - registry = property.Value.GetString(); - continue; - } if (property.NameEquals("imageName")) { imageName = property.Value.GetString(); @@ -52,7 +46,7 @@ internal static TagList DeserializeTagList(JsonElement element) continue; } } - return new TagList(registry.Value, imageName.Value, Optional.ToList(tags), link.Value); + return new TagList(imageName, Optional.ToList(tags), link.Value); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.cs index ac64da821e4d..d27095edcc3d 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagList.cs @@ -5,6 +5,7 @@ #nullable disable +using System; using System.Collections.Generic; using Azure.Core; @@ -14,26 +15,30 @@ namespace Azure.Containers.ContainerRegistry internal partial class TagList { /// Initializes a new instance of TagList. - internal TagList() + /// Image name. + /// is null. + internal TagList(string repository) { + if (repository == null) + { + throw new ArgumentNullException(nameof(repository)); + } + + Repository = repository; Tags = new ChangeTrackingList(); } /// Initializes a new instance of TagList. - /// Registry name. /// Image name. /// List of tag attribute details. /// . - internal TagList(string registry, string repository, IReadOnlyList tags, string link) + internal TagList(string repository, IReadOnlyList tags, string link) { - Registry = registry; Repository = repository; Tags = tags; Link = link; } - /// Registry name. - public string Registry { get; } /// Image name. public string Repository { get; } /// List of tag attribute details. diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.Serialization.cs index 623d455c4988..e4bd54c974fa 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.Serialization.cs @@ -15,20 +15,14 @@ public partial class TagProperties { internal static TagProperties DeserializeTagProperties(JsonElement element) { - Optional registry = default; - Optional imageName = default; + string imageName = default; Optional name = default; Optional digest = default; - Optional createdTime = default; - Optional lastUpdateTime = default; + DateTimeOffset createdTime = default; + DateTimeOffset lastUpdateTime = default; Optional changeableAttributes = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("registry")) - { - registry = property.Value.GetString(); - continue; - } if (property.NameEquals("imageName")) { imageName = property.Value.GetString(); @@ -55,21 +49,11 @@ internal static TagProperties DeserializeTagProperties(JsonElement element) } if (property0.NameEquals("createdTime")) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } createdTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("lastUpdateTime")) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } lastUpdateTime = property0.Value.GetDateTimeOffset("O"); continue; } @@ -87,7 +71,7 @@ internal static TagProperties DeserializeTagProperties(JsonElement element) continue; } } - return new TagProperties(registry.Value, imageName.Value, name.Value, digest.Value, Optional.ToNullable(createdTime), Optional.ToNullable(lastUpdateTime), changeableAttributes.Value); + return new TagProperties(imageName, name.Value, digest.Value, createdTime, lastUpdateTime, changeableAttributes.Value); } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.cs index 2c7fe6d487eb..63a6b44b5ee0 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/TagProperties.cs @@ -13,31 +13,39 @@ namespace Azure.Containers.ContainerRegistry public partial class TagProperties { /// Initializes a new instance of TagProperties. - internal TagProperties() + /// Image name. + /// Tag created time. + /// Tag last update time. + /// is null. + internal TagProperties(string repository, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn) { + if (repository == null) + { + throw new ArgumentNullException(nameof(repository)); + } + + Repository = repository; + CreatedOn = createdOn; + LastUpdatedOn = lastUpdatedOn; } /// Initializes a new instance of TagProperties. - /// Registry name. /// Image name. /// Tag name. /// Tag digest. /// Tag created time. /// Tag last update time. - /// Changeable attributes. - internal TagProperties(string registry, string repository, string name, string digest, DateTimeOffset? createdOn, DateTimeOffset? lastUpdatedOn, ContentProperties modifiableProperties) + /// Changeable attributes. + internal TagProperties(string repository, string name, string digest, DateTimeOffset createdOn, DateTimeOffset lastUpdatedOn, ContentProperties writeableProperties) { - Registry = registry; Repository = repository; Name = name; Digest = digest; CreatedOn = createdOn; LastUpdatedOn = lastUpdatedOn; - ModifiableProperties = modifiableProperties; + WriteableProperties = writeableProperties; } - /// Registry name. - public string Registry { get; } /// Image name. public string Repository { get; } /// Tag name. @@ -45,10 +53,10 @@ internal TagProperties(string registry, string repository, string name, string d /// Tag digest. public string Digest { get; } /// Tag created time. - public DateTimeOffset? CreatedOn { get; } + public DateTimeOffset CreatedOn { get; } /// Tag last update time. - public DateTimeOffset? LastUpdatedOn { get; } + public DateTimeOffset LastUpdatedOn { get; } /// Changeable attributes. - public ContentProperties ModifiableProperties { get; } + public ContentProperties WriteableProperties { get; } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/RefreshTokensRestClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/RefreshTokensRestClient.cs deleted file mode 100644 index 465e8aa55657..000000000000 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/RefreshTokensRestClient.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.Containers.ContainerRegistry -{ - internal partial class RefreshTokensRestClient - { - private string url; - private ClientDiagnostics _clientDiagnostics; - private HttpPipeline _pipeline; - - /// Initializes a new instance of RefreshTokensRestClient. - /// The handler for diagnostic messaging in the client. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// Registry login URL. - /// is null. - public RefreshTokensRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url) - { - if (url == null) - { - throw new ArgumentNullException(nameof(url)); - } - - this.url = url; - _clientDiagnostics = clientDiagnostics; - _pipeline = pipeline; - } - - internal HttpMessage CreateGetFromExchangeRequest(PostContentSchemaGrantType grantType, string service, string tenant, string refreshToken, string accessToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.AppendRaw(url, false); - uri.AppendPath("/oauth2/exchange", false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); - var content = new FormUrlEncodedContent(); - content.Add("grant_type", grantType.ToString()); - content.Add("service", service); - if (tenant != null) - { - content.Add("tenant", tenant); - } - if (refreshToken != null) - { - content.Add("refresh_token", refreshToken); - } - if (accessToken != null) - { - content.Add("access_token", accessToken); - } - request.Content = content; - return message; - } - - /// Exchange AAD tokens for an ACR refresh Token. - /// Can take a value of access_token_refresh_token, or access_token, or refresh_token. - /// Indicates the name of your Azure container registry. - /// AAD tenant associated to the AAD credentials. - /// AAD refresh token, mandatory when grant_type is access_token_refresh_token or refresh_token. - /// AAD access token, mandatory when grant_type is access_token_refresh_token or access_token. - /// The cancellation token to use. - /// is null. - public async Task> GetFromExchangeAsync(PostContentSchemaGrantType grantType, string service, string tenant = null, string refreshToken = null, string accessToken = null, CancellationToken cancellationToken = default) - { - if (service == null) - { - throw new ArgumentNullException(nameof(service)); - } - - using var message = CreateGetFromExchangeRequest(grantType, service, tenant, refreshToken, accessToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RefreshToken value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RefreshToken.DeserializeRefreshToken(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); - } - } - - /// Exchange AAD tokens for an ACR refresh Token. - /// Can take a value of access_token_refresh_token, or access_token, or refresh_token. - /// Indicates the name of your Azure container registry. - /// AAD tenant associated to the AAD credentials. - /// AAD refresh token, mandatory when grant_type is access_token_refresh_token or refresh_token. - /// AAD access token, mandatory when grant_type is access_token_refresh_token or access_token. - /// The cancellation token to use. - /// is null. - public Response GetFromExchange(PostContentSchemaGrantType grantType, string service, string tenant = null, string refreshToken = null, string accessToken = null, CancellationToken cancellationToken = default) - { - if (service == null) - { - throw new ArgumentNullException(nameof(service)); - } - - using var message = CreateGetFromExchangeRequest(grantType, service, tenant, refreshToken, accessToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RefreshToken value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RefreshToken.DeserializeRefreshToken(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw _clientDiagnostics.CreateRequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs index 93e13f445f25..6f9a4c4cc253 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Repositories/ContainerRepositoryClient.cs @@ -17,8 +17,7 @@ public partial class ContainerRepositoryClient private readonly ClientDiagnostics _clientDiagnostics; private readonly ContainerRegistryRepositoryRestClient _restClient; - private readonly RefreshTokensRestClient _tokenExchangeClient; - private readonly AccessTokensRestClient _acrTokenClient; + private readonly AuthenticationRestClient _acrAuthClient; private readonly string AcrAadScope = "https://management.core.windows.net/.default"; private readonly string _repository; @@ -48,10 +47,9 @@ public ContainerRepositoryClient(Uri endpoint, string repository, TokenCredentia _clientDiagnostics = new ClientDiagnostics(options); _acrAuthPipeline = HttpPipelineBuilder.Build(options); - _tokenExchangeClient = new RefreshTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); - _acrTokenClient = new AccessTokensRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); + _acrAuthClient = new AuthenticationRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); - _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryChallengeAuthenticationPolicy(credential, AcrAadScope, _tokenExchangeClient, _acrTokenClient)); + _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryChallengeAuthenticationPolicy(credential, AcrAadScope, _acrAuthClient)); _restClient = new ContainerRegistryRepositoryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md index 97cbc5327d35..c33489e6dc57 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml input-file: - - https://github.com/Azure/azure-sdk-for-js/blob/f3a5137513bfe904eeaddcd2d1d73191da90a63c/sdk/containerregistry/container-registry/swagger/containerregistry.json + - https://github.com/Azure/azure-sdk-for-js/blob/236bfc568b08004811e219e8cecf284005cd3ea0/sdk/containerregistry/container-registry/swagger/containerregistry.json model-namespace: false ``` diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs index ec417ceab433..793a83f878a7 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs @@ -11,11 +11,11 @@ public class ContainerRegistryChallengeAuthenticationPolicyTest : SyncAsyncPolic { public ContainerRegistryChallengeAuthenticationPolicyTest(bool isAsync) : base(isAsync) { } - [Test] - public async Task ChallengePolicySetsToken() - { - // TODO: understand how to handle REST calls that happen as part of the policy. - var policy = new ContainerRegistryChallengeAuthenticationPolicy(credential, "scope"); - } + //[Test] + //public async Task ChallengePolicySetsToken() + //{ + // // TODO: understand how to handle REST calls that happen as part of the policy. + // var policy = new ContainerRegistryChallengeAuthenticationPolicy(credential, "scope"); + //} } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs index 5ece8c449250..60b060138cf4 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRepositoryClientLiveTests.cs @@ -78,7 +78,6 @@ public async Task CanGetRepositoryProperties() // Assert Assert.AreEqual(_repositoryName, properties.Name); - Assert.AreEqual(new Uri(TestEnvironment.Endpoint).Host, properties.Registry); } [RecordedTest, NonParallelizable] @@ -124,7 +123,6 @@ public async Task CanGetTagProperties() // Assert Assert.AreEqual(tag, properties.Name); Assert.AreEqual(_repositoryName, properties.Repository); - Assert.AreEqual(new Uri(TestEnvironment.Endpoint).Host, properties.Registry); } [RecordedTest, NonParallelizable] @@ -134,7 +132,7 @@ public async Task CanSetTagProperties() ContainerRepositoryClient client = CreateClient(); string tag = "latest"; TagProperties tagProperties = await client.GetTagPropertiesAsync(tag); - ContentProperties originalContentProperties = tagProperties.ModifiableProperties; + ContentProperties originalContentProperties = tagProperties.WriteableProperties; // Act await client.SetTagPropertiesAsync( @@ -150,10 +148,10 @@ await client.SetTagPropertiesAsync( // Assert TagProperties properties = await client.GetTagPropertiesAsync(tag); - Assert.IsFalse(properties.ModifiableProperties.CanList); - Assert.IsFalse(properties.ModifiableProperties.CanRead); - Assert.IsFalse(properties.ModifiableProperties.CanWrite); - Assert.IsFalse(properties.ModifiableProperties.CanDelete); + Assert.IsFalse(properties.WriteableProperties.CanList); + Assert.IsFalse(properties.WriteableProperties.CanRead); + Assert.IsFalse(properties.WriteableProperties.CanWrite); + Assert.IsFalse(properties.WriteableProperties.CanDelete); // Cleanup await client.SetTagPropertiesAsync(tag, originalContentProperties); From 61a120ded03f24b239dccbe90499be8397770a4b Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Wed, 24 Mar 2021 12:51:08 -0700 Subject: [PATCH 08/10] add policy test --- .../AuthenticationRestClient.cs | 9 +++++ ...erRegistryChallengeAuthenticationPolicy.cs | 19 +++++----- .../IContainerRegistryAuthenticationClient.cs | 17 +++++++++ ...gistryChallengeAuthenticationPolicyTest.cs | 38 +++++++++++++++++++ .../MockAuthenticationClient.cs | 36 ++++++++++++++++++ ...gistryChallengeAuthenticationPolicyTest.cs | 21 ---------- 6 files changed, 109 insertions(+), 31 deletions(-) create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/AuthenticationRestClient.cs create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/IContainerRegistryAuthenticationClient.cs create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/ContainerRegistryChallengeAuthenticationPolicyTest.cs create mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/MockAuthenticationClient.cs delete mode 100644 sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/AuthenticationRestClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/AuthenticationRestClient.cs new file mode 100644 index 000000000000..7389b1d7b2d0 --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/AuthenticationRestClient.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Containers.ContainerRegistry +{ + internal partial class AuthenticationRestClient : IContainerRegistryAuthenticationClient + { + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs index c59d0157caa3..25157ff7440c 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System; -using System.Collections.Generic; using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; @@ -33,9 +32,9 @@ namespace Azure.Containers.ContainerRegistry /// internal class ContainerRegistryChallengeAuthenticationPolicy : BearerTokenChallengeAuthenticationPolicy { - private readonly AuthenticationRestClient _authenticationClient; + private readonly IContainerRegistryAuthenticationClient _authenticationClient; - public ContainerRegistryChallengeAuthenticationPolicy(TokenCredential credential, string aadScope, AuthenticationRestClient authenticationClient) + public ContainerRegistryChallengeAuthenticationPolicy(TokenCredential credential, string aadScope, IContainerRegistryAuthenticationClient authenticationClient) : base(credential, aadScope) { Argument.AssertNotNull(credential, nameof(credential)); @@ -59,7 +58,7 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt string acrRefreshToken = await ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, true).ConfigureAwait(false); // Step 4: Send in acrRefreshToken and get back acrAccessToken - acrAccessToken = await ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, true).ConfigureAwait(false); + acrAccessToken = await ExchangeAcrRefreshTokenForAcrAccessTokenAsync(message, acrRefreshToken, service, scope, true).ConfigureAwait(false); } else { @@ -67,7 +66,7 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt string acrRefreshToken = ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, false).EnsureCompleted(); // Step 4: Send in acrRefreshToken and get back acrAccessToken - acrAccessToken = ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, false).EnsureCompleted(); + acrAccessToken = ExchangeAcrRefreshTokenForAcrAccessTokenAsync(message, acrRefreshToken, service, scope, false).EnsureCompleted(); } // Step 5 - Authorize Request. Note, we don't use SetAuthorizationHeader here, because it @@ -84,26 +83,26 @@ private async Task ExchangeAadAccessTokenForAcrRefreshTokenAsync(HttpMes Response acrRefreshToken = null; if (async) { - acrRefreshToken = await _authenticationClient.ExchangeAadAccessTokenForAcrRefreshTokenAsync(service, aadAccessToken).ConfigureAwait(false); + acrRefreshToken = await _authenticationClient.ExchangeAadAccessTokenForAcrRefreshTokenAsync(service, aadAccessToken, message.CancellationToken).ConfigureAwait(false); } else { - acrRefreshToken = _authenticationClient.ExchangeAadAccessTokenForAcrRefreshToken(service, aadAccessToken); + acrRefreshToken = _authenticationClient.ExchangeAadAccessTokenForAcrRefreshToken(service, aadAccessToken, message.CancellationToken); } return acrRefreshToken.Value.RefreshToken; } - private async Task ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string acrRefreshToken, string service, string scope, bool async) + private async Task ExchangeAcrRefreshTokenForAcrAccessTokenAsync(HttpMessage message, string acrRefreshToken, string service, string scope, bool async) { Response acrAccessToken = null; if (async) { - acrAccessToken = await _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessTokenAsync(service, scope, acrRefreshToken).ConfigureAwait(false); + acrAccessToken = await _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessTokenAsync(service, scope, acrRefreshToken, message.CancellationToken).ConfigureAwait(false); } else { - acrAccessToken = _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessToken(service, scope, acrRefreshToken); + acrAccessToken = _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessToken(service, scope, acrRefreshToken, message.CancellationToken); } return acrAccessToken.Value.AccessToken; diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/IContainerRegistryAuthenticationClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/IContainerRegistryAuthenticationClient.cs new file mode 100644 index 000000000000..969656a7a805 --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/IContainerRegistryAuthenticationClient.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading; +using System.Threading.Tasks; + +namespace Azure.Containers.ContainerRegistry +{ + internal interface IContainerRegistryAuthenticationClient + { + Task> ExchangeAadAccessTokenForAcrRefreshTokenAsync(string service, string aadAccessToken, CancellationToken token = default); + Response ExchangeAadAccessTokenForAcrRefreshToken(string service, string aadAccessToken, CancellationToken token = default); + + Task> ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string service, string scope, string acrRefreshToken, CancellationToken token = default); + Response ExchangeAcrRefreshTokenForAcrAccessToken(string service, string scope, string acrRefreshToken, CancellationToken token = default); + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/ContainerRegistryChallengeAuthenticationPolicyTest.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/ContainerRegistryChallengeAuthenticationPolicyTest.cs new file mode 100644 index 000000000000..825112996cca --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/ContainerRegistryChallengeAuthenticationPolicyTest.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Containers.ContainerRegistry.Tests +{ + public class ContainerRegistryChallengeAuthenticationPolicyTest : SyncAsyncPolicyTestBase + { + public ContainerRegistryChallengeAuthenticationPolicyTest(bool isAsync) : base(isAsync) { } + + [Test] + public async Task ChallengePolicySetsToken() + { + MockAuthenticationClient mockClient = new MockAuthenticationClient(); + MockCredential mockCredential = new MockCredential(); + + var policy = new ContainerRegistryChallengeAuthenticationPolicy(mockCredential, "TestScope", mockClient); + + var challengeResponse = new MockResponse(401); + string challenge = "Bearer realm=\"https://example.azurecr.io/oauth2/token\",service=\"example.azurecr.io\",scope=\"repository:library/hello-world:metadata_read\",error=\"invalid_token\""; + challengeResponse.AddHeader(new HttpHeader(HttpHeader.Names.WwwAuthenticate, challenge)); + + MockTransport transport = CreateMockTransport(challengeResponse, new MockResponse(200)); + + await SendGetRequest(transport, policy, uri: new Uri("https://example.azurecr.io/acr/v1/hello-world/_tags/latest"), cancellationToken: default); + + MockRequest request = transport.Requests[0]; + + Assert.IsTrue(request.Headers.TryGetValue(HttpHeader.Names.Authorization, out string authHeaderValue)); + Assert.AreEqual("Bearer TestAcrAccessToken", authHeaderValue); + } + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/MockAuthenticationClient.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/MockAuthenticationClient.cs new file mode 100644 index 000000000000..6af14ab5bbc5 --- /dev/null +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/Authentication/MockAuthenticationClient.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading; +using System.Threading.Tasks; +using Azure.Core.TestFramework; + +namespace Azure.Containers.ContainerRegistry.Tests +{ + internal class MockAuthenticationClient : IContainerRegistryAuthenticationClient + { + public Response ExchangeAadAccessTokenForAcrRefreshToken(string service, string aadAccessToken, CancellationToken token = default) + { + AcrRefreshToken refreshToken = new AcrRefreshToken("TestAcrRefreshToken"); + return Response.FromValue(refreshToken, new MockResponse(200)); + } + + public Task> ExchangeAadAccessTokenForAcrRefreshTokenAsync(string service, string aadAccessToken, CancellationToken token = default) + { + AcrRefreshToken refreshToken = new AcrRefreshToken("TestAcrRefreshToken"); + return Task.FromResult(Response.FromValue(refreshToken, new MockResponse(200))); + } + + public Response ExchangeAcrRefreshTokenForAcrAccessToken(string service, string scope, string acrRefreshToken, CancellationToken token = default) + { + AcrAccessToken accessToken = new AcrAccessToken("TestAcrAccessToken"); + return Response.FromValue(accessToken, new MockResponse(200)); + } + + public Task> ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string service, string scope, string acrRefreshToken, CancellationToken token = default) + { + AcrAccessToken accessToken = new AcrAccessToken("TestAcrAccessToken"); + return Task.FromResult(Response.FromValue(accessToken, new MockResponse(200))); + } + } +} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs deleted file mode 100644 index 793a83f878a7..000000000000 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/tests/ContainerRegistryChallengeAuthenticationPolicyTest.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.Containers.ContainerRegistry.Tests -{ - public class ContainerRegistryChallengeAuthenticationPolicyTest : SyncAsyncPolicyTestBase - { - public ContainerRegistryChallengeAuthenticationPolicyTest(bool isAsync) : base(isAsync) { } - - //[Test] - //public async Task ChallengePolicySetsToken() - //{ - // // TODO: understand how to handle REST calls that happen as part of the policy. - // var policy = new ContainerRegistryChallengeAuthenticationPolicy(credential, "scope"); - //} - } -} From 9ac249a5a6143c0f0f7c2d32c9643cc32fb0b8ff Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Wed, 24 Mar 2021 13:10:01 -0700 Subject: [PATCH 09/10] update api for changes from generated code --- ....Containers.ContainerRegistry.netstandard2.0.cs | 14 ++++++-------- ...stAttributesManifestReferences.Serialization.cs | 2 +- .../Models/ManifestAttributesManifestReferences.cs | 2 +- .../src/autorest.md | 8 ++++++++ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs index 9b2805789e29..8d545c56fd91 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/api/Azure.Containers.ContainerRegistry.netstandard2.0.cs @@ -44,23 +44,21 @@ public ContentProperties() { } public partial class RepositoryProperties { internal RepositoryProperties() { } - public System.DateTimeOffset? CreatedOn { get { throw null; } } + public System.DateTimeOffset CreatedOn { get { throw null; } } public System.DateTimeOffset? LastUpdatedOn { get { throw null; } } public string Name { get { throw null; } } - public string Registry { get { throw null; } } - public int? RegistryArtifactCount { get { throw null; } } - public int? TagCount { get { throw null; } } + public int RegistryArtifactCount { get { throw null; } } + public int TagCount { get { throw null; } } public Azure.Containers.ContainerRegistry.ContentProperties WriteableProperties { get { throw null; } } } public partial class TagProperties { internal TagProperties() { } - public System.DateTimeOffset? CreatedOn { get { throw null; } } + public System.DateTimeOffset CreatedOn { get { throw null; } } public string Digest { get { throw null; } } - public System.DateTimeOffset? LastUpdatedOn { get { throw null; } } - public Azure.Containers.ContainerRegistry.ContentProperties ModifiableProperties { get { throw null; } } + public System.DateTimeOffset LastUpdatedOn { get { throw null; } } public string Name { get { throw null; } } - public string Registry { get { throw null; } } public string Repository { get { throw null; } } + public Azure.Containers.ContainerRegistry.ContentProperties WriteableProperties { get { throw null; } } } } diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs index e9574379742d..98eb741d6fb3 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.Containers.ContainerRegistry { - public partial class ManifestAttributesManifestReferences + internal partial class ManifestAttributesManifestReferences { internal static ManifestAttributesManifestReferences DeserializeManifestAttributesManifestReferences(JsonElement element) { diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs index 868e9ea1fe6f..40785d1078af 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Generated/Models/ManifestAttributesManifestReferences.cs @@ -10,7 +10,7 @@ namespace Azure.Containers.ContainerRegistry { /// Manifest attributes details. - public partial class ManifestAttributesManifestReferences + internal partial class ManifestAttributesManifestReferences { /// Initializes a new instance of ManifestAttributesManifestReferences. /// Manifest digest. diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md index c33489e6dc57..c2a52494738d 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/autorest.md @@ -23,3 +23,11 @@ directive: transform: > $["x-accessibility"] = "internal" ``` + +``` yaml +directive: + from: swagger-document + where: $.definitions.ManifestAttributes_manifest_references + transform: > + $["x-accessibility"] = "internal" +``` From d9a1f5734c4522e39b9289c097a10af2553b142c Mon Sep 17 00:00:00 2001 From: Anne Loomis Thompson Date: Wed, 24 Mar 2021 13:30:08 -0700 Subject: [PATCH 10/10] parameter refactor --- .../ContainerRegistryChallengeAuthenticationPolicy.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs index 25157ff7440c..d136a635a1c0 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Threading; using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; @@ -58,7 +59,7 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt string acrRefreshToken = await ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, true).ConfigureAwait(false); // Step 4: Send in acrRefreshToken and get back acrAccessToken - acrAccessToken = await ExchangeAcrRefreshTokenForAcrAccessTokenAsync(message, acrRefreshToken, service, scope, true).ConfigureAwait(false); + acrAccessToken = await ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, true, message.CancellationToken).ConfigureAwait(false); } else { @@ -66,7 +67,7 @@ protected override async ValueTask AuthenticateRequestOnChallengeAsync(Htt string acrRefreshToken = ExchangeAadAccessTokenForAcrRefreshTokenAsync(message, service, false).EnsureCompleted(); // Step 4: Send in acrRefreshToken and get back acrAccessToken - acrAccessToken = ExchangeAcrRefreshTokenForAcrAccessTokenAsync(message, acrRefreshToken, service, scope, false).EnsureCompleted(); + acrAccessToken = ExchangeAcrRefreshTokenForAcrAccessTokenAsync(acrRefreshToken, service, scope, false, message.CancellationToken).EnsureCompleted(); } // Step 5 - Authorize Request. Note, we don't use SetAuthorizationHeader here, because it @@ -93,16 +94,16 @@ private async Task ExchangeAadAccessTokenForAcrRefreshTokenAsync(HttpMes return acrRefreshToken.Value.RefreshToken; } - private async Task ExchangeAcrRefreshTokenForAcrAccessTokenAsync(HttpMessage message, string acrRefreshToken, string service, string scope, bool async) + private async Task ExchangeAcrRefreshTokenForAcrAccessTokenAsync(string acrRefreshToken, string service, string scope, bool async, CancellationToken cancellationToken) { Response acrAccessToken = null; if (async) { - acrAccessToken = await _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessTokenAsync(service, scope, acrRefreshToken, message.CancellationToken).ConfigureAwait(false); + acrAccessToken = await _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessTokenAsync(service, scope, acrRefreshToken, cancellationToken).ConfigureAwait(false); } else { - acrAccessToken = _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessToken(service, scope, acrRefreshToken, message.CancellationToken); + acrAccessToken = _authenticationClient.ExchangeAcrRefreshTokenForAcrAccessToken(service, scope, acrRefreshToken, cancellationToken); } return acrAccessToken.Value.AccessToken;