示例#1
0
        public override async Task AuthenticateAsync(IConnection connection, CancellationToken cancellationToken = default)
        {
            using var op = new SaslStart
                  {
                      Key        = MechanismType.GetDescription(),
                      Content    = GetAuthData(_username, _password),
                      Opaque     = SequenceGenerator.GetNext(),
                      Transcoder = new LegacyTranscoder()
                  };

            await SendAsync(op, connection, cancellationToken);
        }
示例#2
0
 protected async Task <string> SaslStart(IConnection connection, string message, IRequestSpan span, CancellationToken token)
 {
     using var childSpan = span.ChildSpan(OuterRequestSpans.ServiceSpan.Internal.SaslStart);
     using var authOp    = new SaslStart
           {
               Key     = MechanismType.GetDescription(),
               Content = message,
               Timeout = Timeout,
               Span    = childSpan
           };
     OperationConfigurator.Configure(authOp, SaslOptions.Instance);
     return(await SendAsync(authOp, connection, token).ConfigureAwait(false));
 }
 public override async Task AuthenticateAsync(IConnection connection, CancellationToken cancellationToken = default)
 {
     using var rootSpan = Tracer.RootSpan(CouchbaseTags.Service, OperationNames.AuthenticatePlain);
     using var op       = new SaslStart
           {
               Key     = MechanismType.GetDescription(),
               Content = GetAuthData(_username, _password),
               Opaque  = SequenceGenerator.GetNext(),
               Span    = rootSpan,
           };
     OperationConfigurator.Configure(op, SaslOptions.Instance);
     await SendAsync(op, connection, cancellationToken).ConfigureAwait(false);
 }
示例#4
0
        public override async Task AuthenticateAsync(IConnection connection, CancellationToken cancellationToken = default)
        {
            using var rootSpan = Tracer.RequestSpan(OuterRequestSpans.Attributes.Service, OuterRequestSpans.ServiceSpan.Internal.AuthenticatePlain);
            using var op       = new SaslStart
                  {
                      Key     = MechanismType.GetDescription() !,
                      Content = GetAuthData(_username, _password),
                      Opaque  = SequenceGenerator.GetNext(),
                      Span    = rootSpan,
                      Timeout = Timeout
                  };
            OperationConfigurator.Configure(op, SaslOptions.Instance);

            using var ctp = CancellationTokenPairSource.FromTimeout(Timeout, cancellationToken);
            await SendAsync(op, connection, cancellationToken).ConfigureAwait(false);
        }