auth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NavigationEndpoint = &xreq.Endpoint{
	Path:       "/meta",
	Method:     "GET",
	Handler:    xreq.Convert(NavigationProcess),
	Authorizer: nil,
}
View Source
var ProductTokenListEndpoint = &xreq.Endpoint{
	Path:       "/auth/tokens/actions/search-by-product/{product_name}",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(ProductTokenListAction),
	Authorizer: iauth.FA(iauth.FeatureToken, iauth.ActionReadAll),
}

ProductTokenListEndpoint route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var ProductUserBindEndpoint = &xreq.Endpoint{
	Path:       "/auth/users/{user_name}/products/{product_name}",
	Method:     http.MethodPost,
	Handler:    xreq.Convert(ProductUserBindAction),
	Authorizer: iauth.FA(iauth.FeatureProductUser, iauth.ActionCreate),
}

ProductUserCreateRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var ProductUserBindListEndpoint = &xreq.Endpoint{
	Path:       "/auth/users/actions/search-by-product/{product_name}",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(ProductUserListAction),
	Authorizer: iauth.FA(iauth.FeatureProductUser, iauth.ActionReadAll),
}

ProductUserListRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var ProductUserUnbindEndpoint = &xreq.Endpoint{
	Path:       "/auth/users/{user_name}/products/{product_name}",
	Method:     http.MethodDelete,
	Handler:    xreq.Convert(ProductUserUnbindAction),
	Authorizer: iauth.FA(iauth.FeatureProductUser, iauth.ActionDelete),
}

ProductUserUnbindRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var SessionKeyByPasswordEndpoint = &xreq.Endpoint{
	Path:       "/auth/session-keys",
	Method:     http.MethodPost,
	Handler:    xreq.Convert(SessionKeyByPasswordAction),
	Authorizer: nil,
}

SessionKeyByPasswordRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var SessionKeyDestroyEndpoint = &xreq.Endpoint{
	Path:       "/auth/session-keys/{session_key}",
	Method:     http.MethodDelete,
	Handler:    xreq.Convert(SessionKeyDestroyAction),
	Authorizer: nil,
}

SessionKeyDestroyRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var TokenCreateEndpoint = &xreq.Endpoint{
	Path:       "/auth/tokens",
	Method:     http.MethodPost,
	Handler:    xreq.Convert(TokenCreateAction),
	Authorizer: iauth.FA(iauth.FeatureToken, iauth.ActionCreate),
}

SessionKeyByInnerRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var TokenDestroyEndpoint = &xreq.Endpoint{
	Path:       "/auth/tokens/{token_name}",
	Method:     http.MethodDelete,
	Handler:    xreq.Convert(TokenDestroyAction),
	Authorizer: iauth.FA(iauth.FeatureToken, iauth.ActionDelete),
}

TokenDestroyRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var TokenListEndpoint = &xreq.Endpoint{
	Path:       "/auth/tokens",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(TokenListAction),
	Authorizer: iauth.FA(iauth.FeatureToken, iauth.ActionReadAll),
}

InnerUserListRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var TokenOneEndpoint = &xreq.Endpoint{
	Path:       "/auth/tokens/{token_name}",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(TokenOneAction),
	Authorizer: iauth.FA(iauth.FeatureToken, iauth.ActionReadAll),
}

InnerUserOneRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UserCreateEndpoint = &xreq.Endpoint{
	Path:       "/auth/users",
	Method:     http.MethodPost,
	Handler:    xreq.Convert(UserCreateAction),
	Authorizer: iauth.FA(iauth.FeatureUser, iauth.ActionCreate),
}

UserCreateRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UserDeleteEndpoint = &xreq.Endpoint{
	Path:       "/auth/users/{user_name}",
	Method:     http.MethodDelete,
	Handler:    xreq.Convert(UserDeleteAction),
	Authorizer: iauth.FA(iauth.FeatureUser, iauth.ActionDelete),
}

UserDeleteRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UserListEndpoint = &xreq.Endpoint{
	Path:       "/auth/users",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(UserListAction),
	Authorizer: iauth.FA(iauth.FeatureUser, iauth.ActionReadAll),
}

UserListRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UserOneEndpoint = &xreq.Endpoint{
	Path:       "/auth/users/{user_name}",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(UserOneAction),
	Authorizer: iauth.FA(iauth.FeatureUser, iauth.ActionReadAll),
}

UserOneRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UserUpdateIsAdminEndpoint = &xreq.Endpoint{
	Path:       "/auth/users/{user_name}/is_admin",
	Method:     http.MethodPatch,
	Handler:    xreq.Convert(UserUpdateIsAdminAction),
	Authorizer: iauth.FA(iauth.FeatureUser, iauth.ActionUpdate),
}

UserUpdateIsAdminRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UserUpdatePasswordEndpoint = &xreq.Endpoint{
	Path:       "/auth/users/{user_name}/passwd",
	Method:     http.MethodPatch,
	Handler:    xreq.Convert(UserUpdatePasswordAction),
	Authorizer: iauth.FA(iauth.FeatureUser, iauth.ActionUpdate),
}

UserUpdatePasswordRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

Functions

func NavigationProcess(req *http.Request) (interface{}, error)

func ProductTokenListAction added in v0.0.2

