Documentation ¶
Index ¶
- func ACLAllow(method, uri string, roleIDs []string, apiDef *openapi3.T) bool
- func AddRoleForUser(userID, roleID string) bool
- func CountAdminUser(ctx context.Context) int
- func CreateAuditLog(ctx context.Context, audit *AuditLog) error
- func CreatePermissionsForRole(roleID string, permissions []*AdminRolePermission) *errors.VironError
- func CreateViewerRole(apiDef *openapi3.T) error
- func GetOas(apiDef *openapi3.T, roleIDs []string) *openapi3.T
- func ListResourcesByOas(apiDef *openapi3.T) []string
- func NewFile(filePath string) error
- func NewMongo(opt *options.ClientOptions, dbName string, collectionName string) error
- func NewMySQL(conn *sql.DB) error
- func RemoveAdminRoleOne(roleID string) *errors.VironError
- func RemoveAdminUserById(ctx context.Context, id string) *errors.VironError
- func RevokePermissionForRole(roleID, resourceID string, permissions []string) bool
- func RevokeRoleForUser(userID, roleID string) bool
- func SetLoadPolicyInterval(sec int64)
- func UpdateAccountByID(ctx context.Context, userID string, payload *AdminAccount) error
- func UpdateAdminRoleByID(roleID string, permissions []*AdminRolePermission) *errors.VironError
- func UpdateAdminUserByID(ctx context.Context, id string, payload *AdminUser) *errors.VironError
- func UpdatePermissionsForRole(roleID string, permissions []*AdminRolePermission) *errors.VironError
- func ValidateRoleAndPermissions(roleID string, permissions []*AdminRolePermission) *errors.VironError
- type Action
- type AdminAccount
- type AdminAccountsWithPager
- type AdminRole
- type AdminRolePermission
- type AdminRolesWithPager
- type AdminUser
- type AdminUserConditions
- type AdminUsersWithPager
- type AuditLog
- type AuditLogsWithPager
- type AuthConfig
- type Content
- type Pager
- type Permission
- type XPage
- type XPages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountAdminUser ¶
CountAdminUser adminUserレコード数をカウント
func CreatePermissionsForRole ¶
func CreatePermissionsForRole(roleID string, permissions []*AdminRolePermission) *errors.VironError
CreatePermissionsForRole ロールの権限を作成する
func CreateViewerRole ¶
CreateViewerRole viewerロールを作成
func ListResourcesByOas ¶
ListResourcesByOas resource一覧
func NewMongo ¶
func NewMongo(opt *options.ClientOptions, dbName string, collectionName string) error
func RemoveAdminRoleOne ¶
func RemoveAdminRoleOne(roleID string) *errors.VironError
RemoveAdminRoleOne IDで1件削除
func RemoveAdminUserById ¶
func RemoveAdminUserById(ctx context.Context, id string) *errors.VironError
func RevokePermissionForRole ¶
RevekePermissionForRole ロールから権限を剥奪する
func RevokeRoleForUser ¶
RevekeRoleForUser ユーザーからロールを剥奪する
func SetLoadPolicyInterval ¶
func SetLoadPolicyInterval(sec int64)
func UpdateAccountByID ¶
func UpdateAccountByID(ctx context.Context, userID string, payload *AdminAccount) error
UpdateAccountByID IDで1件更新
func UpdateAdminRoleByID ¶
func UpdateAdminRoleByID(roleID string, permissions []*AdminRolePermission) *errors.VironError
UpdateAdminRoleByID IDで1件更新
func UpdateAdminUserByID ¶
UpdateAdminUserByID IDで1件更新
func UpdatePermissionsForRole ¶
func UpdatePermissionsForRole(roleID string, permissions []*AdminRolePermission) *errors.VironError
UpdatePermissionsForRole ロールの権限を更新する
func ValidateRoleAndPermissions ¶
func ValidateRoleAndPermissions(roleID string, permissions []*AdminRolePermission) *errors.VironError
Types ¶
type AdminAccount ¶
type AdminAccountsWithPager ¶
type AdminAccountsWithPager struct { Pager List []*AdminAccount `json:"list"` }
func ListAccountByID ¶
func ListAccountByID(ctx context.Context, userID string) *AdminAccountsWithPager
ListAccountByID 一覧取得(idを指定するので結果は必ず1件)
type AdminRole ¶
type AdminRole struct { ID string `json:"id"` Permissions []*AdminRolePermission `json:"permissions,omitempty"` }
func CreateAdminRoleOne ¶
func CreateAdminRoleOne(role *AdminRole) (*AdminRole, *errors.VironError)
CreateAdminRoleOne 1件作成
type AdminRolePermission ¶
type AdminRolesWithPager ¶
type AdminUser ¶
type AdminUser struct { ID string `json:"id"` Email string `json:"email"` AuthType string `json:"authType"` Password *string `json:"password,omitempty"` Salt *string `json:"salt,omitempty"` GoogleOAuth2AccessToken *string `json:"googleOAuth2AccessToken,omitempty"` GoogleOAuth2ExpiryDate *uint64 `json:"googleOAuth2ExpiryDate,omitempty"` GoogleOAuth2IdToken *string `json:"googleOAuth2IdToken,omitempty"` GoogleOAuth2RefreshToken *string `json:"googleOAuth2RefreshToken,omitempty"` GoogleOAuth2TokenType *string `json:"googleOAuth2TokenType,omitempty"` RoleIDs []string `json:"roleIds"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func CreateAdminUser ¶
func CreateAdminUser(ctx context.Context, payload *AdminUser, authType string) (*AdminUser, *errors.VironError)
CreateAdminUser adminUser insert
func FindByEmail ¶
FindByEmail emailで1件取得
type AdminUserConditions ¶
type AdminUsersWithPager ¶
func ListAdminUser ¶
func ListAdminUser(ctx context.Context, opts *AdminUserConditions) (*AdminUsersWithPager, error)
ListAdminUser 一覧取得
type AuditLog ¶
type AuditLog struct { ID string `json:"id"` RequestMethod *string `json:"requestMethod,omitempty"` RequestUri *string `json:"requestUri,omitempty"` SourceIp *string `json:"sourceIp,omitempty"` UserId *string `json:"userId,omitempty"` RequestBody *string `json:"requestBody,omitempty"` StatusCode *int `json:"statusCode,omitempty"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type AuditLogsWithPager ¶
func ListAuditLog ¶
type AuthConfig ¶
type AuthConfig struct { Provider string `json:"provider"` AuthConfigType string `json:"type"` OperationID string `json:"operationId"` DefaultParametersValue interface{} `json:"defaultParametersValue,omitempty"` DefaultRequestBodyValue interface{} `json:"defaultRequestBodyValue,omitempty"` }
func GenAuthConfig ¶
type Pager ¶
type Pager struct { CurrentPage int `json:"currentPage"` MaxPage int `json:"maxPage"` Start *int `json:"-"` End *int `json:"-"` }
Pager is common pager struct for viron
type Permission ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.