Documentation
¶
Overview ¶
Package jwtexchange provides internal types for JWT exchange handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExchangeJwtsForKeys ¶
func ExchangeJwtsForKeys(ctx context.Context, exchanger JwtExchanger, jwts []string) ([]string, error)
ExchangeJwtsForKeys exchanges a list of JWTs for authorization private keys.
Parameters:
- ctx: Context for cancellation and timeouts
- exchanger: JwtExchanger for exchanging JWTs for private keys
- jwts: List of JWTs to exchange
Returns:
- []string: List of base64-encoded PKCS8-formatted P-256 private keys
- error: Non-nil if any exchange fails, indicating which JWT index failed
Types ¶
type JwtExchanger ¶
type JwtExchanger interface {
// ExchangeJwtForAuthorizationKey exchanges a user JWT for a short-lived
// authorization private key.
//
// Input:
// - ctx: Context for cancellation and timeouts
// - jwt: A valid user JWT
//
// Output:
// - string: Base64-encoded PKCS8-formatted P-256 private key
// - error: Non-nil if the exchange fails
ExchangeJwtForAuthorizationKey(ctx context.Context, jwt string) (string, error)
}
JwtExchanger is an interface for exchanging user JWTs for authorization private keys.
Click to show internal directories.
Click to hide internal directories.