sessionidjwt

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(wireClaims *WireClaims, signingKey crypto.PrivateKey, algorithm, keyID string) (string, error)

Sign

Types

type Claims

type Claims struct {
	// Claims from RFC7519
	Issuer     string
	Subject    string
	Audiences  []string
	Expiration time.Time
	NotBefore  time.Time
	IssuedAt   time.Time
	JTI        string

	// Claims from ADK's session model
	Substrate SubstrateClaims
}

type SubstrateClaims

type SubstrateClaims struct {
	AppID     string
	UserID    string
	SessionID string
}

type WireClaims

type WireClaims struct {
	// Claims from RFC7519
	Issuer     string          `json:"iss,omitempty"`
	Subject    string          `json:"sub,omitempty"`
	Audiences  json.RawMessage `json:"aud,omitempty"`
	Expiration float64         `json:"exp,omitempty"`
	NotBefore  float64         `json:"nbf,omitempty"`
	IssuedAt   float64         `json:"iat,omitempty"`
	JTI        string          `json:"jti,omitempty"`

	// Claims from ADK's session model.
	Substrate WireSubstrateClaims `json:"ate.dev,omitempty"`
}

func ClaimsToWire

func ClaimsToWire(claims *Claims) (*WireClaims, error)

type WireSubstrateClaims

type WireSubstrateClaims struct {
	AppID     string `json:"appID,omitempty"`
	UserID    string `json:"userID,omitempty"`
	SessionID string `json:"sessionID,omitempty"`
}

Jump to

Keyboard shortcuts

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