authentication

package
v0.0.0-...-80d63af Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	GenerateAccessToken(userID types.UserID) (accessToken types.Token, expiresIn int64, err error)
	GetUserID(r *http.Request) (types.UserID, error)
}

Authenticator interface

func New

func New(cfg *config.Config) Authenticator

New creates a new auth instance.

type AuthenticatorImpl

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

AuthenticatorImpl is an implementation of the Authenticator interface.

func (*AuthenticatorImpl) GenerateAccessToken

func (j *AuthenticatorImpl) GenerateAccessToken(userID types.UserID) (accessToken types.Token, expiresIn int64, err error)

GenerateAccessToken creates a new access token.

func (*AuthenticatorImpl) GetUserID

func (j *AuthenticatorImpl) GetUserID(r *http.Request) (types.UserID, error)

GetUserID returns the user id from the request.

Jump to

Keyboard shortcuts

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