jwtexchange

package
v0.15.0 Latest Latest
Warning

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

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

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.

Jump to

Keyboard shortcuts

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