cli

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package cli adds support for command line interfaces or micro-services to establish an access and/or refresh token via user participation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFactory

func RegisterFactory(store storage.Store, path string, crypt kms.Encryption, cliAuthURL, issuerURL, authURL, tokenURL, accept string, httpClient *http.Client) *handlerfactory.Options

RegisterFactory creates handlers for shell login requests.

Types

type AcceptHandler

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

AcceptHandler handles one CLI auth request.

func NewAcceptHandler

func NewAcceptHandler(store storage.Store, crypt kms.Encryption, rootPath string) (*AcceptHandler, error)

NewAcceptHandler creates a new AcceptHandler.

func (*AcceptHandler) Handle

func (h *AcceptHandler) Handle(w http.ResponseWriter, r *http.Request)

Handle handles an accept redirect request.

type AuthHandler

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

AuthHandler handles one CLI auth request.

func NewAuthHandler

func NewAuthHandler(store storage.Store) *AuthHandler

NewAuthHandler creates a new AuthHandler.

func (*AuthHandler) Handle

func (h *AuthHandler) Handle(w http.ResponseWriter, r *http.Request)

Handle handles a CLI authentication request.

type RegisterHandler

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

RegisterHandler handles shell login requests.

func NewRegisterHandler

func NewRegisterHandler(store storage.Store, crypt kms.Encryption, cliAuthURL, issuerURL, authURL, tokenURL, accept string, httpClient *http.Client) *RegisterHandler

NewRegisterHandler handles one shell login request.

func (*RegisterHandler) CheckIntegrity

func (h *RegisterHandler) CheckIntegrity(*http.Request) *status.Status

CheckIntegrity checks that any modifications make sense before applying them.

func (*RegisterHandler) Get

func (h *RegisterHandler) Get(r *http.Request, name string) (proto.Message, error)

Get is a GET request.

func (*RegisterHandler) LookupItem

func (h *RegisterHandler) LookupItem(r *http.Request, name string, vars map[string]string) bool

LookupItem looks up the item in the storage layer.

func (*RegisterHandler) NormalizeInput

func (h *RegisterHandler) NormalizeInput(r *http.Request, name string, vars map[string]string) error

NormalizeInput sets up basic structure of request input objects if absent.

func (*RegisterHandler) Patch

func (h *RegisterHandler) Patch(r *http.Request, name string) (proto.Message, error)

Patch is a PATCH request.

func (*RegisterHandler) Post

func (h *RegisterHandler) Post(r *http.Request, name string) (proto.Message, error)

Post is a POST request.

func (*RegisterHandler) Put

func (h *RegisterHandler) Put(r *http.Request, name string) (proto.Message, error)

Put is a PUT request.

func (*RegisterHandler) Remove

func (h *RegisterHandler) Remove(r *http.Request, name string) (proto.Message, error)

Remove is a DELETE request.

func (*RegisterHandler) Save

func (h *RegisterHandler) Save(r *http.Request, tx storage.Tx, name string, vars map[string]string, desc, typeName string) error

Save will save any modifications done for the request.

func (*RegisterHandler) Setup

func (h *RegisterHandler) Setup(r *http.Request, tx storage.Tx) (int, error)

Setup sets up the handler.

Jump to

Keyboard shortcuts

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