internal ContainerRepositoryClient(Uri endpoint, string repository, ClientDiagnostics diagnostics, HttpPipeline pipeline, HttpPipeline authPipeline) { Endpoint = endpoint; Repository = repository; _clientDiagnostics = diagnostics; _acrAuthPipeline = authPipeline; _acrAuthClient = new AuthenticationRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); _pipeline = pipeline; _restClient = new ContainerRegistryRepositoryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); _registryRestClient = new ContainerRegistryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); }
/// <summary> /// <param name="endpoint"></param> /// <param name="repository"> Name of the image (including the namespace). </param> /// <param name="username"></param> /// <param name="password"></param> /// <param name="options"></param> /// </summary> public ContainerRepositoryClient(Uri endpoint, string repository, string username, string password, 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)); _pipeline = HttpPipelineBuilder.Build(options, new BasicAuthenticationPolicy(username, password)); _clientDiagnostics = new ClientDiagnostics(options); Endpoint = endpoint; _repository = repository; _restClient = new ContainerRegistryRepositoryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); }
/// <summary> /// </summary> 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)); Argument.AssertNotNull(options, nameof(options)); Endpoint = endpoint; _repository = repository; _clientDiagnostics = new ClientDiagnostics(options); _acrAuthPipeline = HttpPipelineBuilder.Build(options); _acrAuthClient = new AuthenticationRestClient(_clientDiagnostics, _acrAuthPipeline, endpoint.AbsoluteUri); _pipeline = HttpPipelineBuilder.Build(options, new ContainerRegistryChallengeAuthenticationPolicy(credential, AcrAadScope, _acrAuthClient)); _restClient = new ContainerRegistryRepositoryRestClient(_clientDiagnostics, _pipeline, Endpoint.AbsoluteUri); }