auth

package
v0.0.0-...-77d204d Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTMLTemplates = []string{
	"auth/decide_method.tmpl",
	"auth/fallback_sign_in.tmpl",
	"auth/withssb_server_start.tmpl",
}

Functions

This section is empty.

Types

type WithSSBHandler

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

WithSSBHandler implements the oauth-like challenge/response dance described in https://ssb-ngi-pointer.github.io/ssb-http-auth-spec

func (WithSSBHandler) AuthenticateRequest

func (h WithSSBHandler) AuthenticateRequest(r *http.Request) (*roomdb.Member, error)

AuthenticateRequest uses the passed request to load and return the session data that was stored previously. If it is invalid or there is no session, it will return ErrNotAuthorized. Otherwise it will return the member that belongs to the session.

func (WithSSBHandler) DecideMethod

func (h WithSSBHandler) DecideMethod(w http.ResponseWriter, req *http.Request)

this is the /login landing page which branches out to the different methods based on the query parameters that are present

func (WithSSBHandler) Logout

Logout destroys the session data and updates the cookie with an invalidated one.

Jump to

Keyboard shortcuts

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