security

package
v0.0.0-...-4e1183a Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToSHA512Hex

func ToSHA512Hex(text string) (string, error)

Types

type Doorkeeper

type Doorkeeper struct {
	Storage
}

func NewDoorkeeper

func NewDoorkeeper(s Storage) *Doorkeeper

func (*Doorkeeper) VerifyTextToken

func (dk *Doorkeeper) VerifyTextToken(ctx context.Context, textToken string) (bool, error)

type Issuer

type Issuer struct {
	Storage
}

func NewIssuer

func NewIssuer(s Storage) *Issuer

func (*Issuer) CreateNewToken

func (i *Issuer) CreateNewToken(ctx context.Context, ownerUID string, issueAt *time.Time, duration *time.Duration) (string, *Token, error)

func (*Issuer) RevokeToken

func (i *Issuer) RevokeToken(ctx context.Context, token *Token) error

type Storage

type Storage interface {
	frameless.OnePhaseCommitProtocol
	SecurityToken(context.Context) TokenStorage
}

type Token

type Token struct {
	ID       string `ext:"ID"`
	SHA512   string
	OwnerUID string
	IssuedAt time.Time
	Duration time.Duration
}

func (Token) IsExpirable

func (token Token) IsExpirable() bool

IsExpirable states whether or not the token may expire; capable of being brought to an end.

p.s.: expirable is a valid word since 1913.

func (Token) IsValid

func (token Token) IsValid() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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