auth

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Request

func Request(req *http.Request) error

Request enforce policy on a given request

func Token

func Token(token string) (interface{}, error)

Token parses and validates a token and return the logged in user

Types

type User

type User struct {
	ID   int
	Role string
}

User described a user that uses the API

func FromContext

func FromContext(ctx context.Context) *User

FromContext extract the user from the context

Jump to

Keyboard shortcuts

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