func ProductTokenListAction(req *http.Request) (interface{}, error)

ProductTokenListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func ProductUserBindAction added in v0.0.2

func ProductUserBindAction(req *http.Request) (interface{}, error)

ProductUserBindAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func ProductUserListAction added in v0.0.2

func ProductUserListAction(req *http.Request) (interface{}, error)

ProductUserListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func ProductUserUnbindAction added in v0.0.2

func ProductUserUnbindAction(req *http.Request) (interface{}, error)

ProductUserUnbindAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func SessionKeyByPasswordAction

func SessionKeyByPasswordAction(req *http.Request) (interface{}, error)

SessionKeyByPasswordAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func SessionKeyDestroyAction

func SessionKeyDestroyAction(req *http.Request) (interface{}, error)

SessionKeyDestroyAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func TokenCreateAction added in v0.0.2

func TokenCreateAction(req *http.Request) (interface{}, error)

TokenCreateAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func TokenDestroyAction added in v0.0.2

func TokenDestroyAction(req *http.Request) (interface{}, error)

TokenDestroyAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func TokenDestroyActionProcess added in v0.0.2

func TokenDestroyActionProcess(req *http.Request, param *TokenNameParam) error

func TokenListAction added in v0.0.2

func TokenListAction(req *http.Request) (interface{}, error)

TokenListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func TokenOneAction added in v0.0.2

func TokenOneAction(req *http.Request) (interface{}, error)

TokenOneAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func UserCreateAction

func UserCreateAction(req *http.Request) (interface{}, error)

UserCreateAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func UserDeleteAction

func UserDeleteAction(req *http.Request) (interface{}, error)

UserDeleteAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func UserListAction

func UserListAction(req *http.Request) (interface{}, error)

UserListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func UserOneAction added in v0.0.2

func UserOneAction(req *http.Request) (interface{}, error)

UserOneAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func UserUpdateIsAdminAction added in v0.0.2

func UserUpdateIsAdminAction(req *http.Request) (interface{}, error)

UserUpdateIsAdminAction action Admin update other user's password

func UserUpdatePasswordAction

func UserUpdatePasswordAction(req *http.Request) (interface{}, error)

UserUpdatePasswordAction action Admin update other user's password

Types

type ProducctUserListParam added in v0.0.2

type ProducctUserListParam struct {
	Type *string `json:"type" form:"type" validate:"omitempty,oneof=jwt normal"`
}

ProducctUserListParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type ProductTokenListParam added in v0.0.2

type ProductTokenListParam struct {
	Product *ibasic.Product
}

type SessionKeyParam

type SessionKeyParam struct {
	SessionKey *string `json:"session_key" uri:"session_key" validate:"required,min=1"`
}

SessionKeyParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type TokenCreateData added in v0.0.2

type TokenCreateData struct {
	Token string `json:"token"`
}

type TokenCreateParam added in v0.0.2

type TokenCreateParam struct {
	Name        *string `json:"name" uri:"name" validate:"required,min=1"`
	Scope       *string `json:"scope" validate:"oneof=System Product Support"`
	ProductName *string `json:"product_name" validate:""`
}

type TokenData added in v0.0.2

type TokenData struct {
	Name        string `json:"name"`
	ProductName string `json:"product_name,omitempty"`
	Token       string `json:"token,omitempty"`
	Scope       string `json:"scope"`
}

type TokenNameParam added in v0.0.2

type TokenNameParam struct {
	TokenName *string `json:"token_name" uri:"token_name" validate:"required,min=1"`
}

TokenNameParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type UserCreateParam

type UserCreateParam struct {
	UserName *string `json:"user_name" uri:"user_name" validate:"required,min=1"`
	Password *string `json:"password" uri:"password"`
	IsAdmin  bool    `json:"is_admin" uri:"is_admin"`
	Type     string  `json:"type" uri:"password" validate:"required,oneof=jwt normal"`
}

UserCreateParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type UserData added in v0.0.2

type UserData struct {
	UserName string `json:"user_name,omitempty"`
	IsAdmin  bool   `json:"is_admin"`

	SessionKey string   `json:"session_key,omitempty"`
	Products   []string `json:"products,omitempty"`
}

UserData Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type UserNameParam

type UserNameParam struct {
	UserName *string `uri:"user_name" validate:"required,min=1"`
}

UserNameParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type UserNamePasswordParam

type UserNamePasswordParam struct {
	UserName *string `json:"user_name" uri:"user_name" validate:"required,min=1"`
	Password *string `json:"password" uri:"password" validate:"required,min=1"`
}

UserNamePasswordParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type UserUpdateIsAdminParam added in v0.0.2

type UserUpdateIsAdminParam struct {
	UserName *string `uri:"user_name" validate:"required,min=1"`
	IsAdmin  bool    `json:"is_admin"`
}

UserUpdateIsAdminParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

type UserUpdatePasswordParam

type UserUpdatePasswordParam struct {
	UserName    *string `uri:"user_name" validate:"required,min=1"`
	OldPassword string  `json:"old_password" validate:"omitempty"`
	Password    *string `json:"password" validate:"required,min=6"`
}

UserUpdatePasswordParam Request Param AUTO GEN BY ctrl, MODIFY AS U NEED

Jump to

Keyboard shortcuts

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