validator

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthTokenValidator

type AuthTokenValidator interface {
	Initialize()
	Validate(token string, permission *Permission, namespace *string, userId *string) error
}

func NewTokenValidator

func NewTokenValidator(authService iam.OAuth20Service, refreshInterval time.Duration) AuthTokenValidator

type JWTBan

type JWTBan struct {
	Ban     string    `json:"Ban"`
	EndDate time.Time `json:"EndDate"`
}

JWTBan holds information about ban record in JWT

type JWTClaims

type JWTClaims struct {
	Namespace       string          `json:"namespace"`
	DisplayName     string          `json:"display_name"`
	Roles           []string        `json:"roles"`
	NamespaceRoles  []NamespaceRole `json:"namespace_roles"`
	Permissions     []Permission    `json:"permissions"`
	Bans            []JWTBan        `json:"bans"`
	JusticeFlags    int             `json:"jflgs"`
	Scope           string          `json:"scope"`
	Country         string          `json:"country"`
	ClientID        string          `json:"client_id"`
	IsComply        bool            `json:"is_comply"`
	StudioNamespace string          `json:"studio_namespace,omitempty"`
	jwt.Claims
}

JWTClaims holds data stored in a JWT access token with additional Justice Flags field

func (*JWTClaims) Validate

func (c *JWTClaims) Validate() error

Validate checks if the JWT is still valid

type NamespaceRole

type NamespaceRole struct {
	RoleID    string `json:"roleId"`
	Namespace string `json:"namespace"`
}

type Permission

type Permission struct {
	Resource        string
	Action          int
	ScheduledAction int      `json:"SchedAction,omitempty"`
	CronSchedule    string   `json:"SchedCron,omitempty"`
	RangeSchedule   []string `json:"SchedRange,omitempty"`
}

type Role

type Role struct {
	RoleID      string `json:"RoleId"`
	RoleName    string
	Permissions []Permission
}

Role holds info about a user role.

Jump to

Keyboard shortcuts

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