Documentation ¶
Index ¶
- Constants
- func AddResToRoleIfNotExist(ec miso.Rail, req AddRoleResReq, user common.User) error
- func AddRole(ec miso.Rail, req AddRoleReq, user common.User) error
- func AddUser(rail miso.Rail, tx *gorm.DB, req AddUserParam, operator string) error
- func AdminUpdateUser(rail miso.Rail, tx *gorm.DB, req AdminUpdateUserReq, operator common.User) error
- func BindPathRes(rail miso.Rail, req BindPathResReq) error
- func BootstrapServer(args []string)
- func CreateMonitoredServiceWatch(rail miso.Rail, m MonitoredService) error
- func CreateMonitoredServiceWatches(rail miso.Rail) error
- func CreatePathIfNotExist(rail miso.Rail, req CreatePathReq, user common.User) error
- func CreateResourceIfNotExist(rail miso.Rail, req CreateResReq, user common.User) error
- func DecodeTokenUsername(rail miso.Rail, token string) (string, error)
- func DeletePath(ec miso.Rail, req DeletePathReq) error
- func DeleteResource(ec miso.Rail, req DeleteResourceReq) error
- func DeleteUserKey(rail miso.Rail, tx *gorm.DB, req DeleteUserKeyReq, userId int) error
- func ExchangeToken(rail miso.Rail, tx *gorm.DB, req ExchangeTokenReq) (string, error)
- func GenUserKey(rail miso.Rail, tx *gorm.DB, req GenUserKeyReq, username string) error
- func InvalidateUserInfoCache(rail miso.Rail, username string) error
- func ItnFindNameOfUserNo(rail miso.Rail, tx *gorm.DB, req api.FetchNameByUserNoReq) (api.FetchUsernamesRes, error)
- func ItnFindUserInfo(rail miso.Rail, tx *gorm.DB, req api.FindUserReq) (api.UserInfo, error)
- func ItnFindUsersWithRole(rail miso.Rail, db *gorm.DB, req api.FetchUsersWithRoleReq) ([]api.UserInfo, error)
- func ListAccessLogs(rail miso.Rail, tx *gorm.DB, user common.User, req ListAccessLogReq) (miso.PageRes[ListedAccessLog], error)
- func ListUserKeys(rail miso.Rail, tx *gorm.DB, req ListUserKeysReq, user common.User) (miso.PageRes[ListedUserKey], error)
- func ListUsers(rail miso.Rail, tx *gorm.DB, req ListUserReq) (miso.PageRes[api.UserInfo], error)
- func LoadPathResCache(rail miso.Rail) error
- func LoadResCodeCache(rail miso.Rail) error
- func LoadRoleResCache(ec miso.Rail) error
- func QueryResourcePathAsync(rail miso.Rail, server miso.Server, m MonitoredService)
- func RegisterInternalPathResourcesOnBootstrapped()
- func RegisterRoutes(rail miso.Rail) error
- func RemoteAddr(forwardedFor string) string
- func RemoveResFromRole(ec miso.Rail, req RemoveRoleResReq) error
- func ReviewUserRegistration(rail miso.Rail, tx *gorm.DB, req AdminReviewUserReq) error
- func SaveAccessLogEvent(rail miso.Rail, tx *gorm.DB, evt AccessLogEvent) error
- func ScheduleTasks(rail miso.Rail) error
- func SubEventBus(rail miso.Rail) error
- func TriggerResourcePathCollection(rail miso.Rail, m MonitoredService)
- func UnbindPathRes(ec miso.Rail, req UnbindPathResReq) error
- func UpdatePassword(rail miso.Rail, tx *gorm.DB, username string, req UpdatePasswordReq) error
- func UpdatePath(ec miso.Rail, req UpdatePathReq) error
- func UserRegister(rail miso.Rail, tx *gorm.DB, req RegisterReq) error
- type AccessLog
- type AccessLogEvent
- type AddRoleReq
- type AddRoleResReq
- type AddUserParam
- type AdminAddUserReq
- type AdminReviewUserReq
- type AdminUpdateUserReq
- type BindPathResReq
- type CachedUrlRes
- type CreatePathReq
- type CreateResReq
- type DeletePathReq
- type DeleteResourceReq
- type DeleteUserKeyReq
- type EPath
- type ERes
- type ERole
- type ERoleRes
- type ExchangeTokenReq
- type ExtendedPathRes
- type GenResScriptReq
- type GenUserKeyReq
- type ListAccessLogReq
- type ListPathReq
- type ListPathResp
- type ListResReq
- type ListResResp
- type ListRoleReq
- type ListRoleResReq
- type ListRoleResResp
- type ListRoleResp
- type ListUserKeysReq
- type ListUserReq
- type ListedAccessLog
- type ListedRoleRes
- type ListedUserKey
- type LoginReq
- type MonitorConf
- type MonitoredService
- type NewUserKey
- type PasswordLoginParam
- type PathRes
- type PathType
- type QueryResourcePathRes
- type RegisterReq
- type RemoveRoleResReq
- type ResBrief
- type RoleBrief
- type RoleInfoReq
- type RoleInfoResp
- type TestResAccessReq
- type TestResAccessResp
- type TokenUser
- type UnbindPathResReq
- type UpdatePasswordReq
- type UpdatePathReq
- type User
- type UserDetail
- type UserInfoBrief
- type WPath
- type WRes
- type WRole
Constants ¶
View Source
const ( ResourceManagerUser = "manage-users" ResourceBasicUser = "basic-user" ResourceManageResources = "manage-resources" )
View Source
const (
DefaultMonitorPath = "/auth/resource"
)
View Source
const (
ErrCodeRoleNotFound = "GA0001"
)
Variables ¶
This section is empty.
Functions ¶
func AddResToRoleIfNotExist ¶ added in v0.0.16
func AdminUpdateUser ¶
func BindPathRes ¶ added in v0.0.16
func BindPathRes(rail miso.Rail, req BindPathResReq) error
func BootstrapServer ¶
func BootstrapServer(args []string)
func CreateMonitoredServiceWatch ¶ added in v0.0.16
func CreateMonitoredServiceWatch(rail miso.Rail, m MonitoredService) error
func CreateMonitoredServiceWatches ¶ added in v0.0.16
func CreatePathIfNotExist ¶ added in v0.0.16
func CreateResourceIfNotExist ¶ added in v0.0.16
func DeletePath ¶ added in v0.0.16
func DeletePath(ec miso.Rail, req DeletePathReq) error
func DeleteResource ¶ added in v0.0.16
func DeleteResource(ec miso.Rail, req DeleteResourceReq) error
func DeleteUserKey ¶
func ExchangeToken ¶
func GenUserKey ¶
func ItnFindNameOfUserNo ¶
func ItnFindNameOfUserNo(rail miso.Rail, tx *gorm.DB, req api.FetchNameByUserNoReq) (api.FetchUsernamesRes, error)
func ItnFindUserInfo ¶
func ItnFindUsersWithRole ¶ added in v0.0.15
func ListAccessLogs ¶
func ListUserKeys ¶
func LoadPathResCache ¶ added in v0.0.16
Load cache for path -> resource
func LoadResCodeCache ¶ added in v0.0.16
Load cache for resource code
func LoadRoleResCache ¶ added in v0.0.16
Load cache for role -> resources
func QueryResourcePathAsync ¶ added in v0.0.16
func QueryResourcePathAsync(rail miso.Rail, server miso.Server, m MonitoredService)
func RegisterInternalPathResourcesOnBootstrapped ¶ added in v0.0.16
func RegisterInternalPathResourcesOnBootstrapped()
func RegisterRoutes ¶ added in v0.0.16
func RemoteAddr ¶
func RemoveResFromRole ¶ added in v0.0.16
func RemoveResFromRole(ec miso.Rail, req RemoveRoleResReq) error
func ReviewUserRegistration ¶
func SaveAccessLogEvent ¶
func ScheduleTasks ¶ added in v0.0.16
func SubEventBus ¶ added in v0.0.16
func TriggerResourcePathCollection ¶ added in v0.0.16
func TriggerResourcePathCollection(rail miso.Rail, m MonitoredService)
func UnbindPathRes ¶ added in v0.0.16
func UnbindPathRes(ec miso.Rail, req UnbindPathResReq) error
func UpdatePassword ¶
func UpdatePath ¶ added in v0.0.16
func UpdatePath(ec miso.Rail, req UpdatePathReq) error
func UserRegister ¶
Types ¶
type AccessLogEvent ¶
type AddRoleReq ¶ added in v0.0.16
type AddRoleReq struct {
Name string `json:"name" validation:"notEmpty,maxLen:32"` // role name
}
type AddRoleResReq ¶ added in v0.0.16
type AddUserParam ¶
type AdminAddUserReq ¶
type AdminReviewUserReq ¶
type AdminUpdateUserReq ¶
type BindPathResReq ¶ added in v0.0.16
type CachedUrlRes ¶ added in v0.0.16
type CreatePathReq ¶ added in v0.0.16
type CreatePathReq struct { Type PathType `json:"type" validation:"notEmpty"` Url string `json:"url" validation:"notEmpty,maxLen:128"` Group string `json:"group" validation:"notEmpty,maxLen:20"` Method string `json:"method" validation:"notEmpty,maxLen:10"` Desc string `json:"desc" validation:"maxLen:255"` ResCode string `json:"resCode"` }
type CreateResReq ¶ added in v0.0.16
type DeletePathReq ¶ added in v0.0.16
type DeletePathReq struct {
PathNo string `json:"pathNo" validation:"notEmpty"`
}
type DeleteResourceReq ¶ added in v0.0.16
type DeleteResourceReq struct {
ResCode string `json:"resCode" validation:"notEmpty"`
}
type DeleteUserKeyReq ¶
type DeleteUserKeyReq struct {
UserKeyId int `json:"userKeyId"`
}
type ExchangeTokenReq ¶
type ExchangeTokenReq struct {
Token string `json:"token" valid:"notEmpty"`
}
type ExtendedPathRes ¶ added in v0.0.16
type ExtendedPathRes struct { Id int // id Pgroup string // path group PathNo string // path no ResCode string // resource code Desc string // description Url string // url Method string // http method Ptype PathType // path type: PROTECTED, PUBLIC CreateTime miso.ETime CreateBy string UpdateTime miso.ETime UpdateBy string }
type GenResScriptReq ¶ added in v0.0.16
type GenResScriptReq struct {
ResCodes []string `json:"resCodes" validation:"notEmpty"`
}
type GenUserKeyReq ¶
type ListAccessLogReq ¶
type ListPathReq ¶ added in v0.0.16
type ListPathResp ¶ added in v0.0.16
func ListPaths ¶ added in v0.0.16
func ListPaths(ec miso.Rail, req ListPathReq) (ListPathResp, error)
type ListResReq ¶ added in v0.0.16
type ListResResp ¶ added in v0.0.16
func ListResources ¶ added in v0.0.16
func ListResources(ec miso.Rail, req ListResReq) (ListResResp, error)
type ListRoleReq ¶ added in v0.0.16
type ListRoleResReq ¶ added in v0.0.16
type ListRoleResResp ¶ added in v0.0.16
type ListRoleResResp struct { Paging miso.Paging `json:"pagingVo"` Payload []ListedRoleRes `json:"payload"` }
func ListRoleRes ¶ added in v0.0.16
func ListRoleRes(ec miso.Rail, req ListRoleResReq) (ListRoleResResp, error)
type ListRoleResp ¶ added in v0.0.16
func ListRoles ¶ added in v0.0.16
func ListRoles(ec miso.Rail, req ListRoleReq) (ListRoleResp, error)
type ListUserKeysReq ¶
type ListUserReq ¶
type ListedAccessLog ¶
type ListedRoleRes ¶ added in v0.0.16
type ListedUserKey ¶
type MonitorConf ¶ added in v0.0.16
type MonitorConf struct {
Monitor []MonitoredService
}
type MonitoredService ¶ added in v0.0.16
func LoadMonitoredServices ¶ added in v0.0.16
func LoadMonitoredServices() []MonitoredService
type NewUserKey ¶
type PasswordLoginParam ¶
type QueryResourcePathRes ¶ added in v0.0.16
type QueryResourcePathRes struct { Resources []CreateResReq Paths []CreatePathReq }
func QueryResourcePath ¶ added in v0.0.16
type RegisterReq ¶
type RemoveRoleResReq ¶ added in v0.0.16
type ResBrief ¶ added in v0.0.16
func ListAllResBriefsOfRole ¶ added in v0.0.16
type RoleInfoReq ¶ added in v0.0.14
type RoleInfoReq struct {
RoleNo string `json:"roleNo" validation:"notEmpty"`
}
type RoleInfoResp ¶ added in v0.0.14
func GetRoleInfo ¶ added in v0.0.14
func GetRoleInfo(ec miso.Rail, req RoleInfoReq) (RoleInfoResp, error)
type TestResAccessReq ¶ added in v0.0.16
type TestResAccessResp ¶ added in v0.0.16
type TestResAccessResp struct {
Valid bool `json:"valid"`
}
func TestResourceAccess ¶ added in v0.0.16
func TestResourceAccess(ec miso.Rail, req TestResAccessReq) (TestResAccessResp, error)
Test access to resource
type UnbindPathResReq ¶ added in v0.0.16
type UpdatePasswordReq ¶
type UpdatePathReq ¶ added in v0.0.16
type User ¶
type User struct { Id int UserNo string Username string Password string Salt string ReviewStatus string RoleNo string RoleName string IsDisabled int CreateTime miso.ETime CreateBy string UpdateTime miso.ETime UpdateBy string IsDel common.IS_DEL }
type UserDetail ¶
type UserDetail struct { Id int `json:"id"` Username string `json:"username"` RoleName string `json:"roleName"` RoleNo string `json:"roleNo"` UserNo string `json:"userNo"` RegisterDate string `json:"registerDate"` Password string `json:"password"` Salt string `json:"salt"` }
func LoadUserBriefThrCache ¶
func LoadUserInfoBrief ¶
type UserInfoBrief ¶
type UserInfoBrief struct { Id int `json:"id"` Username string `json:"username"` RoleName string `json:"roleName"` RoleNo string `json:"roleNo"` UserNo string `json:"userNo"` RegisterDate string `json:"registerDate"` }
func FetchUserBrief ¶
func GetTokenUser ¶
type WPath ¶ added in v0.0.16
type WPath struct { Id int `json:"id"` Pgroup string `json:"pgroup"` PathNo string `json:"pathNo"` Method string `json:"method"` Desc string `json:"desc"` Url string `json:"url"` Ptype PathType `json:"ptype"` CreateTime miso.ETime `json:"createTime"` CreateBy string `json:"createBy"` UpdateTime miso.ETime `json:"updateTime"` UpdateBy string `json:"updateBy"` }
Click to show internal directories.
Click to hide internal directories.