server

package
v1.0.0-alpha.45 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package server provides an http oauth REST API

Index

Constants

View Source
const (
	// AuthRequestParam is the name of the request token parameter
	AuthRequestParam = "request_token"
)

Variables

View Source
var (
	// SwaggerJSON embedded version of the swagger document used at generation time
	SwaggerJSON json.RawMessage
	// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
	FlatSwaggerJSON json.RawMessage

	SpecDoc *loads.Document
)

Functions

This section is empty.

Types

type Option

type Option func(s *Server)

Option provides the server options, these will override th defaults and instance values.

func AllowPasswordGrant

func AllowPasswordGrant(allow bool) Option

AllowPasswordGrant enables password grants which require client secrets

func AllowSignup

func AllowSignup(allow bool) Option

AllowSignup enables the signup/register paths

func CodeStore

func CodeStore(store oauth.CodeStore) Option

CodeStore sets the code store for the server

func SessionCookieKeys

func SessionCookieKeys(hash, block []byte) Option

SessionCookieKeys sets the session cookie keys

func SessionCookieName

func SessionCookieName(name string) Option

SessionCookieName sets the session cookie name

func SessionIntervals

func SessionIntervals(lifetime, timeout time.Duration) Option

SessionIntervals sets the session lifetime and activity timeout

func SessionStore

func SessionStore(store sessions.Store) Option

SessionStore sets the session store

type Server

type Server struct {
	*api.Server
	// contains filtered or unexported fields
}

Server is an API server it can be used standalone vi Server() or integrared via Handler()

func New

func New(ctrl oauth.Controller, athr oauth.Authorizer, opts ...interface{}) *Server

New returns a new Server instance

func (*Server) AddRoute

func (s *Server) AddRoute(path string, method string, params api.Parameters, handler interface{}, scopes ...oauth.Permissions)

AddRoute adds a route using the scopes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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