sts

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const SharedSigningKeyRedisKey = "trustgate:sts:signing-key:pkcs8-pem"

SharedSigningKeyRedisKey is the Redis key under which the auto-provisioned STS signing key is stored so every replica signs and verifies with the same key.

Variables

This section is empty.

Functions

func ResolveSharedSigningKey added in v0.18.0

func ResolveSharedSigningKey(ctx context.Context, rdb *redis.Client, logger *slog.Logger) (string, error)

ResolveSharedSigningKey returns a PEM-encoded RSA signing key shared across replicas via Redis. It returns the stored key when present; otherwise it generates one and stores it with SETNX so concurrent replicas converge on a single key instead of each minting with its own ephemeral key.

Types

type Signer

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

func NewSigner

func NewSigner(issuer, keyPEM string, logger *slog.Logger) (*Signer, error)

func (*Signer) Issuer

func (s *Signer) Issuer() string

func (*Signer) JWKS

func (s *Signer) JWKS() map[string]any

func (*Signer) MintClaims

func (s *Signer) MintClaims(claims jwt.MapClaims, ttl time.Duration) (string, error)

type TokenClient

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

func NewTokenClient

func NewTokenClient(client *http.Client) *TokenClient

func (*TokenClient) Call

func (c *TokenClient) Call(ctx context.Context, issuer string, form url.Values) (*appsts.Token, error)

Jump to

Keyboard shortcuts

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