auth

package
v0.0.0-...-a84335b Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package auth provides authentication and authorization routines like login and session handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func New

func New(db authdb) Auth

func (Auth) CreateSession

func (a Auth) CreateSession(ctx context.Context, init string) (Session, error)

CreateSession redeems session_init id for a full login session.

func (Auth) Login

func (a Auth) Login(ctx context.Context, eml string) (InitSession, error)

Login starts a passwordless authentication process. It checks the given email against the database and creates an initial session if appropriate. The initial session can then be exchaged for a real session once acknowledged through a second channel.

type InitSession

type InitSession struct {
	ID        string
	ProfileID string
	Expires   time.Time
	Name      string
}

InitSession represents a potential session. If the session is acknowledged before it expires, a full session created granting authenticated access.

type Session

type Session database.Session

Session represents an authenticated user session

Jump to

Keyboard shortcuts

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