auth

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package auth contains the authentication module which is responsible for authenticating and authorizing users on the endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Logger   logger.ILogger
	Config   config.Config
	Settings models.Settings
	Prompter userio.Prompter
}

Auth is the main struct for the auth module

type AuthModuleBuilder

type AuthModuleBuilder struct {
	Logger   logger.ILogger
	Config   config.Config
	Settings models.Settings
	Prompter userio.Prompter
}

AuthModuleBuilder is the builder for the auth module

func NewBuilder

func NewBuilder(config config.Config, settings models.Settings) *AuthModuleBuilder

NewBuilder creates a new AuthModuleBuilder

type IHttpAuth

type IHttpAuth interface {
	// AllowRoles middleware checks if the given request has a valid JWT token
	// and if the user has any of the given roles.
	AllowRoles(next http.Handler, roles ...string) http.Handler
	// AllowAuthenticated middleware checks if the given request has a valid JWT token.
	AllowAuthenticated(next http.Handler) http.Handler
}

IHttpAuth is an interface for the HTTP authentication

Directories

Path Synopsis
Package middlewares provides a set of middleware functions used to check Zitadel access token for auth and roles.
Package middlewares provides a set of middleware functions used to check Zitadel access token for auth and roles.

Jump to

Keyboard shortcuts

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