robotaccount

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const JWTAudience = "artifact-cas.chainloop"

Variables

View Source
var SigningMethod = jwt.SigningMethodES512

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

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

func (*Builder) GenerateJWT

func (ra *Builder) GenerateJWT(backendType, secretID, audience string, role Role, maxBytes int64) (string, error)

type Claims

type Claims struct {
	jwt.RegisteredClaims
	Role           Role   `json:"role"`      // either downloader or uploader
	StoredSecretID string `json:"secret-id"` // path to the OCI secret in the vault
	BackendType    string `json:"backend"`   // backend to use, i.e OCI
	MaxBytes       int64  `json:"maxbytes"`  // max bytes to upload
}

func (*Claims) CheckRole

func (c *Claims) CheckRole(r Role) error

func (*Claims) Valid

func (c *Claims) Valid() error

Additional validation checks

type NewOpt

type NewOpt func(b *Builder) error

func WithExpiration

func WithExpiration(d time.Duration) NewOpt

func WithIssuer

func WithIssuer(issuer string) NewOpt

func WithPrivateKey

func WithPrivateKey(path string) NewOpt

type Role

type Role string
const (
	Downloader Role = "downloader"
	Uploader   Role = "uploader"
)

Jump to

Keyboard shortcuts

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