github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/common/oauthtokens.go (about)

     1  package common
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  )
     7  
     8  // ServiceTokenType is the type of the token.
     9  type ServiceTokenType string
    10  
    11  // Values of ServiceTokenType
    12  const (
    13  	ServiceTokenTypeOAUTH ServiceTokenType = "oauth"
    14  
    15  	ServiceTokenTypeAWS ServiceTokenType = "aws"
    16  )
    17  
    18  // ServiceTokenIssuer is an interface of an implementation that can issue service tokens on behalf
    19  // of a PU. The user of the library must provide the implementation. ServiceTokens can be OAUTH
    20  // tokens or cloud provider specific tokens such AWS Role credentials.
    21  type ServiceTokenIssuer interface {
    22  	Issue(ctx context.Context, contextID string, stype ServiceTokenType, audience string, validity time.Duration) (string, error)
    23  }