acl

package
v0.0.0-...-7dff3de Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(ctx context.Context, userID string, roles []string) error

AddUser adds a role for a user in the acl policy

func DeleteUser

func DeleteUser(ctx context.Context, userID string) error

DeleteUser deletes a role for a user in the acl policy

func GetAuthorizedRoutes

func GetAuthorizedRoutes() ([]string, error)

GetAuthorizedRoutes gets all the authorized routes

func GetPermissionsForUser

func GetPermissionsForUser(ctx context.Context, userID string) ([][]string, error)

GetPermissionsForUser gets all the permissions for a user

func UseAuthEnforcer

func UseAuthEnforcer(ctx context.Context, instance *echo.Echo)

UseAuthEnforcer forces the acl on the routes

Types

type Config

type Config struct {
	Enabled     bool   `env:"ACL_ENABLED"`
	Username    string `env:"ACL_AUTH_USERNAME,unset"`
	Password    string `env:"ACL_AUTH_PASSWORD,unset"`
	AuthModel   string `env:"ACL_AUTH_MODEL"`
	PolicyModel string `env:"ACL_POLICY_MODEL"`
	// contains filtered or unexported fields
}

func (*Config) Provide

func (cfg *Config) Provide() error

Provide provides configuration for acl

Jump to

Keyboard shortcuts

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