Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoPrivateKeySpecified occurs when the private key was not set // and there was an attempt to create a token ErrNoPrivateKeySpecified = errors.New("private key is nil") )
Functions ¶
This section is empty.
Types ¶
type Creator ¶
type Creator interface { // Create creates a signed token that can be used for interservice communication. Create(reference string, opts Options) (string, error) }
Creator creates all kinds of signed tokens for the background tasks
func NewCreator ¶
NewCreator creates a new token creator for tasks
type CreatorMock ¶
CreatorMock is a utility function to simplify writing tests that use the Creator
type Options ¶
type Options struct { // Audience is a name of the service that receives the request. Other // services should not validate tokens intended for other services. Audience string // ProjectID is the UUID string for a project that the token should be // considered a member and an admin of. This value is deprecated, but // exists for backwards compatibility during the transition to `azp`. ProjectID string // ID is the UUID string to identify this token. // It will be a random UUID if not specified. ID string // UserID is the UUID string to identify the user that the token is // intended for. It will be the null UUID when not specified UserID string }
Options control the value or the generation of the claims in the resulting token. All values are optional and the empty value will be ignored.
Click to show internal directories.
Click to hide internal directories.