iam

package
v3.0.27 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PolicyType = "IAM-Policy-Type"
	Endpoint   = "IAM-Access-Endpoint"
	Method     = "IAM-Access-Method"
)
View Source
const (
	UserInfo = "userInfo"
)

Variables

This section is empty.

Functions

func New

func New(config *viper.Viper, cache *redis.RedisClient) middleware.Object

func Resp2User

func Resp2User(in []byte) (resp response.Response, err error)

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) GetConfig

func (h *Handler) GetConfig() *viper.Viper

func (*Handler) Handle

func (h *Handler) Handle() gin.HandlerFunc

func (*Handler) SetConfig

func (h *Handler) SetConfig(config *viper.Viper)

type Object

type Object struct {
	Type    string `json:"type"`
	Subject string `json:"subject"`
	Object  string `json:"object"`
	Action  string `json:"action"`
}

type Permission

type Permission struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	GuardName string    `json:"guardName"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Pivot     *Pivot    `json:"pivot"`
}

type Pivot

type Pivot struct {
	ModelID      int64  `json:"model_id,omitempty"`
	RoleID       int64  `json:"role_id,omitempty"`
	ModelType    string `json:"model_type,omitempty"`
	PermissionID int64  `json:"permission_id,omitempty"`
}

type Response

type Response struct {
	User *User `json:"user"`
}

type Role

type Role struct {
	ID        int64     `json:"id"`
	Name      string    `json:"name"`
	GuardName string    `json:"guardName"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Pivot     *Pivot    `json:"pivot"`
}

type User

type User struct {
	ID              int64         `json:"id"`
	Name            string        `json:"name"`
	RogAccount      string        `json:"rogaccount"`
	Email           string        `json:"email"`
	EmailVerifiedAt time.Time     `json:"email_verified_at"`
	CreatedAt       time.Time     `json:"created_at"`
	UpdatedAt       time.Time     `json:"updated_at"`
	Roles           []*Role       `json:"roles"`
	Permissions     []*Permission `json:"permissions"`
}

func GetUser

func GetUser(c *gin.Context) (*User, error)

Jump to

Keyboard shortcuts

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