auth

package
v0.0.0-...-0451d2a Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Identify(ctx context.Context, token string) (string, error)
	Issue(ctx context.Context, sessionID string, ttl int64) (string, error)
}

func NewAuthenticator

func NewAuthenticator(parser TokenParser) Authenticator

type Token

type Token struct {
	SessionID string
}

type TokenParser

type TokenParser interface {
	Decode(token string) (*Token, error)
	Encode(sessionID string, ttl int64) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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