auth

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(
	ctx context.Context,
	requirements ...Requirement,
) error

Authorize authorizes the client session taken from the provided context against the provided requirements

Types

type CtxKey

type CtxKey int

CtxKey represents a context.Context value key type

const CtxSession CtxKey = 1

CtxSession defines the context.Context session value key

type IsOwner

type IsOwner struct {
	Owner store.ID
}

IsOwner indicates that the client is required to be the owner of a resource

type IsUser

type IsUser struct{}

IsUser indicates that the client is required to be an authenticated user

type RequestSession

type RequestSession struct {
	IsDebug  bool
	UserID   store.ID
	Creation time.Time
}

RequestSession represents a client session

type Requirement

type Requirement interface {
	// contains filtered or unexported methods
}

Requirement defines the authorization requirement implementation interface

Jump to

Keyboard shortcuts

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