auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

InnerUserListRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var NavigationEndpoint = &xreq.Endpoint{
	Path:       "/meta",
	Method:     "GET",
	Handler:    xreq.Convert(NavigationProcess),
	Authorizer: nil,
}
View Source
var ProdcutUserCreateEndpoint = &xreq.Endpoint{
	Path:       "/auth/products/{product_name}/users/{user_name}",
	Method:     http.MethodPost,
	Handler:    xreq.Convert(ProdcutUserCreateAction),
	Authorizer: iauth.FA(iauth.FeatureProductUser, iauth.ActionCreate),
}

ProdcutUserCreateRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

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

ProdcutUserDeleteRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var ProdcutUserListEndpoint = &xreq.Endpoint{
	Path:       "/auth/products/{product_name}/users",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(ProdcutUserListAction),
	Authorizer: iauth.FA(iauth.FeatureProductUser, iauth.ActionReadAll),
}

ProdcutUserListRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var SessionKeyByInnerEndpoint = &xreq.Endpoint{
	Path:       "/auth/session-keys/inner",
	Method:     http.MethodPost,
	Handler:    xreq.Convert(SessionKeyByInnerAction),
	Authorizer: iauth.FA(iauth.FeatureUser, iauth.ActionCreate),
}

SessionKeyByInnerRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var SessionKeyByPasswordEndpoint = &xreq.Endpoint{
	Path:       "/auth/session-keys/password",
	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 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 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

View Source
var UserUpdateSelfPasswordEndpoint = &xreq.Endpoint{
	Path:       "/auth/passwd",
	Method:     http.MethodPatch,
	Handler:    xreq.Convert(UserUpdateSelfPasswordAction),
	Authorizer: nil,
}

UserUpdateSelfPasswordRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

Functions

func InnerUserListAction

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

InnerUserListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

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

func ProdcutUserCreateAction

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

ProdcutUserCreateAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func ProdcutUserDeleteAction

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

ProdcutUserDeleteAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func ProdcutUserListAction

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

ProdcutUserListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func SessionKeyByInnerAction

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

SessionKeyByInnerAction 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 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 UserUpdatePasswordAction

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

UserUpdatePasswordAction action Admin update other user's password

func UserUpdateSelfPasswordAction

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

UserUpdateSelfPasswordAction action anyone can modify self password

Types

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 UserCreateParam

type UserCreateParam struct {
	UserName *string  `json:"user_name" uri:"user_name" validate:"required,min=1"`
	Password *string  `json:"password" uri:"password" validate:"required,min=6"`
	Roles    []string `json:"roles" uri:"roles" validate:"min=1"`
}

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

type UserIdentifyData

type UserIdentifyData struct {
	UserName   string   `json:"user_name,omitempty" uri:"user_name"`
	SessionKey string   `json:"session_key,omitempty" uri:"session_key"`
	Roles      []string `json:"roles,omitempty" uri:"roles"`
}

UserIdentifyData 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 UserUpdatePasswordParam

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

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

type UserUpdateSelfPasswordParam

type UserUpdateSelfPasswordParam struct {
	OldPassword *string `json:"old_password" validate:"required,min=6"`
	Password    *string `json:"password" validate:"required,min=6"`
}

UserUpdateSelfPasswordParam 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