server

package
v0.0.0-...-d4747eb Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package token provides everything needed for token creation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenSource

type TokenSource[Credentials any] interface {
	// Create creates a token for the given credentials.
	Create(context.Context, Credentials) (gophkeeper.Token, error)

	// Unwrap returns the original credentials stored by the token.
	Unwrap(context.Context, gophkeeper.Token) (Credentials, error)
}

TokenSource is a token creation unit.

type UsernameBasedTokenSource

type UsernameBasedTokenSource = TokenSource[string]

UsernameBasedTokenSource is a token provider based on username.

func NewJWTSource

func NewJWTSource(secret []byte, lifespan time.Duration) UsernameBasedTokenSource

NewJWTSource creates a new JWT provider.

Directories

Path Synopsis
Package encrypted provides gophkeeper implementation that encrypts the data passed to it, and restores it.
Package encrypted provides gophkeeper implementation that encrypts the data passed to it, and restores it.
internal
Package encryption provides encryption utils.
Package encryption provides encryption utils.
Package postgres provides gophkeeper implementation with postgresql database storage.
Package postgres provides gophkeeper implementation with postgresql database storage.
Package rest provides REST implementation of gophkeeper via Rest object.
Package rest provides REST implementation of gophkeeper via Rest object.
authentication
Package authentication provides authentication related middleware and functions.
Package authentication provides authentication related middleware and functions.
login
Package login provides REST endpoint to authenticate a user.
Package login provides REST endpoint to authenticate a user.
register
Package register provides REST endpoint to register a new user.
Package register provides REST endpoint to register a new user.
vault
Package vault provides REST entry for manipulating the vault of the authenticated user.
Package vault provides REST entry for manipulating the vault of the authenticated user.
vault/blob
Package blob provides REST endpoints to store and restore a file.
Package blob provides REST endpoints to store and restore a file.
vault/credential
Package credential provides authorization related middleware and function.
Package credential provides authorization related middleware and function.
vault/piece
Package piece provides REST endpoints to store and restore a piece.
Package piece provides REST endpoints to store and restore a piece.

Jump to

Keyboard shortcuts

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