Documentation ¶
Overview ¶
@description: user crud
@description: user authentication and authorization
@description: user crud
Index ¶
- type ClusterRolePolicyDetails
- type DefaultAuthPolicy
- type DefaultAuthPolicyRepository
- type DefaultAuthPolicyRepositoryImpl
- func (impl DefaultAuthPolicyRepositoryImpl) CreatePolicy(policy *DefaultAuthPolicy) (*DefaultAuthPolicy, error)
- func (impl DefaultAuthPolicyRepositoryImpl) GetPolicyByRoleTypeAndEntity(roleType bean.RoleType, accessType string, entity string) (policy string, err error)
- func (impl DefaultAuthPolicyRepositoryImpl) UpdatePolicyByRoleType(policy string, roleType bean.RoleType) (*DefaultAuthPolicy, error)
- type DefaultAuthRole
- type DefaultAuthRoleRepository
- type DefaultAuthRoleRepositoryImpl
- func (impl DefaultAuthRoleRepositoryImpl) CreateRole(role *DefaultAuthRole) (*DefaultAuthRole, error)
- func (impl DefaultAuthRoleRepositoryImpl) GetRoleByRoleTypeAndEntityType(roleType bean.RoleType, accessType string, entity string) (role string, err error)
- func (impl DefaultAuthRoleRepositoryImpl) UpdateRole(role *DefaultAuthRole) (*DefaultAuthRole, error)
- type PValDetailObj
- type PValUpdateKey
- type PolicyCacheDetailObj
- type RbacDataCacheFactory
- type RbacDataCacheFactoryImpl
- type RbacPolicyData
- type RbacPolicyDataRepository
- type RbacPolicyDataRepositoryImpl
- func (repo *RbacPolicyDataRepositoryImpl) CreateNewPolicyDataForRoleWithTxn(model *RbacPolicyData, tx *pg.Tx) (*RbacPolicyData, error)
- func (repo *RbacPolicyDataRepositoryImpl) GetPolicyDataForAllRoles() ([]*RbacPolicyData, error)
- func (repo *RbacPolicyDataRepositoryImpl) UpdatePolicyDataForRoleWithTxn(model *RbacPolicyData, tx *pg.Tx) (*RbacPolicyData, error)
- type RbacRoleData
- type RbacRoleDataRepository
- type RbacRoleDataRepositoryImpl
- func (repo *RbacRoleDataRepositoryImpl) CreateNewRoleDataForRoleWithTxn(model *RbacRoleData, tx *pg.Tx) (*RbacRoleData, error)
- func (repo *RbacRoleDataRepositoryImpl) GetRoleDataForAllRoles() ([]*RbacRoleData, error)
- func (repo *RbacRoleDataRepositoryImpl) UpdateRoleDataForRoleWithTxn(model *RbacRoleData, tx *pg.Tx) (*RbacRoleData, error)
- type ResActObj
- type RoleCacheDetailObj
- type RoleGroup
- type RoleGroupRepository
- type RoleGroupRepositoryImpl
- func (impl RoleGroupRepositoryImpl) CreateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) CreateRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (*RoleGroupRoleMapping, error)
- func (impl RoleGroupRepositoryImpl) DeleteRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (bool, error)
- func (impl RoleGroupRepositoryImpl) DeleteRoleGroupRoleMappingByRoleId(roleId int, tx *pg.Tx) error
- func (impl RoleGroupRepositoryImpl) GetAllRoleGroup() ([]*RoleGroup, error)
- func (impl *RoleGroupRepositoryImpl) GetConnection() (dbConnection *pg.DB)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupById(id int32) (*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupByName(name string) (*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupListByCasbinNames(names []string) ([]*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupListByName(name string) ([]*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupListByNames(groupNames []string) ([]*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMapping(userRoleModelId int32) (*RoleGroupRoleMapping, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupId(roleGroupId int32) ([]*RoleGroupRoleMapping, error)
- func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupIds(roleGroupIds []int32) ([]*RoleModel, error)
- func (impl RoleGroupRepositoryImpl) GetRolesByGroupCasbinName(groupName string) ([]*RoleModel, error)
- func (impl RoleGroupRepositoryImpl) GetRolesByGroupNames(groupNames []string) ([]*RoleModel, error)
- func (impl RoleGroupRepositoryImpl) GetRolesByGroupNamesAndEntity(groupNames []string, entity string) ([]*RoleModel, error)
- func (impl RoleGroupRepositoryImpl) UpdateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error)
- func (impl RoleGroupRepositoryImpl) UpdateRoleGroupIdForRoleGroupMappings(roleId int, newRoleId int) (*RoleGroupRoleMapping, error)
- type RoleGroupRoleMapping
- type RoleModel
- type RolePolicyDetails
- type SelfRegistrationRoles
- type SelfRegistrationRolesRepository
- type SelfRegistrationRolesRepositoryImpl
- type UserAudit
- type UserAuditRepository
- type UserAuditRepositoryImpl
- type UserAuthRepository
- type UserAuthRepositoryImpl
- func (impl UserAuthRepositoryImpl) CreateDefaultPoliciesForAllTypes(...) (bool, error, []casbin2.Policy)
- func (impl UserAuthRepositoryImpl) CreateRole(role *RoleModel) (*RoleModel, error)
- func (impl UserAuthRepositoryImpl) CreateRoleForSuperAdminIfNotExists(tx *pg.Tx, UserId int32) (bool, error)
- func (impl UserAuthRepositoryImpl) CreateRoleWithTxn(userModel *RoleModel, tx *pg.Tx) (*RoleModel, error)
- func (impl UserAuthRepositoryImpl) CreateRolesWithAccessTypeAndEntity(...) (bool, error)
- func (impl UserAuthRepositoryImpl) CreateUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (*UserRoleModel, error)
- func (impl UserAuthRepositoryImpl) DeleteRole(role *RoleModel, tx *pg.Tx) error
- func (impl UserAuthRepositoryImpl) DeleteUserRoleByRoleId(roleId int, tx *pg.Tx) error
- func (impl UserAuthRepositoryImpl) DeleteUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (bool, error)
- func (impl UserAuthRepositoryImpl) GetAllRole() ([]RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetDefaultPolicyByRoleType(roleType bean2.RoleType) (policy string, err error)
- func (impl UserAuthRepositoryImpl) GetDiffBetweenPolicies(oldPolicy string, newPolicy string) (addedPolicies []casbin2.Policy, deletedPolicies []casbin2.Policy, err error)
- func (impl UserAuthRepositoryImpl) GetRole(role string) (*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRoleByFilterForAllTypes(...) (RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRoleById(id int) (*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRoleByRoles(roles []string) ([]RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesByActionAndAccessType(action string, accessType string) ([]RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesByGroupId(roleGroupId int32) ([]*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesByIds(ids []int) ([]RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesByUserId(userId int32) ([]RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesByUserIdAndEntityType(userId int32, entityType string) ([]*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesForApp(appName string) ([]*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesForChartGroup(chartGroupName string) ([]*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesForEnvironment(envName, envIdentifier string) ([]*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetRolesForProject(teamName string) ([]*RoleModel, error)
- func (impl UserAuthRepositoryImpl) GetUpdatedAddedOrDeletedPolicies(policies []casbin2.Policy, rolePolicyDetails RolePolicyDetails) (bean.PolicyRequest, error)
- func (impl UserAuthRepositoryImpl) GetUserRoleMappingByUserId(userId int32) ([]*UserRoleModel, error)
- func (impl UserAuthRepositoryImpl) SyncOrchestratorToCasbin(team string, entityName string, env string, tx *pg.Tx) (bool, error)
- func (impl UserAuthRepositoryImpl) UpdateDefaultPolicyByRoleType(newPolicy string, roleType bean2.RoleType) (err error)
- func (impl UserAuthRepositoryImpl) UpdateTriggerPolicyForTerminalAccess() (err error)
- type UserModel
- type UserRepository
- type UserRepositoryImpl
- func (impl UserRepositoryImpl) CreateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
- func (impl UserRepositoryImpl) FetchActiveOrDeletedUserByEmail(email string) (*UserModel, error)
- func (impl UserRepositoryImpl) FetchActiveUserByEmail(email string) (bean.UserInfo, error)
- func (impl UserRepositoryImpl) FetchUserDetailByEmail(email string) (bean.UserInfo, error)
- func (impl UserRepositoryImpl) FetchUserMatchesByEmailIdExcludingApiTokenUser(email string) ([]UserModel, error)
- func (impl UserRepositoryImpl) GetAllExcludingApiTokenUser() ([]UserModel, error)
- func (impl UserRepositoryImpl) GetById(id int32) (*UserModel, error)
- func (impl UserRepositoryImpl) GetByIdIncludeDeleted(id int32) (*UserModel, error)
- func (impl UserRepositoryImpl) GetByIds(ids []int32) ([]UserModel, error)
- func (impl *UserRepositoryImpl) GetConnection() (dbConnection *pg.DB)
- func (impl UserRepositoryImpl) UpdateRoleIdForUserRolesMappings(roleId int, newRoleId int) (*UserRoleModel, error)
- func (impl UserRepositoryImpl) UpdateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error)
- type UserRoleModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterRolePolicyDetails ¶ added in v0.6.11
type DefaultAuthPolicy ¶ added in v0.3.15
type DefaultAuthPolicyRepository ¶ added in v0.3.15
type DefaultAuthPolicyRepository interface { CreatePolicy(policy *DefaultAuthPolicy) (*DefaultAuthPolicy, error) UpdatePolicyByRoleType(policy string, roleType bean.RoleType) (*DefaultAuthPolicy, error) GetPolicyByRoleTypeAndEntity(roleType bean.RoleType, accessType string, entity string) (policy string, err error) }
type DefaultAuthPolicyRepositoryImpl ¶ added in v0.3.15
type DefaultAuthPolicyRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewDefaultAuthPolicyRepositoryImpl ¶ added in v0.3.15
func NewDefaultAuthPolicyRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *DefaultAuthPolicyRepositoryImpl
func (DefaultAuthPolicyRepositoryImpl) CreatePolicy ¶ added in v0.3.15
func (impl DefaultAuthPolicyRepositoryImpl) CreatePolicy(policy *DefaultAuthPolicy) (*DefaultAuthPolicy, error)
func (DefaultAuthPolicyRepositoryImpl) GetPolicyByRoleTypeAndEntity ¶ added in v0.6.16
func (DefaultAuthPolicyRepositoryImpl) UpdatePolicyByRoleType ¶ added in v0.3.15
func (impl DefaultAuthPolicyRepositoryImpl) UpdatePolicyByRoleType(policy string, roleType bean.RoleType) (*DefaultAuthPolicy, error)
type DefaultAuthRole ¶ added in v0.3.15
type DefaultAuthRoleRepository ¶ added in v0.3.15
type DefaultAuthRoleRepository interface { CreateRole(role *DefaultAuthRole) (*DefaultAuthRole, error) UpdateRole(role *DefaultAuthRole) (*DefaultAuthRole, error) GetRoleByRoleTypeAndEntityType(roleType bean.RoleType, accessType string, entity string) (role string, err error) }
type DefaultAuthRoleRepositoryImpl ¶ added in v0.3.15
type DefaultAuthRoleRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewDefaultAuthRoleRepositoryImpl ¶ added in v0.3.15
func NewDefaultAuthRoleRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *DefaultAuthRoleRepositoryImpl
func (DefaultAuthRoleRepositoryImpl) CreateRole ¶ added in v0.3.15
func (impl DefaultAuthRoleRepositoryImpl) CreateRole(role *DefaultAuthRole) (*DefaultAuthRole, error)
func (DefaultAuthRoleRepositoryImpl) GetRoleByRoleTypeAndEntityType ¶ added in v0.6.16
func (DefaultAuthRoleRepositoryImpl) UpdateRole ¶ added in v0.3.15
func (impl DefaultAuthRoleRepositoryImpl) UpdateRole(role *DefaultAuthRole) (*DefaultAuthRole, error)
type PValDetailObj ¶ added in v0.6.17
type PValDetailObj struct { Value string `json:"value"` IndexKeyMap map[int]PValUpdateKey `json:"indexKeyMap"` //map of index at which replacement is to be done and name of key that is to for updating value }
type PValUpdateKey ¶ added in v0.6.17
type PValUpdateKey string
const ( EntityPValUpdateKey PValUpdateKey = "Entity" EntityNamePValUpdateKey PValUpdateKey = "EntityName" AppPValUpdateKey PValUpdateKey = "App" EnvPValUpdateKey PValUpdateKey = "Env" TeamPValUpdateKey PValUpdateKey = "Team" ClusterPValUpdateKey PValUpdateKey = "Cluster" NamespacePValUpdateKey PValUpdateKey = "Namespace" GroupPValUpdateKey PValUpdateKey = "Group" KindPValUpdateKey PValUpdateKey = "Kind" ResourcePValUpdateKey PValUpdateKey = "Resource" AppObjPValUpdateKey PValUpdateKey = "AppObj" EnvObjPValUpdateKey PValUpdateKey = "EnvObj" TeamObjPValUpdateKey PValUpdateKey = "TeamObj" ClusterObjPValUpdateKey PValUpdateKey = "ClusterObj" NamespaceObjPValUpdateKey PValUpdateKey = "NamespaceObj" GroupObjPValUpdateKey PValUpdateKey = "GroupObj" KindObjPValUpdateKey PValUpdateKey = "KindObj" ResourceObjPValUpdateKey PValUpdateKey = "ResourceObj" )
type PolicyCacheDetailObj ¶ added in v0.6.17
type PolicyCacheDetailObj struct { Type PValDetailObj `json:"type"` Sub PValDetailObj `json:"sub"` ResActObjSet []ResActObj `json:"resActObjSet"` }
type RbacDataCacheFactory ¶ added in v0.6.17
type RbacDataCacheFactory interface { GetDefaultRoleDataAndPolicyByEntityAccessTypeAndRoleType(entity, accessType, roleType string) (RoleCacheDetailObj, PolicyCacheDetailObj, error) SyncPolicyCache() SyncRoleDataCache() }
type RbacDataCacheFactoryImpl ¶ added in v0.6.17
type RbacDataCacheFactoryImpl struct {
// contains filtered or unexported fields
}
func NewRbacDataCacheFactoryImpl ¶ added in v0.6.17
func NewRbacDataCacheFactoryImpl(logger *zap.SugaredLogger, defaultRbacPolicyDataRepository RbacPolicyDataRepository, defaultRbacRoleDataRepository RbacRoleDataRepository) *RbacDataCacheFactoryImpl
func (*RbacDataCacheFactoryImpl) GetDefaultRoleDataAndPolicyByEntityAccessTypeAndRoleType ¶ added in v0.6.17
func (impl *RbacDataCacheFactoryImpl) GetDefaultRoleDataAndPolicyByEntityAccessTypeAndRoleType(entity, accessType, roleType string) (RoleCacheDetailObj, PolicyCacheDetailObj, error)
func (*RbacDataCacheFactoryImpl) SyncPolicyCache ¶ added in v0.6.17
func (impl *RbacDataCacheFactoryImpl) SyncPolicyCache()
func (*RbacDataCacheFactoryImpl) SyncRoleDataCache ¶ added in v0.6.17
func (impl *RbacDataCacheFactoryImpl) SyncRoleDataCache()
type RbacPolicyData ¶ added in v0.6.17
type RbacPolicyData struct { TableName struct{} `sql:"rbac_policy_data" pg:",discard_unknown_columns"` Id int `sql:"id"` Entity string `sql:"entity"` AccessType string `sql:"access_type"` Role string `sql:"role"` PolicyData string `sql:"policy_data"` IsPresetRole bool `sql:"is_preset_role,notnull"` Deleted bool `sql:"deleted,notnull"` sql.AuditLog }
type RbacPolicyDataRepository ¶ added in v0.6.17
type RbacPolicyDataRepository interface { GetPolicyDataForAllRoles() ([]*RbacPolicyData, error) CreateNewPolicyDataForRoleWithTxn(model *RbacPolicyData, tx *pg.Tx) (*RbacPolicyData, error) UpdatePolicyDataForRoleWithTxn(model *RbacPolicyData, tx *pg.Tx) (*RbacPolicyData, error) }
type RbacPolicyDataRepositoryImpl ¶ added in v0.6.17
type RbacPolicyDataRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewRbacPolicyDataRepositoryImpl ¶ added in v0.6.17
func NewRbacPolicyDataRepositoryImpl(logger *zap.SugaredLogger, dbConnection *pg.DB) *RbacPolicyDataRepositoryImpl
func (*RbacPolicyDataRepositoryImpl) CreateNewPolicyDataForRoleWithTxn ¶ added in v0.6.17
func (repo *RbacPolicyDataRepositoryImpl) CreateNewPolicyDataForRoleWithTxn(model *RbacPolicyData, tx *pg.Tx) (*RbacPolicyData, error)
func (*RbacPolicyDataRepositoryImpl) GetPolicyDataForAllRoles ¶ added in v0.6.17
func (repo *RbacPolicyDataRepositoryImpl) GetPolicyDataForAllRoles() ([]*RbacPolicyData, error)
func (*RbacPolicyDataRepositoryImpl) UpdatePolicyDataForRoleWithTxn ¶ added in v0.6.17
func (repo *RbacPolicyDataRepositoryImpl) UpdatePolicyDataForRoleWithTxn(model *RbacPolicyData, tx *pg.Tx) (*RbacPolicyData, error)
type RbacRoleData ¶ added in v0.6.17
type RbacRoleData struct { TableName struct{} `sql:"rbac_role_data" pg:",discard_unknown_columns"` Id int `sql:"id"` Entity string `sql:"entity"` AccessType string `sql:"access_type"` Role string `sql:"role"` RoleData string `sql:"role_data"` RoleDisplayName string `sql:"role_display_name"` RoleDescription string `sql:"role_description"` IsPresetRole bool `sql:"is_preset_role,notnull"` Deleted bool `sql:"deleted,notnull"` sql.AuditLog }
type RbacRoleDataRepository ¶ added in v0.6.17
type RbacRoleDataRepository interface { GetRoleDataForAllRoles() ([]*RbacRoleData, error) CreateNewRoleDataForRoleWithTxn(model *RbacRoleData, tx *pg.Tx) (*RbacRoleData, error) UpdateRoleDataForRoleWithTxn(model *RbacRoleData, tx *pg.Tx) (*RbacRoleData, error) }
type RbacRoleDataRepositoryImpl ¶ added in v0.6.17
type RbacRoleDataRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewRbacRoleDataRepositoryImpl ¶ added in v0.6.17
func NewRbacRoleDataRepositoryImpl(logger *zap.SugaredLogger, dbConnection *pg.DB) *RbacRoleDataRepositoryImpl
func (*RbacRoleDataRepositoryImpl) CreateNewRoleDataForRoleWithTxn ¶ added in v0.6.17
func (repo *RbacRoleDataRepositoryImpl) CreateNewRoleDataForRoleWithTxn(model *RbacRoleData, tx *pg.Tx) (*RbacRoleData, error)
func (*RbacRoleDataRepositoryImpl) GetRoleDataForAllRoles ¶ added in v0.6.17
func (repo *RbacRoleDataRepositoryImpl) GetRoleDataForAllRoles() ([]*RbacRoleData, error)
func (*RbacRoleDataRepositoryImpl) UpdateRoleDataForRoleWithTxn ¶ added in v0.6.17
func (repo *RbacRoleDataRepositoryImpl) UpdateRoleDataForRoleWithTxn(model *RbacRoleData, tx *pg.Tx) (*RbacRoleData, error)
type ResActObj ¶ added in v0.6.17
type ResActObj struct { Res PValDetailObj `json:"res"` Act PValDetailObj `json:"act"` Obj PValDetailObj `json:"obj"` }
type RoleCacheDetailObj ¶ added in v0.6.17
type RoleCacheDetailObj struct { Role PValDetailObj `json:"role"` Entity PValDetailObj `json:"entity"` Team PValDetailObj `json:"team"` EntityName PValDetailObj `json:"entityName"` Environment PValDetailObj `json:"environment"` Action PValDetailObj `json:"action"` AccessType PValDetailObj `json:"accessType"` Cluster PValDetailObj `json:"cluster"` Namespace PValDetailObj `json:"namespace"` Group PValDetailObj `json:"group"` Kind PValDetailObj `json:"kind"` Resource PValDetailObj `json:"resource"` }
type RoleGroupRepository ¶
type RoleGroupRepository interface { CreateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error) UpdateRoleGroup(model *RoleGroup, tx *pg.Tx) (*RoleGroup, error) GetRoleGroupById(id int32) (*RoleGroup, error) GetRoleGroupByName(name string) (*RoleGroup, error) GetRoleGroupListByName(name string) ([]*RoleGroup, error) GetAllRoleGroup() ([]*RoleGroup, error) GetRoleGroupListByCasbinNames(name []string) ([]*RoleGroup, error) CreateRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (*RoleGroupRoleMapping, error) GetRoleGroupRoleMapping(model int32) (*RoleGroupRoleMapping, error) GetRoleGroupRoleMappingByRoleGroupId(roleGroupId int32) ([]*RoleGroupRoleMapping, error) DeleteRoleGroupRoleMappingByRoleId(roleId int, tx *pg.Tx) error DeleteRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (bool, error) GetConnection() (dbConnection *pg.DB) GetRoleGroupListByNames(groupNames []string) ([]*RoleGroup, error) GetRoleGroupRoleMappingByRoleGroupIds(roleGroupIds []int32) ([]*RoleModel, error) GetRolesByGroupCasbinName(groupName string) ([]*RoleModel, error) GetRolesByGroupNames(groupNames []string) ([]*RoleModel, error) GetRolesByGroupNamesAndEntity(groupNames []string, entity string) ([]*RoleModel, error) UpdateRoleGroupIdForRoleGroupMappings(roleId int, newRoleId int) (*RoleGroupRoleMapping, error) }
type RoleGroupRepositoryImpl ¶
type RoleGroupRepositoryImpl struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewRoleGroupRepositoryImpl ¶
func NewRoleGroupRepositoryImpl(dbConnection *pg.DB, Logger *zap.SugaredLogger) *RoleGroupRepositoryImpl
func (RoleGroupRepositoryImpl) CreateRoleGroup ¶
func (RoleGroupRepositoryImpl) CreateRoleGroupRoleMapping ¶
func (impl RoleGroupRepositoryImpl) CreateRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (*RoleGroupRoleMapping, error)
func (RoleGroupRepositoryImpl) DeleteRoleGroupRoleMapping ¶
func (impl RoleGroupRepositoryImpl) DeleteRoleGroupRoleMapping(model *RoleGroupRoleMapping, tx *pg.Tx) (bool, error)
func (RoleGroupRepositoryImpl) DeleteRoleGroupRoleMappingByRoleId ¶ added in v0.3.16
func (impl RoleGroupRepositoryImpl) DeleteRoleGroupRoleMappingByRoleId(roleId int, tx *pg.Tx) error
func (RoleGroupRepositoryImpl) GetAllRoleGroup ¶
func (impl RoleGroupRepositoryImpl) GetAllRoleGroup() ([]*RoleGroup, error)
func (*RoleGroupRepositoryImpl) GetConnection ¶
func (impl *RoleGroupRepositoryImpl) GetConnection() (dbConnection *pg.DB)
func (RoleGroupRepositoryImpl) GetRoleGroupById ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupById(id int32) (*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupByName ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupByName(name string) (*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupListByCasbinNames ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupListByCasbinNames(names []string) ([]*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupListByName ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupListByName(name string) ([]*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupListByNames ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupListByNames(groupNames []string) ([]*RoleGroup, error)
func (RoleGroupRepositoryImpl) GetRoleGroupRoleMapping ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMapping(userRoleModelId int32) (*RoleGroupRoleMapping, error)
func (RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupId ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupId(roleGroupId int32) ([]*RoleGroupRoleMapping, error)
func (RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupIds ¶
func (impl RoleGroupRepositoryImpl) GetRoleGroupRoleMappingByRoleGroupIds(roleGroupIds []int32) ([]*RoleModel, error)
func (RoleGroupRepositoryImpl) GetRolesByGroupCasbinName ¶ added in v0.4.28
func (impl RoleGroupRepositoryImpl) GetRolesByGroupCasbinName(groupName string) ([]*RoleModel, error)
func (RoleGroupRepositoryImpl) GetRolesByGroupNames ¶ added in v0.6.0
func (impl RoleGroupRepositoryImpl) GetRolesByGroupNames(groupNames []string) ([]*RoleModel, error)
func (RoleGroupRepositoryImpl) GetRolesByGroupNamesAndEntity ¶ added in v0.6.11
func (impl RoleGroupRepositoryImpl) GetRolesByGroupNamesAndEntity(groupNames []string, entity string) ([]*RoleModel, error)
func (RoleGroupRepositoryImpl) UpdateRoleGroup ¶
func (RoleGroupRepositoryImpl) UpdateRoleGroupIdForRoleGroupMappings ¶ added in v0.6.16
func (impl RoleGroupRepositoryImpl) UpdateRoleGroupIdForRoleGroupMappings(roleId int, newRoleId int) (*RoleGroupRoleMapping, error)
type RoleGroupRoleMapping ¶
type RoleModel ¶
type RoleModel struct { TableName struct{} `sql:"roles" pg:",discard_unknown_columns"` Id int `sql:"id,pk"` Role string `sql:"role,notnull"` Entity string `sql:"entity"` Team string `sql:"team"` EntityName string `sql:"entity_name"` Environment string `sql:"environment"` Action string `sql:"action"` AccessType string `sql:"access_type"` Cluster string `sql:"cluster"` Namespace string `sql:"namespace"` Group string `sql:"group"` Kind string `sql:"kind"` Resource string `sql:"resource"` sql.AuditLog }
type RolePolicyDetails ¶ added in v0.3.15
type RolePolicyDetails struct { Team string Env string App string TeamObj string EnvObj string AppObj string Entity string EntityName string Cluster string Namespace string Group string Kind string Resource string ClusterObj string NamespaceObj string GroupObj string KindObj string ResourceObj string Approver bool }
type SelfRegistrationRoles ¶ added in v0.4.2
type SelfRegistrationRolesRepository ¶ added in v0.4.2
type SelfRegistrationRolesRepository interface {
GetAll() ([]SelfRegistrationRoles, error)
}
type SelfRegistrationRolesRepositoryImpl ¶ added in v0.4.2
type SelfRegistrationRolesRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewSelfRegistrationRolesRepositoryImpl ¶ added in v0.4.2
func NewSelfRegistrationRolesRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *SelfRegistrationRolesRepositoryImpl
func (*SelfRegistrationRolesRepositoryImpl) GetAll ¶ added in v0.4.2
func (impl *SelfRegistrationRolesRepositoryImpl) GetAll() ([]SelfRegistrationRoles, error)
type UserAuditRepository ¶ added in v0.4.11
type UserAuditRepositoryImpl ¶ added in v0.4.11
type UserAuditRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewUserAuditRepositoryImpl ¶ added in v0.4.11
func NewUserAuditRepositoryImpl(dbConnection *pg.DB) *UserAuditRepositoryImpl
func (UserAuditRepositoryImpl) GetLatestByUserId ¶ added in v0.4.11
func (impl UserAuditRepositoryImpl) GetLatestByUserId(userId int32) (*UserAudit, error)
func (UserAuditRepositoryImpl) GetLatestUser ¶ added in v0.6.4
func (impl UserAuditRepositoryImpl) GetLatestUser() (*UserAudit, error)
func (UserAuditRepositoryImpl) Save ¶ added in v0.4.11
func (impl UserAuditRepositoryImpl) Save(userAudit *UserAudit) error
func (UserAuditRepositoryImpl) Update ¶ added in v0.6.4
func (impl UserAuditRepositoryImpl) Update(userAudit *UserAudit) error
type UserAuthRepository ¶
type UserAuthRepository interface { CreateRole(role *RoleModel) (*RoleModel, error) CreateRoleWithTxn(userModel *RoleModel, tx *pg.Tx) (*RoleModel, error) GetRoleById(id int) (*RoleModel, error) GetRolesByIds(ids []int) ([]RoleModel, error) GetRoleByRoles(roles []string) ([]RoleModel, error) GetRolesByUserId(userId int32) ([]RoleModel, error) GetRolesByGroupId(userId int32) ([]*RoleModel, error) GetAllRole() ([]RoleModel, error) GetRolesByActionAndAccessType(action string, accessType string) ([]RoleModel, error) GetRoleByFilterForAllTypes(entity, team, app, env, act, accessType, cluster, namespace, group, kind, resource, action string, oldValues bool) (RoleModel, error) CreateUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (*UserRoleModel, error) GetUserRoleMappingByUserId(userId int32) ([]*UserRoleModel, error) DeleteUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (bool, error) DeleteUserRoleByRoleId(roleId int, tx *pg.Tx) error CreateDefaultPoliciesForAllTypes(team, entityName, env, entity, cluster, namespace, group, kind, resource, actionType, accessType string, UserId int32) (bool, error, []casbin2.Policy) CreateRoleForSuperAdminIfNotExists(tx *pg.Tx, UserId int32) (bool, error) SyncOrchestratorToCasbin(team string, entityName string, env string, tx *pg.Tx) (bool, error) UpdateTriggerPolicyForTerminalAccess() error GetRolesForEnvironment(envName, envIdentifier string) ([]*RoleModel, error) GetRolesForProject(teamName string) ([]*RoleModel, error) GetRolesForApp(appName string) ([]*RoleModel, error) GetRolesForChartGroup(chartGroupName string) ([]*RoleModel, error) DeleteRole(role *RoleModel, tx *pg.Tx) error //GetRoleByFilterForClusterEntity(cluster, namespace, group, kind, resource, action string) (RoleModel, error) GetRolesByUserIdAndEntityType(userId int32, entityType string) ([]*RoleModel, error) CreateRolesWithAccessTypeAndEntity(team, entityName, env, entity, cluster, namespace, group, kind, resource, actionType, accessType string, UserId int32, role string) (bool, error) }
type UserAuthRepositoryImpl ¶
type UserAuthRepositoryImpl struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewUserAuthRepositoryImpl ¶
func NewUserAuthRepositoryImpl(dbConnection *pg.DB, Logger *zap.SugaredLogger, defaultAuthPolicyRepository DefaultAuthPolicyRepository, defaultAuthRoleRepository DefaultAuthRoleRepository) *UserAuthRepositoryImpl
func (UserAuthRepositoryImpl) CreateDefaultPoliciesForAllTypes ¶ added in v0.6.16
func (UserAuthRepositoryImpl) CreateRole ¶
func (impl UserAuthRepositoryImpl) CreateRole(role *RoleModel) (*RoleModel, error)
func (UserAuthRepositoryImpl) CreateRoleForSuperAdminIfNotExists ¶ added in v0.3.14
func (UserAuthRepositoryImpl) CreateRoleWithTxn ¶ added in v0.6.17
func (UserAuthRepositoryImpl) CreateRolesWithAccessTypeAndEntity ¶ added in v0.6.16
func (UserAuthRepositoryImpl) CreateUserRoleMapping ¶
func (impl UserAuthRepositoryImpl) CreateUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (*UserRoleModel, error)
func (UserAuthRepositoryImpl) DeleteRole ¶ added in v0.3.16
func (impl UserAuthRepositoryImpl) DeleteRole(role *RoleModel, tx *pg.Tx) error
func (UserAuthRepositoryImpl) DeleteUserRoleByRoleId ¶ added in v0.3.16
func (impl UserAuthRepositoryImpl) DeleteUserRoleByRoleId(roleId int, tx *pg.Tx) error
func (UserAuthRepositoryImpl) DeleteUserRoleMapping ¶
func (impl UserAuthRepositoryImpl) DeleteUserRoleMapping(userRoleModel *UserRoleModel, tx *pg.Tx) (bool, error)
func (UserAuthRepositoryImpl) GetAllRole ¶
func (impl UserAuthRepositoryImpl) GetAllRole() ([]RoleModel, error)
func (UserAuthRepositoryImpl) GetDefaultPolicyByRoleType ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) GetDefaultPolicyByRoleType(roleType bean2.RoleType) (policy string, err error)
func (UserAuthRepositoryImpl) GetDiffBetweenPolicies ¶ added in v0.3.15
func (UserAuthRepositoryImpl) GetRole ¶
func (impl UserAuthRepositoryImpl) GetRole(role string) (*RoleModel, error)
func (UserAuthRepositoryImpl) GetRoleByFilterForAllTypes ¶ added in v0.6.16
func (impl UserAuthRepositoryImpl) GetRoleByFilterForAllTypes(entity, team, app, env, act, accessType, cluster, namespace, group, kind, resource, action string, oldValues bool) (RoleModel, error)
func (UserAuthRepositoryImpl) GetRoleById ¶
func (impl UserAuthRepositoryImpl) GetRoleById(id int) (*RoleModel, error)
func (UserAuthRepositoryImpl) GetRoleByRoles ¶ added in v0.4.2
func (impl UserAuthRepositoryImpl) GetRoleByRoles(roles []string) ([]RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesByActionAndAccessType ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) GetRolesByActionAndAccessType(action string, accessType string) ([]RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesByGroupId ¶
func (impl UserAuthRepositoryImpl) GetRolesByGroupId(roleGroupId int32) ([]*RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesByIds ¶ added in v0.6.16
func (impl UserAuthRepositoryImpl) GetRolesByIds(ids []int) ([]RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesByUserId ¶
func (impl UserAuthRepositoryImpl) GetRolesByUserId(userId int32) ([]RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesByUserIdAndEntityType ¶ added in v0.6.11
func (impl UserAuthRepositoryImpl) GetRolesByUserIdAndEntityType(userId int32, entityType string) ([]*RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesForApp ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) GetRolesForApp(appName string) ([]*RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesForChartGroup ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) GetRolesForChartGroup(chartGroupName string) ([]*RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesForEnvironment ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) GetRolesForEnvironment(envName, envIdentifier string) ([]*RoleModel, error)
func (UserAuthRepositoryImpl) GetRolesForProject ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) GetRolesForProject(teamName string) ([]*RoleModel, error)
func (UserAuthRepositoryImpl) GetUpdatedAddedOrDeletedPolicies ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) GetUpdatedAddedOrDeletedPolicies(policies []casbin2.Policy, rolePolicyDetails RolePolicyDetails) (bean.PolicyRequest, error)
func (UserAuthRepositoryImpl) GetUserRoleMappingByUserId ¶
func (impl UserAuthRepositoryImpl) GetUserRoleMappingByUserId(userId int32) ([]*UserRoleModel, error)
func (UserAuthRepositoryImpl) SyncOrchestratorToCasbin ¶
func (UserAuthRepositoryImpl) UpdateDefaultPolicyByRoleType ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) UpdateDefaultPolicyByRoleType(newPolicy string, roleType bean2.RoleType) (err error)
func (UserAuthRepositoryImpl) UpdateTriggerPolicyForTerminalAccess ¶ added in v0.3.15
func (impl UserAuthRepositoryImpl) UpdateTriggerPolicyForTerminalAccess() (err error)
type UserRepository ¶
type UserRepository interface { CreateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error) UpdateUser(userModel *UserModel, tx *pg.Tx) (*UserModel, error) GetById(id int32) (*UserModel, error) GetByIdIncludeDeleted(id int32) (*UserModel, error) GetAllExcludingApiTokenUser() ([]UserModel, error) //GetAllUserRoleMappingsForRoleId(roleId int) ([]UserRoleModel, error) FetchActiveUserByEmail(email string) (bean.UserInfo, error) FetchUserDetailByEmail(email string) (bean.UserInfo, error) GetByIds(ids []int32) ([]UserModel, error) GetConnection() (dbConnection *pg.DB) FetchUserMatchesByEmailIdExcludingApiTokenUser(email string) ([]UserModel, error) FetchActiveOrDeletedUserByEmail(email string) (*UserModel, error) UpdateRoleIdForUserRolesMappings(roleId int, newRoleId int) (*UserRoleModel, error) }
type UserRepositoryImpl ¶
type UserRepositoryImpl struct { Logger *zap.SugaredLogger // contains filtered or unexported fields }
func NewUserRepositoryImpl ¶
func NewUserRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *UserRepositoryImpl
func (UserRepositoryImpl) CreateUser ¶
func (UserRepositoryImpl) FetchActiveOrDeletedUserByEmail ¶
func (impl UserRepositoryImpl) FetchActiveOrDeletedUserByEmail(email string) (*UserModel, error)
func (UserRepositoryImpl) FetchActiveUserByEmail ¶
func (impl UserRepositoryImpl) FetchActiveUserByEmail(email string) (bean.UserInfo, error)
func (UserRepositoryImpl) FetchUserDetailByEmail ¶
func (impl UserRepositoryImpl) FetchUserDetailByEmail(email string) (bean.UserInfo, error)
func (UserRepositoryImpl) FetchUserMatchesByEmailIdExcludingApiTokenUser ¶ added in v0.4.24
func (impl UserRepositoryImpl) FetchUserMatchesByEmailIdExcludingApiTokenUser(email string) ([]UserModel, error)
func (UserRepositoryImpl) GetAllExcludingApiTokenUser ¶ added in v0.4.11
func (impl UserRepositoryImpl) GetAllExcludingApiTokenUser() ([]UserModel, error)
func (UserRepositoryImpl) GetById ¶
func (impl UserRepositoryImpl) GetById(id int32) (*UserModel, error)
func (UserRepositoryImpl) GetByIdIncludeDeleted ¶
func (impl UserRepositoryImpl) GetByIdIncludeDeleted(id int32) (*UserModel, error)
func (UserRepositoryImpl) GetByIds ¶
func (impl UserRepositoryImpl) GetByIds(ids []int32) ([]UserModel, error)
func (*UserRepositoryImpl) GetConnection ¶
func (impl *UserRepositoryImpl) GetConnection() (dbConnection *pg.DB)
func (UserRepositoryImpl) UpdateRoleIdForUserRolesMappings ¶ added in v0.6.16
func (impl UserRepositoryImpl) UpdateRoleIdForUserRolesMappings(roleId int, newRoleId int) (*UserRoleModel, error)
func (UserRepositoryImpl) UpdateUser ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.