http

package
v0.0.0-...-88e8fcd Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthCreateToken

func AuthCreateToken(c map[string]interface{}) (string, error)

AuthCreateToken returns a token with the provided claims in it. At the minimum its expected that a

func RegisterAuthProvider

func RegisterAuthProvider(n string, ap AuthProviderFactory)

RegisterAuthProvider is used by other providers to be able to register them into the system and create a subtree on the /auth/ route.

Types

type AuthProviderFactory

type AuthProviderFactory func(*echo.Group) error

AuthProviderFactory is a mechanism to return a complete auth system ready to go. Because this registers a set of routes, the only thing it can really do is return a bad object, so we check an error here to see if something goes wrong.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server encapsulates the components of the http server and its associated key management.

func New

func New(netman nm.NetworkManager) (Server, error)

New initializes and returns an http.Server.

func (*Server) Serve

func (s *Server) Serve() error

Serve is called to commence serving. It will only return with an error if the serve call aborts.

type TokenClaims

type TokenClaims map[string]interface{}

TokenClaims is a type for setting the claims in the authentication tokens. The only required claims that have to be set are the name, and networks the holder is an admin of.

Directories

Path Synopsis
auth

Jump to

Keyboard shortcuts

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