rbac

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 21 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnforcerUtil

type EnforcerUtil interface {
	GetAppAndEnvRBACNamesByAppAndEnvIds(IdToAppEnvPairs map[int][2]int) (map[int]string, map[int]string, map[int]*app.App, map[int]*repository2.Environment, error)
	IsAuthorizedForAppInAppResults(appId int, rbacResults map[string]bool, appIdtoApp map[int]*app.App) bool
	IsAuthorizedForEnvInEnvResults(appId int, envId int, appResults map[string]bool, appIdtoApp map[int]*app.App, envIdToEnv map[int]*repository2.Environment) bool
	GetAppRBACName(appName string) string
	GetRbacObjectsForAllApps(appType helper.AppType) map[int]string
	GetRbacObjectsForAllAppsWithTeamID(teamID int, appType helper.AppType) map[int]string
	GetAppRBACNameByAppId(appId int) string
	GetAppRBACByAppNameAndEnvId(appName string, envId int) string
	GetAppRBACByAppIdAndPipelineId(appId int, pipelineId int) string
	GetTeamEnvRBACNameByAppId(appId int, envId int) string
	GetEnvRBACNameByAppId(appId int, envId int) string
	GetTeamRBACByCiPipelineId(pipelineId int) string
	GetEnvRBACArrayByAppId(appId int) []string
	GetEnvRBACNameByCiPipelineIdAndEnvId(ciPipelineId int, envId int) string
	GetTeamRbacObjectByCiPipelineId(ciPipelineId int) string
	GetTeamAndEnvironmentRbacObjectByCDPipelineId(pipelineId int) (string, string)
	GetRbacObjectsForAllAppsAndEnvironments() (map[int]string, map[string]string)
	GetProjectAdminRBACNameBYAppName(appName string) string
	GetHelmObject(appId int, envId int) (string, string)
	GetHelmObjectByAppNameAndEnvId(appName string, envId int) (string, string)
	GetHelmObjectByProjectIdAndEnvId(teamId int, envId int) (string, string)
	GetEnvRBACNameByCdPipelineIdAndEnvId(cdPipelineId int) string
	GetAppRBACNameByTeamIdAndAppId(teamId int, appId int) string
	GetRBACNameForClusterEntity(clusterName string, resourceIdentifier k8s.ResourceIdentifier) (resourceName, objectName string)
	GetAppObjectByCiPipelineIds(ciPipelineIds []int) map[int]string
	GetAppAndEnvObjectByPipelineIds(cdPipelineIds []int) map[int][]string
	GetRbacObjectsForAllAppsWithMatchingAppName(appNameMatch string, appType helper.AppType) map[int]string
	GetAppAndEnvObjectByPipeline(cdPipelines []*bean.CDPipelineConfigObject) map[int][]string
	GetAppAndEnvObjectByDbPipeline(cdPipelines []*pipelineConfig.Pipeline) map[int][]string
	GetRbacObjectsByAppIds(appIds []int) map[int]string
	GetAllActiveTeamNames() ([]string, error)
	GetRbacObjectsByEnvIdsAndAppId(envIds []int, appId int) (map[int]string, map[string]string)
	GetAppRBACNameByAppAndProjectName(projectName, appName string) string
	GetRbacObjectNameByAppAndWorkflow(appName, workflowName string) string
	GetRbacObjectNameByAppIdAndWorkflow(appId int, workflowName string) string
	GetWorkflowRBACByCiPipelineId(pipelineId int, workflowName string) string
	GetTeamEnvRBACNameByCiPipelineIdAndEnvIdOrName(ciPipelineId int, envId int, envName string) string
	GetTeamEnvAppRbacObjectByAppIdEnvIdOrName(appId, envId int, envName string) string
	GetAllWorkflowRBACObjectsByAppId(appId int, workflowNames []string, workflowIds []int) map[int]string
	GetEnvRBACArrayByAppIdForJobs(appId int) []string
	CheckAppRbacForAppOrJob(token, resourceName, action string) bool
	CheckAppRbacForAppOrJobInBulk(token, action string, rbacObjects []string, appType helper.AppType) map[string]bool
	GetRbacObjectsByEnvIdsAndAppIdBatch(appIdToEnvIds map[int][]int) map[int]map[int]string
	GetEnvRBACNameByAppAndEnvName(appName, envName string) string
	GetAppRBACNameByAppName(appName string) string
	GetRbacResourceAndObjectForNode(clusterName string, nodeName string) (string, string)
	GetRbacResourceAndObjectForNodeByClusterId(clusterId int, nodeName string) (string, string)
}

type EnforcerUtilHelm added in v0.3.14

