auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateRequest

func AuthenticateRequest(req *http.Request, cookieName string) (*common.AuthInfo, error)

Authenticate from the http Request handle directly Note: this step needs to happen before upgrading from http to websocket or any other protocol, allowing parsing of the provided headers.

Auth Token typically is sent as part of the Authorization Header, but for websocket kind of connection it is typically not a supported mechanism, Thus this function also allows working with a token passed as part of the cookie. by default it will look for cookie name "AUTH_TOKEN", Unless it is overidden as part of the argument cookie, if empty it falls back to default cookie name priority order 1. Authorization Header 2. if no token found above, get from cookie

func AuthenticateToken

func AuthenticateToken(token string) (*common.AuthInfo, error)

Authenticate the bearer token provided in the individual API request sent over to the controller

func Initialize

func Initialize(url, clientId string) error

Initialize authentication module, providing the constructs to validate token available in the incoming HTTP requests

Types

This section is empty.

Jump to

Keyboard shortcuts

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