auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Issuer = "token-exchange"

Variables

View Source
var DefaultAudience = jwt.Audience{"autojoin"}

DefaultAudience is the default audience for JWT tokens. TODO(rd): Support audience selection (via different URLs or query string)

Functions

This section is empty.

Types

type Claims

type Claims struct {
	jwt.Claims
	Organization string `json:"org"`
}

Claims is a JWT claims set that extends jwt.Claims with an additional field for the Organization.

type JWTSigner

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

JWTSigner is a JWT signer that can be used to sign JWT tokens.

func NewJWTSigner

func NewJWTSigner(keyPath string) (*JWTSigner, error)

NewJWTSigner loads a private key from a JWK file and prepares a signer.

func (*JWTSigner) GenerateToken

func (s *JWTSigner) GenerateToken(org string) (string, error)

GenerateToken generates a JWT token for the given organization.

func (*JWTSigner) GetPublicJWK

func (s *JWTSigner) GetPublicJWK() jose.JSONWebKey

GetPublicJWK returns the public key in jose.JSONWebKey format.

Jump to

Keyboard shortcuts

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