signing

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keys

type Keys struct {
	CreatedAt string `json:"created_at"`
	KeyID     string `json:"key_id"`
	Key       string `json:"key"`
}

type Signer

type Signer interface {
	// Convert any data proto to signed JWT token
	Sign(ctx context.Context, claim []byte, expire time.Time) (token string, errUC *types.CommonError)

	// Get keys to verify token this usecase have signed
	Keys(ctx context.Context) (keys []Keys, errUC *types.CommonError)
}

Usecase converts OIDC credential to another identity token With Subject and Issuer field changed TOKEN Based authorization

type Usecase

type Usecase interface {
	Signer
	Verifier
}

type Verifier

type Verifier interface {
	// Verify token
	Verify(ctx context.Context, token string) (claim []byte, errUC *types.CommonError)
}

type VerifierOf

type VerifierOf[T any] interface {
	// Verify token
	VerifyAs(ctx context.Context, token string) (claim T, errUC *types.CommonError)
}

Specific case of Verifier

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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