type EnforcerUtilHelm interface {
	GetHelmObjectByClusterId(clusterId int, namespace string, appName string) string
	GetHelmObjectByTeamIdAndClusterId(teamId int, clusterId int, namespace string, appName string) string
	GetHelmObjectByClusterIdNamespaceAndAppName(clusterId int, namespace string, appName string) (string, string)
	GetAppRBACNameByInstalledAppId(installedAppId int) (string, string)
	GetAppRBACNameByInstalledAppIdAndTeamId(installedAppId, teamId int) string
}

type EnforcerUtilHelmImpl added in v0.3.14

type EnforcerUtilHelmImpl struct {
	InstalledAppRepository repository2.InstalledAppRepository
	// contains filtered or unexported fields
}

func NewEnforcerUtilHelmImpl added in v0.3.14

func NewEnforcerUtilHelmImpl(logger *zap.SugaredLogger,
	clusterRepository repository.ClusterRepository,
	teamRepository repository3.TeamRepository,
	appRepository app.AppRepository,
	installedAppRepository repository2.InstalledAppRepository,
	migration dbMigration.DbMigration,
) *EnforcerUtilHelmImpl

func (EnforcerUtilHelmImpl) GetAppRBACNameByInstalledAppId added in v0.6.11

func (impl EnforcerUtilHelmImpl) GetAppRBACNameByInstalledAppId(installedAppVersionId int) (string, string)

func (EnforcerUtilHelmImpl) GetAppRBACNameByInstalledAppIdAndTeamId added in v0.7.0

func (impl EnforcerUtilHelmImpl) GetAppRBACNameByInstalledAppIdAndTeamId(installedAppId, teamId int) string

func (EnforcerUtilHelmImpl) GetHelmObjectByClusterId added in v0.3.14

func (impl EnforcerUtilHelmImpl) GetHelmObjectByClusterId(clusterId int, namespace string, appName string) string

func (EnforcerUtilHelmImpl) GetHelmObjectByClusterIdNamespaceAndAppName added in v0.6.11

func (impl EnforcerUtilHelmImpl) GetHelmObjectByClusterIdNamespaceAndAppName(clusterId int, namespace string, appName string) (string, string)

func (EnforcerUtilHelmImpl) GetHelmObjectByTeamIdAndClusterId added in v0.6.11

func (impl EnforcerUtilHelmImpl) GetHelmObjectByTeamIdAndClusterId(teamId int, clusterId int, namespace string, appName string) string

type EnforcerUtilImpl

type EnforcerUtilImpl struct {
	// contains filtered or unexported fields
}

func NewEnforcerUtilImpl

func NewEnforcerUtilImpl(logger *zap.SugaredLogger, teamRepository repository3.TeamRepository,
	appRepo app.AppRepository, environmentRepository repository2.EnvironmentRepository,
	pipelineRepository pipelineConfig.PipelineRepository, ciPipelineRepository pipelineConfig.CiPipelineRepository,
	clusterRepository repository.ClusterRepository, enforcer casbin.Enforcer,
	dbMigration dbMigration.DbMigration,
	teamReadService read.TeamReadService) *EnforcerUtilImpl

func (EnforcerUtilImpl) CheckAppRbacForAppOrJob added in v0.6.26

func (impl EnforcerUtilImpl) CheckAppRbacForAppOrJob(token, resourceName, action string) bool

func (EnforcerUtilImpl) CheckAppRbacForAppOrJobInBulk added in v0.6.26

func (impl EnforcerUtilImpl) CheckAppRbacForAppOrJobInBulk(token, action string, rbacObjects []string, appType helper.AppType) map[string]bool

func (EnforcerUtilImpl) GetAllActiveTeamNames added in v0.6.17

func (impl EnforcerUtilImpl) GetAllActiveTeamNames() ([]string, error)

func (EnforcerUtilImpl) GetAllWorkflowRBACObjectsByAppId added in v0.6.26

func (impl EnforcerUtilImpl) GetAllWorkflowRBACObjectsByAppId(appId int, workflowNames []string, workflowIds []int) map[int]string

func (EnforcerUtilImpl) GetAppAndEnvObjectByDbPipeline added in v0.6.17

func (impl EnforcerUtilImpl) GetAppAndEnvObjectByDbPipeline(cdPipelines []*pipelineConfig.Pipeline) map[int][]string

GetAppAndEnvObjectByDbPipeline TODO - This function will be merge into GetAppAndEnvObjectByPipeline

func (EnforcerUtilImpl) GetAppAndEnvObjectByPipeline added in v0.6.17

func (impl EnforcerUtilImpl) GetAppAndEnvObjectByPipeline(cdPipelines []*bean.CDPipelineConfigObject) map[int][]string

func (EnforcerUtilImpl) GetAppAndEnvObjectByPipelineIds added in v0.6.15

