authz

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	// RequiresEmail returns true if email-based authorization is required
	// If false, authentication alone is sufficient (no whitelist configured)
	RequiresEmail() bool

	// IsAllowed checks if an email address is authorized
	// If RequiresEmail() is false, this always returns true
	IsAllowed(email string) bool
}

Checker is an interface for authorization checking

type EmailChecker

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

EmailChecker checks authorization based on email whitelist

func NewEmailChecker

func NewEmailChecker(cfg config.AccessControlConfig) *EmailChecker

NewEmailChecker creates a new EmailChecker from configuration

func (*EmailChecker) IsAllowed

func (c *EmailChecker) IsAllowed(email string) bool

IsAllowed checks if an email address is authorized If no whitelist is configured, always returns true

func (*EmailChecker) RequiresEmail

func (c *EmailChecker) RequiresEmail() bool

RequiresEmail returns true if email-based authorization is required Returns false if no whitelist is configured (authentication alone is sufficient)

Jump to

Keyboard shortcuts

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