auth

package
v0.0.0-...-49bf833 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(hashedPassword, password string) error

func Encrypt

func Encrypt(password string) (string, error)

Types

type Authz

type Authz struct {
	*casbin.SyncedEnforcer
}

Authz defines an adapter for casbin, providing authorization function

func NewAuthz

func NewAuthz(db *gorm.DB) (*Authz, error)

NewAuthz creates an authorizer using casbin for authorization

func (*Authz) Authorize

func (a *Authz) Authorize(sub, obj, act string) (bool, error)

Authorize is used for authorization

Jump to

Keyboard shortcuts

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