Documentation ¶
Index ¶
- Constants
- func GetAccessControlInitializer() map[AccessControlType]NewAccessControlFunc
- func RegisterAccessControlInitializer(authType AccessControlType, initializer NewAccessControlFunc)
- type AccessControl
- func DefaultAccessControl() AccessControl
- func GetAccessControl(genericConf *generic.GenericConfiguration, ...) (AccessControl, error)
- func NewDynamicConfAccessControl(_ *generic.AuthConfiguration, dynamicConfig *dynamic.DynamicAgentConfiguration) (AccessControl, error)
- func NewInsecureAccessControl(_ *generic.AuthConfiguration, _ *dynamic.DynamicAgentConfiguration) (AccessControl, error)
- func NewStaticAccessControl(_ *generic.AuthConfiguration, _ *dynamic.DynamicAgentConfiguration) (AccessControl, error)
- type AccessControlType
- type AuthRule
- type NewAccessControlFunc
- type PermissionType
Constants ¶
View Source
const ( // PermissionTypeHttpEndpoint represents all http resources PermissionTypeHttpEndpoint = "http_endpoint" // PermissionTypeEvictionPlugin represents the permission to register eviction plugin. PermissionTypeEvictionPlugin = "eviction_plugin" // PermissionTypeAll represents all permissions. PermissionTypeAll = "*" )
View Source
const ( AccessControlTypeInsecure = "insecure" AccessControlTypeStatic = "static" AccessControlTypeDynamicConf = "dynamic_conf" )
View Source
const ( ErrorMsgInvalidSubject = "there is no record associated to subject %v" ErrorMsgNoPermission = "subject %v has no permission to resource %v" )
Variables ¶
This section is empty.
Functions ¶
func GetAccessControlInitializer ¶
func GetAccessControlInitializer() map[AccessControlType]NewAccessControlFunc
func RegisterAccessControlInitializer ¶
func RegisterAccessControlInitializer(authType AccessControlType, initializer NewAccessControlFunc)
Types ¶
type AccessControl ¶
type AccessControl interface { // Verify verifies whether the subject passed in has the permission on the target resource. Verify(authInfo credential.AuthInfo, targetResource PermissionType) error // Run starts the AccessControl component Run(ctx context.Context) }
AccessControl verifies whether the subject the AuthInfo holds has the permission on the target resource.
func DefaultAccessControl ¶
func DefaultAccessControl() AccessControl
func GetAccessControl ¶
func GetAccessControl(genericConf *generic.GenericConfiguration, dynamicConfig *dynamic.DynamicAgentConfiguration) (AccessControl, error)
func NewDynamicConfAccessControl ¶
func NewDynamicConfAccessControl(_ *generic.AuthConfiguration, dynamicConfig *dynamic.DynamicAgentConfiguration) (AccessControl, error)
func NewInsecureAccessControl ¶
func NewInsecureAccessControl(_ *generic.AuthConfiguration, _ *dynamic.DynamicAgentConfiguration) (AccessControl, error)
func NewStaticAccessControl ¶
func NewStaticAccessControl(_ *generic.AuthConfiguration, _ *dynamic.DynamicAgentConfiguration) (AccessControl, error)
type AccessControlType ¶
type AccessControlType string
type AuthRule ¶
type AuthRule map[string][]PermissionType
type NewAccessControlFunc ¶
type NewAccessControlFunc func(authConfig *generic.AuthConfiguration, dynamicConfig *dynamic.DynamicAgentConfiguration) (AccessControl, error)
type PermissionType ¶
type PermissionType string
Click to show internal directories.
Click to hide internal directories.