entity

package
v0.0.0-...-7974e50 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm string
const (
	RS256 Algorithm = "RS256"
	ES256 Algorithm = "ES256"
	HS256 Algorithm = "HS256"
)

type Key

type Key struct {
	Id         string
	Type       KeyType
	Algorithm  Algorithm
	Raw        crypto.PrivateKey
	EncodeFunc KeyEncodeFunc
}

func (Key) Encode

func (key Key) Encode() (proto.Message, error)

Encode is a helper method used to invoke EncodeFunc safely.

type KeyEncodeFunc

type KeyEncodeFunc func(crypto.PublicKey) (proto.Message, error)

type KeyType

type KeyType string
const (
	RSA   KeyType = "RSA"
	ECDSA KeyType = "ECDSA"
	HMAC  KeyType = "HMAC"
)

type Token

type Token struct {
	Id        string // Token's ID is its related decoded opaque token.
	UserId    string
	Type      TokenType
	ExpiresAt time.Time
	IssuedAt  time.Time
}

type TokenType

type TokenType string
const (
	RefreshToken TokenType = "refresh-token"
	AccessToken  TokenType = "access-token"
)

Jump to

Keyboard shortcuts

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