func (impl EnforcerUtilImpl) GetAppAndEnvObjectByPipelineIds(cdPipelineIds []int) map[int][]string

func (EnforcerUtilImpl) GetAppAndEnvRBACNamesByAppAndEnvIds added in v1.1.0

func (impl EnforcerUtilImpl) GetAppAndEnvRBACNamesByAppAndEnvIds(appEnvPairs map[int][2]int) (map[int]string, map[int]string, map[int]*app.App, map[int]*repository2.Environment, error)

func (EnforcerUtilImpl) GetAppObjectByCiPipelineIds added in v0.6.15

func (impl EnforcerUtilImpl) GetAppObjectByCiPipelineIds(ciPipelineIds []int) map[int]string

func (EnforcerUtilImpl) GetAppRBACByAppIdAndPipelineId

func (impl EnforcerUtilImpl) GetAppRBACByAppIdAndPipelineId(appId int, pipelineId int) string

func (EnforcerUtilImpl) GetAppRBACByAppNameAndEnvId

func (impl EnforcerUtilImpl) GetAppRBACByAppNameAndEnvId(appName string, envId int) string

func (EnforcerUtilImpl) GetAppRBACName

func (impl EnforcerUtilImpl) GetAppRBACName(appName string) string

func (EnforcerUtilImpl) GetAppRBACNameByAppAndProjectName added in v0.6.24

func (impl EnforcerUtilImpl) GetAppRBACNameByAppAndProjectName(projectName, appName string) string

func (EnforcerUtilImpl) GetAppRBACNameByAppId

func (impl EnforcerUtilImpl) GetAppRBACNameByAppId(appId int) string

func (EnforcerUtilImpl) GetAppRBACNameByAppName added in v0.7.3

func (impl EnforcerUtilImpl) GetAppRBACNameByAppName(appName string) string

func (EnforcerUtilImpl) GetAppRBACNameByTeamIdAndAppId added in v0.6.0

func (impl EnforcerUtilImpl) GetAppRBACNameByTeamIdAndAppId(teamId int, appId int) string

func (EnforcerUtilImpl) GetEnvRBACArrayByAppId

func (impl EnforcerUtilImpl) GetEnvRBACArrayByAppId(appId int) []string

func (EnforcerUtilImpl) GetEnvRBACArrayByAppIdForJobs added in v0.6.26

func (impl EnforcerUtilImpl) GetEnvRBACArrayByAppIdForJobs(appId int) []string

func (EnforcerUtilImpl) GetEnvRBACNameByAppAndEnvName added in v0.7.3

func (impl EnforcerUtilImpl) GetEnvRBACNameByAppAndEnvName(appName, envName string) string

func (EnforcerUtilImpl) GetEnvRBACNameByAppId

func (impl EnforcerUtilImpl) GetEnvRBACNameByAppId(appId int, envId int) string

func (EnforcerUtilImpl) GetEnvRBACNameByCdPipelineIdAndEnvId added in v0.4.8

func (impl EnforcerUtilImpl) GetEnvRBACNameByCdPipelineIdAndEnvId(cdPipelineId int) string

func (EnforcerUtilImpl) GetEnvRBACNameByCiPipelineIdAndEnvId

func (impl EnforcerUtilImpl) GetEnvRBACNameByCiPipelineIdAndEnvId(ciPipelineId int, envId int) string

func (EnforcerUtilImpl) GetHelmObject added in v0.3.14

func (impl EnforcerUtilImpl) GetHelmObject(appId int, envId int) (string, string)

func (EnforcerUtilImpl) GetHelmObjectByAppNameAndEnvId added in v0.3.14

func (impl EnforcerUtilImpl) GetHelmObjectByAppNameAndEnvId(appName string, envId int) (string, string)

func (EnforcerUtilImpl) GetHelmObjectByProjectIdAndEnvId added in v0.3.24

func (impl EnforcerUtilImpl) GetHelmObjectByProjectIdAndEnvId(teamId int, envId int) (string, string)

func (EnforcerUtilImpl) GetProjectAdminRBACNameBYAppName added in v0.3.9

func (impl EnforcerUtilImpl) GetProjectAdminRBACNameBYAppName(appName string) string

func (EnforcerUtilImpl) GetRBACNameForClusterEntity added in v0.6.11

func (impl EnforcerUtilImpl) GetRBACNameForClusterEntity(clusterName string, resourceIdentifier k8s.ResourceIdentifier) (resourceName, objectName string)

func (EnforcerUtilImpl) GetRbacObjectNameByAppAndWorkflow added in v0.6.26

func (impl EnforcerUtilImpl) GetRbacObjectNameByAppAndWorkflow(appName, workflowName string) string

