auth

package
v0.0.0-...-116ca14 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	RequestMethod   string
	RequestPath     string
	IdentityStatus  string
	ProjectId       string
	ProjectDomainId string
	User            User
}

func GetIdentity

func GetIdentity(r *http.Request) *Authorization

func (*Authorization) CheckIdentity

func (auth *Authorization) CheckIdentity() error

func (*Authorization) CheckPolicy

func (auth *Authorization) CheckPolicy(warden ladon.Ladon) error

CheckPolicy checks the given roles against the policy

type IdentityStatusInvalid

type IdentityStatusInvalid struct {
	Msg string
}

func (IdentityStatusInvalid) Error

func (e IdentityStatusInvalid) Error() string

type NotAuthorized

type NotAuthorized struct {
	Msg string
}

func (NotAuthorized) Error

func (e NotAuthorized) Error() string

type User

type User struct {
	Id         string   `json:"id"`
	Name       string   `json:"name,omitempty"`
	DomainId   string   `json:"domain_id,omitempty"`
	DomainName string   `json:"domain_name,omitempty"`
	Roles      []string `json:"roles,omitempty"`
}

Jump to

Keyboard shortcuts

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