auth

package
v2.18.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidden = errors.New("forbidden access")

ErrForbidden occurs when user is identified but not authorized

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// IsAuthorized checks if given user is authorized
	IsAuthorized(context.Context, model.User, string) bool
}

Provider provides methods for dealing with identification

type Service added in v2.11.3

Service defines interaction with storage and provider from User

type Storage added in v2.11.3

type Storage interface {
	DoAtomic(context.Context, func(context.Context) error) error
	Get(context.Context, uint64) (model.User, error)
	Create(context.Context, model.User) (uint64, error)
	Update(context.Context, model.User) error
	Delete(context.Context, model.User) error
}

Storage defines interaction with storage from User

Jump to

Keyboard shortcuts

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