auth

package
v0.0.0-...-048a247 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignJWT

func SignJWT(secret string, claim jwt.Claims) (string, error)

func VerifyJWT

func VerifyJWT(secret string, token []string, out jwt.Claims) (*jwt.Token, error)

Types

type JWTClaimOAuth2CSRF

type JWTClaimOAuth2CSRF struct {
	State       string             `json:"s"`
	CreatedAt   time.Time          `json:"at"`
	Bind        primitive.ObjectID `json:"bind"`
	OldRedirect bool               `json:"old,omitempty"`

	jwt.RegisteredClaims
}

type JWTClaimUser

type JWTClaimUser struct {
	UserID       string  `json:"u"`
	TokenVersion float64 `json:"v"`

	jwt.RegisteredClaims
}

type KeyPairClaim

type KeyPairClaim struct {
	*json.RawMessage
	jwt.RegisteredClaims
}

type KeypairJWT

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

func New

func New(publicKey string, privateKey string) (*KeypairJWT, error)

func (*KeypairJWT) Sign

func (k *KeypairJWT) Sign(podName string, data json.RawMessage) (string, error)

func (*KeypairJWT) Verify

func (k *KeypairJWT) Verify(t string) (*jwt.Token, error)

Jump to

Keyboard shortcuts

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