quiltro

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

README

quiltro

Authentication and authorization package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGroupingPolicy added in v1.1.0

func AddGroupingPolicy(fieldValues ...interface{}) error

func AddPolicy

func AddPolicy(fieldValues ...interface{}) error

func Authenticate

func Authenticate() gin.HandlerFunc

func Authorize

func Authorize(obj string, act string) gin.HandlerFunc

func CreatePolicy added in v1.1.0

func CreatePolicy(c *gin.Context)

POST /policies

func DeletePolicy added in v1.1.0

func DeletePolicy(c *gin.Context)

DELETE /policies/:id

func Enforce added in v1.1.0

func Enforce(fieldValues ...interface{}) (bool, error)

func GenerateJWT

func GenerateJWT(id uint) (string, error)

func GetFilteredPolicy added in v1.1.0

func GetFilteredPolicy(fieldIndex int, fieldValues ...string) ([][]string, error)

func GetPolicy added in v1.1.0

func GetPolicy(c *gin.Context)

GET /policies/:id

func GetSubjectGroups added in v1.1.0

func GetSubjectGroups(sub string) ([][]string, error)

func GetSubjectPolicies added in v1.1.0

func GetSubjectPolicies(sub string) ([][]string, error)

func Init added in v1.1.0

func Init(gormDb *gorm.DB, s interface{})

func ListPolicies added in v1.1.0

func ListPolicies(c *gin.Context)

GET /policies

func RemovePolicy

func RemovePolicy(fieldValues ...interface{}) error

func UpdatePolicy added in v1.1.0

func UpdatePolicy(c *gin.Context)

PUT /policies/:id

Types

type Policy added in v1.1.0

type Policy struct {
	ID    uint   `gorm:"primaryKey" json:"id"`
	Ptype string `gorm:"size:100;not null" json:"ptype"`
	V0    string `gorm:"size:100;not null" json:"v0"`
	V1    string `gorm:"size:100;not null" json:"v1"`
	V2    string `gorm:"size:100;not null" json:"v2"`
	V3    string `gorm:"size:100;not null" json:"v3"`
	V4    string `gorm:"size:100;not null" json:"v4"`
	V5    string `gorm:"size:100;not null" json:"v5"`
}

func (Policy) TableName added in v1.1.0

func (Policy) TableName() string

Jump to

Keyboard shortcuts

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