Help us shape the future of Go! Take the 2026 Go Developer Survey

robotaccount

package
v0.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SigningMethod = jwt.SigningMethodHS256

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(opts ...NewOpt) (*Builder, error)

NewBuilder creates a new robot account builder meant to be associated with a workflowRun It does not expire but its revocation status is checked on every request Currently we use a simple hmac encryption method meant to be continuously rotated TODO: additional/alternative encryption method, i.e DSE asymetric, see CAS robot account for reference

func (*Builder) GenerateJWT

func (ra *Builder) GenerateJWT(orgID, workflowID, keyID, audience string) (string, error)

NOTE: It does not expire, it will get revoked instead

type CustomClaims

type CustomClaims struct {
	OrgID      string `json:"org_id"`
	WorkflowID string `json:"workflow_id"`
	jwt.RegisteredClaims
}

type NewOpt

type NewOpt func(b *Builder)

func WithIssuer

func WithIssuer(issuer string) NewOpt

func WithKeySecret

func WithKeySecret(hmacSecret string) NewOpt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL