providerauth

package
v0.0.0-...-ea3388d Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, handler api.AuthProvider) (chan<- bool, error)

Register registers a specific AuthProvider by name The returned online channel is used to asynchronously update authorization status

func Setup

func Setup(router *mux.Router, paramC chan<- util.Param)

Setup connects the redirect handler to the router and registers the callback channel

Types

type AuthProvider

type AuthProvider struct {
	ID            string `json:"id"`
	Authenticated bool   `json:"authenticated"`
}

type Handler

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

Handler manages a dynamic map of routes for handling the redirect during OAuth authentication. When a route is registered a token OAuth state is returned. On GET request the generic handler identifies route and target handler by request state obtained from the request and delegates to the registered handler.

type State

type State struct {
	Created time.Time `json:"time"`
}

func DecryptState

func DecryptState(enc string, key []byte) (*State, error)

func NewState

func NewState() State

func (*State) Encrypt

func (c *State) Encrypt(key []byte) string

func (*State) Valid

func (c *State) Valid() bool

Jump to

Keyboard shortcuts

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