Example #1
0
        public TemplateClient(string vaultBaseUrl, TokenCredential credential, TemplateClientOptions options)
        {
            Argument.AssertNotNull(vaultBaseUrl, nameof(vaultBaseUrl));
            Argument.AssertNotNull(credential, nameof(credential));
            options ??= new TemplateClientOptions();

            ClientDiagnostics = new ClientDiagnostics(options, true);
            _tokenCredential  = credential;
            _pipeline         = HttpPipelineBuilder.Build(options, Array.Empty <HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier());
            _vaultBaseUrl     = vaultBaseUrl;
            _apiVersion       = options.Version;
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TemplateClient"/>.
 /// </summary>
 public TemplateClient(Uri endpoint, TemplateClientOptions options)
 {
     _diagnostics = new ClientDiagnostics(options);
     _pipeline    = HttpPipelineBuilder.Build(options /* Add an auth policy here*/);
     _operations  = new AllOperations(_diagnostics, _pipeline, endpoint.ToString());
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TemplateClient"/>.
 /// </summary>
 public TemplateClient(Uri endpoint, TemplateClientOptions options) : this(
         new ClientDiagnostics(options),
         HttpPipelineBuilder.Build(options /* Add an auth policy here*/),
         endpoint.ToString())
 {
 }