func (EnforcerUtilImpl) GetRbacObjectNameByAppIdAndWorkflow added in v0.6.26

func (impl EnforcerUtilImpl) GetRbacObjectNameByAppIdAndWorkflow(appId int, workflowName string) string

func (EnforcerUtilImpl) GetRbacObjectsByAppIds added in v0.6.17

func (impl EnforcerUtilImpl) GetRbacObjectsByAppIds(appIds []int) map[int]string

func (EnforcerUtilImpl) GetRbacObjectsByEnvIdsAndAppId added in v0.6.24

func (impl EnforcerUtilImpl) GetRbacObjectsByEnvIdsAndAppId(envIds []int, appId int) (map[int]string, map[string]string)

func (EnforcerUtilImpl) GetRbacObjectsByEnvIdsAndAppIdBatch added in v0.7.0

func (impl EnforcerUtilImpl) GetRbacObjectsByEnvIdsAndAppIdBatch(appIdToEnvIds map[int][]int) map[int]map[int]string

func (EnforcerUtilImpl) GetRbacObjectsForAllApps

func (impl EnforcerUtilImpl) GetRbacObjectsForAllApps(appType helper.AppType) map[int]string

func (EnforcerUtilImpl) GetRbacObjectsForAllAppsAndEnvironments added in v0.2.17

func (impl EnforcerUtilImpl) GetRbacObjectsForAllAppsAndEnvironments() (map[int]string, map[string]string)

func (EnforcerUtilImpl) GetRbacObjectsForAllAppsWithMatchingAppName added in v0.6.17

func (impl EnforcerUtilImpl) GetRbacObjectsForAllAppsWithMatchingAppName(appNameMatch string, appType helper.AppType) map[int]string

func (EnforcerUtilImpl) GetRbacObjectsForAllAppsWithTeamID added in v0.6.17

func (impl EnforcerUtilImpl) GetRbacObjectsForAllAppsWithTeamID(teamID int, appType helper.AppType) map[int]string

func (EnforcerUtilImpl) GetRbacResourceAndObjectForNode added in v1.1.0

func (impl EnforcerUtilImpl) GetRbacResourceAndObjectForNode(clusterName string, nodeName string) (string, string)

func (EnforcerUtilImpl) GetRbacResourceAndObjectForNodeByClusterId added in v1.1.0

func (impl EnforcerUtilImpl) GetRbacResourceAndObjectForNodeByClusterId(clusterId int, nodeName string) (string, string)

func (EnforcerUtilImpl) GetTeamAndEnvironmentRbacObjectByCDPipelineId

func (impl EnforcerUtilImpl) GetTeamAndEnvironmentRbacObjectByCDPipelineId(pipelineId int) (string, string)

func (EnforcerUtilImpl) GetTeamEnvAppRbacObjectByAppIdEnvIdOrName added in v0.6.26

func (impl EnforcerUtilImpl) GetTeamEnvAppRbacObjectByAppIdEnvIdOrName(appId, envId int, envName string) string

func (EnforcerUtilImpl) GetTeamEnvRBACNameByAppId added in v0.3.15

func (impl EnforcerUtilImpl) GetTeamEnvRBACNameByAppId(appId int, envId int) string

func (EnforcerUtilImpl) GetTeamEnvRBACNameByCiPipelineIdAndEnvIdOrName added in v0.6.26

func (impl EnforcerUtilImpl) GetTeamEnvRBACNameByCiPipelineIdAndEnvIdOrName(ciPipelineId int, envId int, envName string) string

func (EnforcerUtilImpl) GetTeamRBACByCiPipelineId

func (impl EnforcerUtilImpl) GetTeamRBACByCiPipelineId(pipelineId int) string

func (EnforcerUtilImpl) GetTeamRbacObjectByCiPipelineId

func (impl EnforcerUtilImpl) GetTeamRbacObjectByCiPipelineId(ciPipelineId int) string

func (EnforcerUtilImpl) GetWorkflowRBACByCiPipelineId added in v0.6.26

func (impl EnforcerUtilImpl) GetWorkflowRBACByCiPipelineId(pipelineId int, workflowName string) string

func (EnforcerUtilImpl) IsAuthorizedForAppInAppResults added in v1.1.0

func (impl EnforcerUtilImpl) IsAuthorizedForAppInAppResults(appId int, rbacResults map[string]bool, appIdtoApp map[int]*app.App) bool

func (EnforcerUtilImpl) IsAuthorizedForEnvInEnvResults added in v1.1.0

func (impl EnforcerUtilImpl) IsAuthorizedForEnvInEnvResults(appId int, envId int, rbacResults map[string]bool, appIdtoApp map[int]*app.App, envIdToEnv map[int]*repository2.Environment) bool

Jump to

Keyboard shortcuts

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