Class BearerTokenCredentials

java.lang.Object
io.grpc.CallCredentials
io.jenkins.plugins.namespacecloud.client.BearerTokenCredentials

public final class BearerTokenCredentials extends io.grpc.CallCredentials
Attaches a Namespace tenant token to every outgoing RPC as Authorization: Bearer <token>.

The token is held as a Jenkins Secret so it is never written to disk or to a log in plaintext.

  • Nested Class Summary

    Nested classes/interfaces inherited from class io.grpc.CallCredentials

    io.grpc.CallCredentials.MetadataApplier, io.grpc.CallCredentials.RequestInfo
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyRequestMetadata(io.grpc.CallCredentials.RequestInfo requestInfo, Executor appExecutor, io.grpc.CallCredentials.MetadataApplier applier)
     

    Methods inherited from class io.grpc.CallCredentials

    thisUsesUnstableApi

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BearerTokenCredentials

      public BearerTokenCredentials(@NonNull Secret token)
  • Method Details

    • applyRequestMetadata

      public void applyRequestMetadata(io.grpc.CallCredentials.RequestInfo requestInfo, Executor appExecutor, io.grpc.CallCredentials.MetadataApplier applier)
      Specified by:
      applyRequestMetadata in class io.grpc.CallCredentials