Documentation
¶
Index ¶
- Constants
- Variables
- func Errorf(format string, a ...interface{}) error
- func GetPoliciesFromClaims(claims map[string]any, policyClaimName string) (set.StringSet, bool)
- func GetValuesFromClaims(claims map[string]any, claimName string) (set.StringSet, bool)
- func IsAllowedPar(policies []Policy, args Args) bool
- func IsAllowedSerial(policies []Policy, args Args) bool
- type Action
- type ActionConditionKeyMap
- type ActionSet
- func (actionSet ActionSet) Add(action Action)
- func (actionSet ActionSet) Clone() ActionSet
- func (actionSet ActionSet) Contains(action Action) bool
- func (actionSet ActionSet) Equals(sactionSet ActionSet) bool
- func (actionSet ActionSet) Intersection(sset ActionSet) ActionSet
- func (actionSet ActionSet) IsEmpty() bool
- func (actionSet ActionSet) MarshalJSON() ([]byte, error)
- func (actionSet ActionSet) Match(action Action) bool
- func (actionSet ActionSet) String() string
- func (actionSet ActionSet) ToAdminSlice() []AdminAction
- func (actionSet ActionSet) ToKMSSlice() (actions []KMSAction)
- func (actionSet ActionSet) ToMemorySlice() []MemoryAction
- func (actionSet ActionSet) ToSTSSlice() []STSAction
- func (actionSet ActionSet) ToSlice() []Action
- func (actionSet ActionSet) ToTableSlice() []TableAction
- func (actionSet ActionSet) ToVectorsSlice() []VectorsAction
- func (actionSet *ActionSet) UnmarshalJSON(data []byte) error
- func (actionSet ActionSet) Validate() error
- func (actionSet ActionSet) ValidateAdmin() error
- func (actionSet ActionSet) ValidateKMS() error
- func (actionSet ActionSet) ValidateMemory() error
- func (actionSet ActionSet) ValidateSTS() error
- func (actionSet ActionSet) ValidateTable() error
- func (actionSet ActionSet) ValidateVectors() error
- type ActionType
- type AdminAction
- type Args
- type BPStatement
- func NewBPStatement(sid ID, effect Effect, principal Principal, actionSet ActionSet, ...) BPStatement
- func NewBPStatementWithNotAction(sid ID, effect Effect, principal Principal, notActions ActionSet, ...) BPStatement
- func NewBPStatementWithNotResource(sid ID, effect Effect, principal Principal, actions ActionSet, ...) BPStatement
- type BucketPolicy
- func (policy *BucketPolicy) Equals(p BucketPolicy) bool
- func (policy BucketPolicy) IsAllowed(args BucketPolicyArgs) bool
- func (policy BucketPolicy) IsEmpty() bool
- func (policy BucketPolicy) MarshalJSON() ([]byte, error)
- func (policy *BucketPolicy) UnmarshalJSON(data []byte) error
- func (policy BucketPolicy) Validate(bucketName string) error
- type BucketPolicyArgs
- type Decision
- type Effect
- type Error
- type ID
- type KMSAction
- type MemoryAction
- type Policy
- func (iamp *Policy) Decide(args *Args) Decision
- func (iamp *Policy) Equals(p Policy) bool
- func (iamp *Policy) HasDenyStatement() bool
- func (iamp Policy) IsAllowed(args Args) bool
- func (iamp Policy) IsAllowedActions(bucketName, objectName string, conditionValues map[string][]string) ActionSet
- func (iamp Policy) IsEmpty() bool
- func (iamp Policy) MatchResource(resource string) bool
- func (iamp *Policy) UnmarshalJSON(data []byte) error
- func (iamp Policy) Validate() error
- func (iamp Policy) ValidateStrict() error
- type Principal
- func (p Principal) Clone() Principal
- func (p Principal) Equals(pp Principal) bool
- func (p Principal) Intersection(principal Principal) set.StringSet
- func (p Principal) IsValid() bool
- func (p Principal) MarshalJSON() ([]byte, error)
- func (p Principal) Match(principal string) bool
- func (p *Principal) UnmarshalJSON(data []byte) error
- type Resource
- func (r Resource) IsValid() bool
- func (r Resource) MarshalJSON() ([]byte, error)
- func (r Resource) Match(resource string, conditionValues map[string][]string) bool
- func (r Resource) MatchResource(resource string) bool
- func (r Resource) String() string
- func (r *Resource) UnmarshalJSON(data []byte) error
- func (r Resource) Validate() error
- func (r Resource) ValidateBucket(bucketName string) error
- type ResourceARNType
- type ResourceSet
- func (resourceSet ResourceSet) Add(resource Resource)
- func (resourceSet ResourceSet) BucketResourceExists() bool
- func (resourceSet ResourceSet) Clone() ResourceSet
- func (resourceSet ResourceSet) Equals(sresourceSet ResourceSet) bool
- func (resourceSet ResourceSet) Intersection(sset ResourceSet) ResourceSet
- func (resourceSet ResourceSet) MarshalJSON() ([]byte, error)
- func (resourceSet ResourceSet) Match(resource string, conditionValues map[string][]string) bool
- func (resourceSet ResourceSet) MatchResource(resource string) bool
- func (resourceSet ResourceSet) ObjectResourceExists() bool
- func (resourceSet ResourceSet) String() string
- func (resourceSet ResourceSet) ToSlice() []Resource
- func (resourceSet *ResourceSet) UnmarshalJSON(data []byte) error
- func (resourceSet ResourceSet) ValidateBucket(bucketName string) error
- func (resourceSet ResourceSet) ValidateKMS() error
- func (resourceSet ResourceSet) ValidateMemory() error
- func (resourceSet ResourceSet) ValidateS3() error
- func (resourceSet ResourceSet) ValidateTable() error
- func (resourceSet ResourceSet) ValidateVectors() error
- type STSAction
- type Statement
- func NewStatement(sid ID, effect Effect, actionSet ActionSet, resourceSet ResourceSet, ...) Statement
- func NewStatementWithNotAction(sid ID, effect Effect, notActions ActionSet, resources ResourceSet, ...) Statement
- func NewStatementWithNotResource(sid ID, effect Effect, actions ActionSet, notResources ResourceSet, ...) Statement
- func (statement Statement) Clone() Statement
- func (statement Statement) Equals(st Statement) bool
- func (statement Statement) IsAllowed(args Args) bool
- func (statement Statement) IsAllowedPtr(args *Args) bool
- func (statement Statement) Validate() error
- func (statement Statement) ValidateStrict() error
- type TableAction
- type VectorsAction
Constants ¶
const ( PolicyName = "policy" SessionPolicyName = "sessionPolicy" )
Policy claim constants
const ( // ResourceARNPrefix - resource S3 ARN prefix as per S3 specification. ResourceARNPrefix = "arn:aws:s3:::" // ResourceARNS3TablesPrefix - resource prefix for Amazon S3 Tables resources. ResourceARNS3TablesPrefix = "arn:aws:s3tables:::" // ResourceARNKMSPrefix is for KMS key resources. MinIO specific API. ResourceARNKMSPrefix = "arn:minio:kms:::" )
const DefaultVersion = "2012-10-17"
DefaultVersion - default policy version as per AWS S3 specification.
Variables ¶
var ARNPrefixToType map[string]ResourceARNType
ARNPrefixToType maps prefix to types.
var ARNTypeToPrefix = map[ResourceARNType]string{ ResourceARNS3: ResourceARNPrefix, ResourceARNS3Tables: ResourceARNS3TablesPrefix, ResourceARNKMS: ResourceARNKMSPrefix, ResourceARNAll: "*", }
ARNTypeToPrefix maps the type to prefix string
var AdminActionsWithResource = map[AdminAction]struct{}{ SetBucketQuotaAdminAction: {}, GetBucketQuotaAdminAction: {}, SetBucketCompressionAdminAction: {}, GetBucketCompressionAdminAction: {}, SetBucketTargetAction: {}, GetBucketTargetAction: {}, ReplicationDiff: {}, ImportBucketMetadataAction: {}, ExportBucketMetadataAction: {}, HealAdminAction: {}, InventoryControlAction: {}, }
AdminActionsWithResource enumerates admin actions that operate on a specific bucket resource. When a policy statement contains one of these actions *and* specifies a Resource, the resource is enforced against the target bucket. All other admin actions are resource-less; any Resource specified in the statement is ignored for them.
var DefaultPolicies = []struct { Name string Definition Policy }{ { Name: "readwrite", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet(AllActions), Resources: NewResourceSet(NewResource("*")), }, }, }, }, { Name: "readonly", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet(GetBucketLocationAction, GetObjectAction), Resources: NewResourceSet(NewResource("*")), }, { SID: ID(""), Effect: Deny, Actions: NewActionSet(Action(CreateUserAdminAction)), Resources: NewResourceSet(NewResource("*")), }, }, }, }, { Name: "consolereadonly", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet(GetBucketLocationAction, GetObjectAction, ListBucketAction), Resources: NewResourceSet(NewResource("*")), }, { SID: ID(""), Effect: Deny, Actions: NewActionSet(Action(CreateUserAdminAction)), Resources: NewResourceSet(NewResource("*")), }, }, }, }, { Name: "writeonly", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet(PutObjectAction), Resources: NewResourceSet(NewResource("*")), }, }, }, }, { Name: "diagnostics", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet(Action(ProfilingAdminAction), Action(TraceAdminAction), Action(ConsoleLogAdminAction), Action(ServerInfoAdminAction), Action(TopLocksAdminAction), Action(HealthInfoAdminAction), Action(BandwidthMonitorAction), Action(PrometheusAdminAction), ), Resources: NewResourceSet(NewResource("*")), }, }, }, }, { Name: "tablesAdmin", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet(Action(AllS3TablesActions)), Resources: NewResourceSet(NewS3TablesResource("*")), Conditions: condition.NewFunctions(), }, }, }, }, { Name: "iamAdmin", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet( Action(CreateUserAdminAction), Action(DeleteUserAdminAction), Action(ListUsersAdminAction), Action(EnableUserAdminAction), Action(DisableUserAdminAction), Action(GetUserAdminAction), Action(AddUserToGroupAdminAction), Action(RemoveUserFromGroupAdminAction), Action(GetGroupAdminAction), Action(ListGroupsAdminAction), Action(EnableGroupAdminAction), Action(DisableGroupAdminAction), Action(CreatePolicyAdminAction), Action(DeletePolicyAdminAction), Action(GetPolicyAdminAction), Action(AttachPolicyAdminAction), Action(UpdatePolicyAssociationAction), Action(ListUserPoliciesAdminAction), Action(CreateServiceAccountAdminAction), Action(UpdateServiceAccountAdminAction), Action(RemoveServiceAccountAdminAction), Action(ListServiceAccountsAdminAction), Action(ListTemporaryAccountsAdminAction), Action(ExportIAMAction), Action(ImportIAMAction), ), Resources: NewResourceSet(), Conditions: condition.NewFunctions(), }, }, }, }, { Name: "infraAdmin", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet( Action(ServerUpdateAdminAction), Action(ServiceRestartAdminAction), Action(ServiceStopAdminAction), Action(ServiceFreezeAdminAction), Action(ServiceCordonAdminAction), Action(ServerInfoAdminAction), Action(StorageInfoAdminAction), Action(ConfigUpdateAdminAction), Action(HealAdminAction), Action(ForceUnlockAdminAction), Action(DecommissionAdminAction), Action(RebalanceAdminAction), Action(SetBucketQuotaAdminAction), Action(GetBucketQuotaAdminAction), Action(SetBucketCompressionAdminAction), Action(GetBucketCompressionAdminAction), Action(SetTierAction), Action(ListTierAction), Action(LicenseInfoAdminAction), Action(DataUsageInfoAdminAction), Action(ImportBucketMetadataAction), Action(ExportBucketMetadataAction), Action(StartBatchJobAction), Action(ListBatchJobsAction), Action(DescribeBatchJobAction), Action(CancelBatchJobAction), Action(GenerateBatchJobAction), Action(InventoryControlAction), Action(ClusterInfoAction), Action(PoolListAction), Action(PoolInfoAction), Action(NodeListAction), Action(NodeInfoAction), Action(SetInfoAction), Action(DriveListAction), Action(DriveInfoAction), ), Resources: NewResourceSet(), Conditions: condition.NewFunctions(), }, }, }, }, { Name: "tablesReadWrite", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet( Action(S3TablesGetWarehouseAction), Action(S3TablesGetWarehouseEncryptionAction), Action(S3TablesGetWarehouseMaintenanceConfigurationAction), Action(S3TablesGetWarehousePolicyAction), Action(S3TablesListWarehousesAction), Action(S3TablesGetNamespaceAction), Action(S3TablesListNamespacesAction), Action(S3TablesUpdateNamespacePropertiesAction), Action(S3TablesGetTableAction), Action(S3TablesListTablesAction), Action(S3TablesGetTableDataAction), Action(S3TablesPutTableDataAction), Action(S3TablesGetTableEncryptionAction), Action(S3TablesGetTableMaintenanceConfigurationAction), Action(S3TablesGetTableMaintenanceJobStatusAction), Action(S3TablesGetTableMetadataLocationAction), Action(S3TablesGetTablePolicyAction), Action(S3TablesCreateTableAction), Action(S3TablesUpdateTableAction), Action(S3TablesUpdateTableMetadataLocationAction), Action(S3TablesRenameTableAction), Action(S3TablesRegisterTableAction), Action(S3TablesGetViewAction), Action(S3TablesListViewsAction), Action(S3TablesCreateViewAction), Action(S3TablesUpdateViewAction), Action(S3TablesRenameViewAction), Action(S3TablesDeleteViewAction), Action(S3TablesRegisterViewAction), Action(S3TablesGetFunctionAction), Action(S3TablesListFunctionsAction), Action(S3TablesCreateFunctionAction), Action(S3TablesUpdateFunctionAction), Action(S3TablesRenameFunctionAction), Action(S3TablesDeleteFunctionAction), Action(S3TablesRegisterFunctionAction), Action(S3TablesGetConfigAction), Action(S3TablesTableMetricsAction), ), Resources: NewResourceSet(NewS3TablesResource("*")), Conditions: condition.NewFunctions(), }, }, }, }, { Name: "tablesReadOnly", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet( Action(S3TablesGetWarehouseAction), Action(S3TablesGetWarehouseEncryptionAction), Action(S3TablesGetWarehouseMaintenanceConfigurationAction), Action(S3TablesGetWarehousePolicyAction), Action(S3TablesListWarehousesAction), Action(S3TablesGetNamespaceAction), Action(S3TablesListNamespacesAction), Action(S3TablesGetTableAction), Action(S3TablesListTablesAction), Action(S3TablesGetTableDataAction), Action(S3TablesGetTableEncryptionAction), Action(S3TablesGetTableMaintenanceConfigurationAction), Action(S3TablesGetTableMaintenanceJobStatusAction), Action(S3TablesGetTableMetadataLocationAction), Action(S3TablesGetTablePolicyAction), Action(S3TablesGetViewAction), Action(S3TablesListViewsAction), Action(S3TablesGetFunctionAction), Action(S3TablesListFunctionsAction), Action(S3TablesGetConfigAction), Action(S3TablesTableMetricsAction), ), Resources: NewResourceSet(NewS3TablesResource("*")), Conditions: condition.NewFunctions(), }, }, }, }, { Name: "replicationAdmin", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet( Action(SiteReplicationAddAction), Action(SiteReplicationDisableAction), Action(SiteReplicationRemoveAction), Action(SiteReplicationResyncAction), Action(SiteReplicationInfoAction), Action(SiteReplicationOperationAction), Action(TablesReplicationAddAction), Action(TablesReplicationRemoveAction), Action(TablesReplicationInfoAction), Action(TablesReplicationStartFailoverAction), Action(TablesReplicationCatalogAdminAction), Action(ReplicationDiff), ), Resources: NewResourceSet(), Conditions: condition.NewFunctions(), }, { SID: ID(""), Effect: Allow, Actions: NewActionSet( GetReplicationConfigurationAction, PutReplicationConfigurationAction, ResetBucketReplicationStateAction, GetObjectVersionForReplicationAction, ), Resources: NewResourceSet(NewResource("*")), Conditions: condition.NewFunctions(), }, }, }, }, { Name: "securityAuditAdmin", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet( Action(ListUsersAdminAction), Action(GetUserAdminAction), Action(ListGroupsAdminAction), Action(GetGroupAdminAction), Action(GetPolicyAdminAction), Action(ListUserPoliciesAdminAction), Action(ListServiceAccountsAdminAction), Action(ListTemporaryAccountsAdminAction), Action(ExportIAMAction), Action(SiteReplicationInfoAction), Action(TablesReplicationInfoAction), Action(ServerInfoAdminAction), Action(StorageInfoAdminAction), Action(DataUsageInfoAdminAction), Action(LicenseInfoAdminAction), Action(ClusterInfoAction), Action(PoolListAction), Action(PoolInfoAction), Action(NodeListAction), Action(NodeInfoAction), Action(SetInfoAction), Action(DriveListAction), Action(DriveInfoAction), Action(ProfilingAdminAction), Action(TraceAdminAction), Action(ConsoleLogAdminAction), Action(TopLocksAdminAction), Action(HealthInfoAdminAction), Action(BandwidthMonitorAction), Action(PrometheusAdminAction), ), Resources: NewResourceSet(), Conditions: condition.NewFunctions(), }, { SID: ID(""), Effect: Allow, Actions: NewActionSet( GetBucketPolicyAction, GetBucketLocationAction, GetBucketNotificationAction, GetBucketObjectLockConfigurationAction, GetBucketEncryptionAction, GetBucketTaggingAction, GetBucketVersioningAction, GetReplicationConfigurationAction, ), Resources: NewResourceSet(NewResource("*")), Conditions: condition.NewFunctions(), }, }, }, }, { Name: "consoleAdmin", Definition: Policy{ Version: DefaultVersion, Statements: []Statement{ { SID: ID(""), Effect: Allow, Actions: NewActionSet(Action(AllAdminActions)), Resources: NewResourceSet(), Conditions: condition.NewFunctions(), }, { SID: ID(""), Effect: Allow, Actions: NewActionSet(Action(AllKMSActions)), Resources: NewResourceSet(), Conditions: condition.NewFunctions(), }, { SID: ID(""), Effect: Allow, Actions: NewActionSet(AllActions), Resources: NewResourceSet(NewResource("*")), Conditions: condition.NewFunctions(), }, { SID: ID(""), Effect: Allow, Actions: NewActionSet(Action(AllS3TablesActions)), Resources: NewResourceSet(NewS3TablesResource("*")), Conditions: condition.NewFunctions(), }, }, }, }, }
DefaultPolicies - list of canned policies available in MinIO.
var IAMActionConditionKeyMap = createActionConditionKeyMap()
IAMActionConditionKeyMap - holds mapping of supported condition key for an action.
var MemoryActionConditionKeyMap = createMemoryActionConditionKeyMap()
MemoryActionConditionKeyMap - holds mapping of Memory actions to condition keys.
var SupportedActions = map[Action]struct{}{ AbortMultipartUploadAction: {}, CreateBucketAction: {}, DeleteBucketAction: {}, ForceDeleteBucketAction: {}, DeleteBucketPolicyAction: {}, DeleteBucketCorsAction: {}, DeleteObjectAction: {}, GetBucketLocationAction: {}, GetBucketNotificationAction: {}, GetBucketPolicyAction: {}, GetBucketCorsAction: {}, GetObjectAction: {}, HeadBucketAction: {}, ListAllMyBucketsAction: {}, ListBucketAction: {}, GetBucketPolicyStatusAction: {}, ListBucketVersionsAction: {}, ListBucketMultipartUploadsAction: {}, ListenNotificationAction: {}, ListenBucketNotificationAction: {}, ListMultipartUploadPartsAction: {}, PutBucketLifecycleAction: {}, GetBucketLifecycleAction: {}, PutBucketNotificationAction: {}, PutBucketPolicyAction: {}, PutBucketCorsAction: {}, PutBucketQOSAction: {}, GetBucketQOSAction: {}, PutObjectAction: {}, BypassGovernanceRetentionAction: {}, PutObjectRetentionAction: {}, GetObjectRetentionAction: {}, GetObjectLegalHoldAction: {}, PutObjectLegalHoldAction: {}, GetBucketObjectLockConfigurationAction: {}, PutBucketObjectLockConfigurationAction: {}, GetBucketTaggingAction: {}, PutBucketTaggingAction: {}, GetObjectVersionAction: {}, GetObjectAttributesAction: {}, GetObjectVersionAttributesAction: {}, GetObjectVersionTaggingAction: {}, DeleteObjectVersionAction: {}, DeleteObjectVersionTaggingAction: {}, PutObjectVersionTaggingAction: {}, GetObjectTaggingAction: {}, PutObjectTaggingAction: {}, DeleteObjectTaggingAction: {}, PutObjectAnnotationAction: {}, GetObjectAnnotationAction: {}, DeleteObjectAnnotationAction: {}, ListObjectAnnotationsAction: {}, UpdateObjectEncryptionAction: {}, PutBucketEncryptionAction: {}, GetBucketEncryptionAction: {}, PutBucketVersioningAction: {}, GetBucketVersioningAction: {}, GetReplicationConfigurationAction: {}, PutReplicationConfigurationAction: {}, ReplicateObjectAction: {}, ReplicateDeleteAction: {}, ReplicateTagsAction: {}, GetObjectVersionForReplicationAction: {}, ReplicateObjectAnnotationAction: {}, GetObjectVersionAnnotationForReplicationAction: {}, RestoreObjectAction: {}, ResetBucketReplicationStateAction: {}, PutObjectFanOutAction: {}, PutInventoryConfigurationAction: {}, GetInventoryConfigurationAction: {}, CreateSessionAction: {}, AllActions: {}, }
SupportedActions - list of all supported actions.
var SupportedAdminActions = map[AdminAction]struct{}{}/* 101 elements not displayed */
SupportedAdminActions - list of all supported admin actions.
var SupportedMemoryActions = map[MemoryAction]struct{}{ MemoryCreateCortexAction: {}, MemoryDeleteCortexAction: {}, MemoryGetCortexAction: {}, MemoryListCortexesAction: {}, MemoryPutSecretAction: {}, MemoryGetSecretAction: {}, MemoryDeleteSecretAction: {}, MemoryListSecretsAction: {}, MemorySearchAction: {}, AllMemoryActions: {}, }
SupportedMemoryActions - list of all supported AIStor Memory API actions.
var SupportedObjectActions = map[Action]struct{}{ AllActions: {}, AbortMultipartUploadAction: {}, DeleteObjectAction: {}, GetObjectAction: {}, ListMultipartUploadPartsAction: {}, PutObjectAction: {}, BypassGovernanceRetentionAction: {}, PutObjectRetentionAction: {}, GetObjectRetentionAction: {}, PutObjectLegalHoldAction: {}, GetObjectLegalHoldAction: {}, GetObjectTaggingAction: {}, PutObjectTaggingAction: {}, DeleteObjectTaggingAction: {}, PutObjectAnnotationAction: {}, GetObjectAnnotationAction: {}, DeleteObjectAnnotationAction: {}, ListObjectAnnotationsAction: {}, UpdateObjectEncryptionAction: {}, GetObjectVersionAction: {}, GetObjectVersionTaggingAction: {}, DeleteObjectVersionAction: {}, DeleteObjectVersionTaggingAction: {}, PutObjectVersionTaggingAction: {}, ReplicateObjectAction: {}, ReplicateDeleteAction: {}, ReplicateTagsAction: {}, GetObjectVersionForReplicationAction: {}, ReplicateObjectAnnotationAction: {}, GetObjectVersionAnnotationForReplicationAction: {}, RestoreObjectAction: {}, ResetBucketReplicationStateAction: {}, PutObjectFanOutAction: {}, GetObjectAttributesAction: {}, GetObjectVersionAttributesAction: {}, }
SupportedObjectActions - list of all supported object actions.
var SupportedTableActions = map[TableAction]struct{}{ S3TablesCreateNamespaceAction: {}, S3TablesCreateTableAction: {}, S3TablesCreateTableBucketAction: {}, S3TablesDeleteNamespaceAction: {}, S3TablesDeleteTableAction: {}, S3TablesDeleteTableBucketAction: {}, S3TablesDeleteTableBucketEncryptionAction: {}, S3TablesDeleteTableBucketPolicyAction: {}, S3TablesDeleteTablePolicyAction: {}, S3TablesGetNamespaceAction: {}, S3TablesGetTableAction: {}, S3TablesGetTableBucketAction: {}, S3TablesGetTableBucketEncryptionAction: {}, S3TablesGetTableBucketMaintenanceConfigurationAction: {}, S3TablesGetTableBucketPolicyAction: {}, S3TablesGetTableDataAction: {}, S3TablesGetTableEncryptionAction: {}, S3TablesGetTableMaintenanceConfigurationAction: {}, S3TablesGetTableMaintenanceJobStatusAction: {}, S3TablesGetTableMetadataLocationAction: {}, S3TablesGetTablePolicyAction: {}, S3TablesListNamespacesAction: {}, S3TablesListTableBucketsAction: {}, S3TablesListTablesAction: {}, S3TablesPutTableBucketEncryptionAction: {}, S3TablesPutTableBucketMaintenanceConfigurationAction: {}, S3TablesPutTableBucketPolicyAction: {}, S3TablesPutTableDataAction: {}, S3TablesPutTableEncryptionAction: {}, S3TablesPutTableMaintenanceConfigurationAction: {}, S3TablesPutTablePolicyAction: {}, S3TablesRegisterTableAction: {}, S3TablesRenameTableAction: {}, S3TablesUpdateTableMetadataLocationAction: {}, S3TablesCreateWarehouseAction: {}, S3TablesDeleteWarehouseAction: {}, S3TablesDeleteWarehouseEncryptionAction: {}, S3TablesDeleteWarehousePolicyAction: {}, S3TablesGetWarehouseAction: {}, S3TablesGetWarehouseEncryptionAction: {}, S3TablesGetWarehouseMaintenanceConfigurationAction: {}, S3TablesGetWarehousePolicyAction: {}, S3TablesListWarehousesAction: {}, S3TablesPutWarehouseEncryptionAction: {}, S3TablesPutWarehouseMaintenanceConfigurationAction: {}, S3TablesPutWarehousePolicyAction: {}, S3TablesGetConfigAction: {}, S3TablesTableMetricsAction: {}, S3TablesUpdateTableAction: {}, S3TablesCreateViewAction: {}, S3TablesDeleteViewAction: {}, S3TablesGetViewAction: {}, S3TablesRenameViewAction: {}, S3TablesUpdateViewAction: {}, S3TablesListViewsAction: {}, S3TablesRegisterViewAction: {}, S3TablesCreateFunctionAction: {}, S3TablesDeleteFunctionAction: {}, S3TablesGetFunctionAction: {}, S3TablesRenameFunctionAction: {}, S3TablesUpdateFunctionAction: {}, S3TablesListFunctionsAction: {}, S3TablesRegisterFunctionAction: {}, S3TablesUpdateNamespacePropertiesAction: {}, S3TablesTagWarehouseAction: {}, S3TablesUntagWarehouseAction: {}, S3TablesListTagsForWarehouseAction: {}, S3TablesTagTableAction: {}, S3TablesUntagTableAction: {}, S3TablesListTagsForTableAction: {}, AllS3TablesActions: {}, }
SupportedTableActions - list of all supported S3 Tables actions.
var SupportedVectorsActions = map[VectorsAction]struct{}{ S3VectorsCreateVectorBucketAction: {}, S3VectorsDeleteVectorBucketAction: {}, S3VectorsGetVectorBucketAction: {}, S3VectorsListVectorBucketsAction: {}, S3VectorsCreateIndexAction: {}, S3VectorsDeleteIndexAction: {}, S3VectorsGetIndexAction: {}, S3VectorsListIndexesAction: {}, S3VectorsPutVectorsAction: {}, S3VectorsGetVectorsAction: {}, S3VectorsDeleteVectorsAction: {}, S3VectorsListVectorsAction: {}, S3VectorsQueryVectorsAction: {}, AllS3VectorsActions: {}, }
SupportedVectorsActions - list of all supported S3 Vectors actions.
var VectorsActionConditionKeyMap = createVectorsActionConditionKeyMap()
VectorsActionConditionKeyMap - holds mapping of Vectors actions to condition keys.
Functions ¶
func Errorf ¶
Errorf - formats according to a format specifier and returns the string as a value that satisfies error of type policy.Error
func GetPoliciesFromClaims ¶
GetPoliciesFromClaims returns the list of policies to be applied for this incoming request, extracting the information from input JWT claims.
func GetValuesFromClaims ¶
GetValuesFromClaims returns the list of values for the input claimName. Supports values in following formats - string - comma separated values - string array
func IsAllowedPar ¶ added in v3.3.2
IsAllowedPar - checks if the given Args is allowed by any one of the given policies in parallel (when len(policies) > 100).
func IsAllowedSerial ¶ added in v3.3.2
IsAllowedSerial - checks if the given Args is allowed by any one of the given policies in serial.
This is currently the fastest implementation for our basic benchmark.
Types ¶
type Action ¶
type Action string
Action - policy action. Refer https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html for more information about available actions.
const ( // AbortMultipartUploadAction - AbortMultipartUpload Rest API action. AbortMultipartUploadAction Action = "s3:AbortMultipartUpload" // CreateBucketAction - CreateBucket Rest API action. CreateBucketAction Action = "s3:CreateBucket" // DeleteBucketAction - DeleteBucket Rest API action. DeleteBucketAction Action = "s3:DeleteBucket" // ForceDeleteBucketAction - DeleteBucket Rest API action when x-minio-force-delete flag // is specified. ForceDeleteBucketAction Action = "s3:ForceDeleteBucket" // DeleteBucketPolicyAction - DeleteBucketPolicy Rest API action. DeleteBucketPolicyAction Action = "s3:DeleteBucketPolicy" // DeleteBucketCorsAction - DeleteBucketCors Rest API action. DeleteBucketCorsAction Action = "s3:DeleteBucketCors" // DeleteObjectAction - DeleteObject Rest API action. DeleteObjectAction Action = "s3:DeleteObject" // GetBucketLocationAction - GetBucketLocation Rest API action. GetBucketLocationAction Action = "s3:GetBucketLocation" // GetBucketNotificationAction - GetBucketNotification Rest API action. GetBucketNotificationAction Action = "s3:GetBucketNotification" // GetBucketPolicyAction - GetBucketPolicy Rest API action. GetBucketPolicyAction Action = "s3:GetBucketPolicy" // GetBucketCorsAction - GetBucketCors Rest API action. GetBucketCorsAction Action = "s3:GetBucketCors" // GetObjectAction - GetObject Rest API action. GetObjectAction Action = "s3:GetObject" // GetObjectAttributesAction - GetObjectVersionAttributes Rest API action. GetObjectAttributesAction Action = "s3:GetObjectAttributes" // HeadBucketAction - HeadBucket Rest API action. This action is unused in minio. HeadBucketAction Action = "s3:HeadBucket" // ListAllMyBucketsAction - ListAllMyBuckets (List buckets) Rest API action. ListAllMyBucketsAction Action = "s3:ListAllMyBuckets" // ListBucketAction - ListBucket Rest API action. ListBucketAction Action = "s3:ListBucket" // GetBucketPolicyStatusAction - Retrieves the policy status for a bucket. GetBucketPolicyStatusAction Action = "s3:GetBucketPolicyStatus" // ListBucketVersionsAction - ListBucketVersions Rest API action. ListBucketVersionsAction Action = "s3:ListBucketVersions" // ListBucketMultipartUploadsAction - ListMultipartUploads Rest API action. ListBucketMultipartUploadsAction Action = "s3:ListBucketMultipartUploads" // ListenNotificationAction - ListenNotification Rest API action. // This is MinIO extension. ListenNotificationAction Action = "s3:ListenNotification" // ListenBucketNotificationAction - ListenBucketNotification Rest API action. // This is MinIO extension. ListenBucketNotificationAction Action = "s3:ListenBucketNotification" // ListMultipartUploadPartsAction - ListParts Rest API action. ListMultipartUploadPartsAction Action = "s3:ListMultipartUploadParts" // PutBucketLifecycleAction - PutBucketLifecycle Rest API action. PutBucketLifecycleAction Action = "s3:PutLifecycleConfiguration" // GetBucketLifecycleAction - GetBucketLifecycle Rest API action. GetBucketLifecycleAction Action = "s3:GetLifecycleConfiguration" // PutBucketNotificationAction - PutObjectNotification Rest API action. PutBucketNotificationAction Action = "s3:PutBucketNotification" // PutBucketPolicyAction - PutBucketPolicy Rest API action. PutBucketPolicyAction Action = "s3:PutBucketPolicy" // PutBucketCorsAction - PutBucketCors Rest API action. PutBucketCorsAction Action = "s3:PutBucketCors" // PutBucketQOSAction - allow set QOS configuration PutBucketQOSAction Action = "s3:PutBucketQOS" // GetBucketQOSAction - allow get QOS configuration GetBucketQOSAction Action = "s3:GetBucketQOS" // PutObjectAction - PutObject Rest API action. PutObjectAction Action = "s3:PutObject" // DeleteObjectVersionAction - DeleteObjectVersion Rest API action. DeleteObjectVersionAction Action = "s3:DeleteObjectVersion" // DeleteObjectVersionTaggingAction - DeleteObjectVersionTagging Rest API action. DeleteObjectVersionTaggingAction Action = "s3:DeleteObjectVersionTagging" // GetObjectVersionAction - GetObjectVersionAction Rest API action. GetObjectVersionAction Action = "s3:GetObjectVersion" // GetObjectVersionAttributesAction - GetObjectVersionAttributes Rest API action. GetObjectVersionAttributesAction Action = "s3:GetObjectVersionAttributes" // GetObjectVersionTaggingAction - GetObjectVersionTagging Rest API action. GetObjectVersionTaggingAction Action = "s3:GetObjectVersionTagging" // PutObjectVersionTaggingAction - PutObjectVersionTagging Rest API action. PutObjectVersionTaggingAction Action = "s3:PutObjectVersionTagging" // BypassGovernanceRetentionAction - bypass governance retention for PutObjectRetention, PutObject and DeleteObject Rest API action. BypassGovernanceRetentionAction Action = "s3:BypassGovernanceRetention" // PutObjectRetentionAction - PutObjectRetention Rest API action. PutObjectRetentionAction Action = "s3:PutObjectRetention" // GetObjectRetentionAction - GetObjectRetention, GetObject, HeadObject Rest API action. GetObjectRetentionAction Action = "s3:GetObjectRetention" // GetObjectLegalHoldAction - GetObjectLegalHold, GetObject Rest API action. GetObjectLegalHoldAction Action = "s3:GetObjectLegalHold" // PutObjectLegalHoldAction - PutObjectLegalHold, PutObject Rest API action. PutObjectLegalHoldAction Action = "s3:PutObjectLegalHold" // GetBucketObjectLockConfigurationAction - GetBucketObjectLockConfiguration Rest API action GetBucketObjectLockConfigurationAction Action = "s3:GetBucketObjectLockConfiguration" // PutBucketObjectLockConfigurationAction - PutBucketObjectLockConfiguration Rest API action PutBucketObjectLockConfigurationAction Action = "s3:PutBucketObjectLockConfiguration" // GetBucketTaggingAction - GetBucketTagging Rest API action GetBucketTaggingAction Action = "s3:GetBucketTagging" // PutBucketTaggingAction - PutBucketTagging Rest API action PutBucketTaggingAction Action = "s3:PutBucketTagging" // GetObjectTaggingAction - Get Object Tags API action GetObjectTaggingAction Action = "s3:GetObjectTagging" // PutObjectTaggingAction - Put Object Tags API action PutObjectTaggingAction Action = "s3:PutObjectTagging" // DeleteObjectTaggingAction - Delete Object Tags API action DeleteObjectTaggingAction Action = "s3:DeleteObjectTagging" // PutObjectAnnotationAction - PutObjectAnnotation API action PutObjectAnnotationAction Action = "s3:PutObjectAnnotation" // GetObjectAnnotationAction - GetObjectAnnotation API action GetObjectAnnotationAction Action = "s3:GetObjectAnnotation" // DeleteObjectAnnotationAction - DeleteObjectAnnotation API action DeleteObjectAnnotationAction Action = "s3:DeleteObjectAnnotation" // ListObjectAnnotationsAction - ListObjectAnnotations API action ListObjectAnnotationsAction Action = "s3:ListObjectAnnotations" // UpdateObjectEncryptionAction - UpdateObjectEncryption REST API action UpdateObjectEncryptionAction Action = "s3:UpdateObjectEncryption" // PutBucketEncryptionAction - PutBucketEncryption REST API action PutBucketEncryptionAction Action = "s3:PutEncryptionConfiguration" // GetBucketEncryptionAction - GetBucketEncryption REST API action GetBucketEncryptionAction Action = "s3:GetEncryptionConfiguration" // PutBucketVersioningAction - PutBucketVersioning REST API action PutBucketVersioningAction Action = "s3:PutBucketVersioning" // GetBucketVersioningAction - GetBucketVersioning REST API action GetBucketVersioningAction Action = "s3:GetBucketVersioning" // GetReplicationConfigurationAction - GetReplicationConfiguration REST API action GetReplicationConfigurationAction Action = "s3:GetReplicationConfiguration" // PutReplicationConfigurationAction - PutReplicationConfiguration REST API action PutReplicationConfigurationAction Action = "s3:PutReplicationConfiguration" // ReplicateObjectAction - ReplicateObject REST API action ReplicateObjectAction Action = "s3:ReplicateObject" // ReplicateDeleteAction - ReplicateDelete REST API action ReplicateDeleteAction Action = "s3:ReplicateDelete" // ReplicateTagsAction - ReplicateTags REST API action ReplicateTagsAction Action = "s3:ReplicateTags" // GetObjectVersionForReplicationAction - GetObjectVersionForReplication REST API action GetObjectVersionForReplicationAction Action = "s3:GetObjectVersionForReplication" // ReplicateObjectAnnotationAction - ReplicateObjectAnnotation REST API action ReplicateObjectAnnotationAction Action = "s3:ReplicateObjectAnnotation" // GetObjectVersionAnnotationForReplicationAction - GetObjectVersionAnnotationForReplication REST API action GetObjectVersionAnnotationForReplicationAction Action = "s3:GetObjectVersionAnnotationForReplication" // RestoreObjectAction - RestoreObject REST API action RestoreObjectAction Action = "s3:RestoreObject" // ResetBucketReplicationStateAction - MinIO extension API ResetBucketReplicationState to reset replication state // on a bucket ResetBucketReplicationStateAction Action = "s3:ResetBucketReplicationState" // PutObjectFanOutAction - PutObject like API action but allows PostUpload() fan-out. PutObjectFanOutAction Action = "s3:PutObjectFanOut" // PutInventoryConfigurationAction - Bucket inventory write operations actions PutInventoryConfigurationAction Action = "s3:PutInventoryConfiguration" // GetInventoryConfigurationAction - Bucket inventory read operations actions GetInventoryConfigurationAction Action = "s3:GetInventoryConfiguration" // CreateSessionAction - S3Express REST API action CreateSessionAction Action = "s3express:CreateSession" // AllActions - all API actions AllActions Action = "s3:*" )
func (Action) IsObjectAction ¶
IsObjectAction - returns whether action is object type or not.
type ActionConditionKeyMap ¶
ActionConditionKeyMap is alias for the map type used here.
type ActionSet ¶
type ActionSet map[Action]struct{}
ActionSet - set of actions.
func NewActionSet ¶
NewActionSet - creates new action set.
func NewActionStrings ¶ added in v3.2.2
NewActionStrings - creates new action set from strings.
func (ActionSet) Equals ¶
Equals - checks whether given action set is equal to current action set or not.
func (ActionSet) Intersection ¶
Intersection - returns actions available in both ActionSet.
func (ActionSet) MarshalJSON ¶
MarshalJSON - encodes ActionSet to JSON data.
func (ActionSet) ToAdminSlice ¶
func (actionSet ActionSet) ToAdminSlice() []AdminAction
ToAdminSlice - returns slice of admin actions from the action set.
func (ActionSet) ToKMSSlice ¶
ToKMSSlice - returns slice of kms actions from the action set.
func (ActionSet) ToMemorySlice ¶ added in v3.10.0
func (actionSet ActionSet) ToMemorySlice() []MemoryAction
ToMemorySlice - returns slice of Memory actions from the action set.
func (ActionSet) ToSTSSlice ¶
ToSTSSlice - returns slice of STS actions from the action set.
func (ActionSet) ToTableSlice ¶ added in v3.4.3
func (actionSet ActionSet) ToTableSlice() []TableAction
ToTableSlice - returns slice of table actions from the action set.
func (ActionSet) ToVectorsSlice ¶ added in v3.6.1
func (actionSet ActionSet) ToVectorsSlice() []VectorsAction
ToVectorsSlice - returns slice of vectors actions from the action set.
func (*ActionSet) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data to ActionSet.
func (ActionSet) ValidateAdmin ¶
ValidateAdmin checks if all actions are valid Admin actions
func (ActionSet) ValidateKMS ¶
ValidateKMS checks if all actions are valid KMS actions
func (ActionSet) ValidateMemory ¶ added in v3.10.0
ValidateMemory checks if all actions are valid Memory actions
func (ActionSet) ValidateSTS ¶
ValidateSTS checks if all actions are valid STS actions
func (ActionSet) ValidateTable ¶ added in v3.4.3
ValidateTable checks if all actions are valid Table actions
func (ActionSet) ValidateVectors ¶ added in v3.6.1
ValidateVectors checks if all actions are valid Vectors actions
type ActionType ¶ added in v3.10.1
type ActionType interface {
Action | AdminAction | STSAction | KMSAction | TableAction | VectorsAction | MemoryAction
}
ActionType constrains the set of policy action types. It lets generic helpers accept any typed action — S3 (Action), admin, STS, KMS, Tables, Vectors, or Memory — without forcing callers to convert to Action at each call site. A bare string is intentionally excluded so only real policy action types match.
type AdminAction ¶
type AdminAction string
AdminAction - admin policy action.
const ( // HealAdminAction - allows heal command HealAdminAction AdminAction = "admin:Heal" // DecommissionAdminAction - allows decomissioning of pools DecommissionAdminAction AdminAction = "admin:Decommission" // RebalanceAdminAction - allows rebalancing of pools RebalanceAdminAction AdminAction = "admin:Rebalance" // StorageInfoAdminAction - allow listing server info StorageInfoAdminAction AdminAction = "admin:StorageInfo" // PrometheusAdminAction - prometheus info action PrometheusAdminAction AdminAction = "admin:Prometheus" // DataUsageInfoAdminAction - allow listing data usage info DataUsageInfoAdminAction AdminAction = "admin:DataUsageInfo" // ForceUnlockAdminAction - allow force unlocking locks ForceUnlockAdminAction AdminAction = "admin:ForceUnlock" // TopLocksAdminAction - allow listing top locks TopLocksAdminAction AdminAction = "admin:TopLocksInfo" // ProfilingAdminAction - allow profiling ProfilingAdminAction AdminAction = "admin:Profiling" // TraceAdminAction - allow listing server trace TraceAdminAction AdminAction = "admin:ServerTrace" // ConsoleLogAdminAction - allow listing console logs on terminal ConsoleLogAdminAction AdminAction = "admin:ConsoleLog" // KMSEnableAdminAction - allow enabling the builtin KMS KMSEnableAdminAction AdminAction = "admin:KMSEnable" // KMSBackupAdminAction - allow backing up builtin KMS keys KMSBackupAdminAction AdminAction = "admin:KMSBackup" // KMSRestoreAdminAction - allow restoring builtin KMS keys KMSRestoreAdminAction AdminAction = "admin:KMSRestore" // KMSCreateKeyAdminAction - allow creating a new KMS master key KMSCreateKeyAdminAction AdminAction = "admin:KMSCreateKey" // KMSKeyStatusAdminAction - allow getting KMS key status KMSKeyStatusAdminAction AdminAction = "admin:KMSKeyStatus" // KMSKeyRotateAdminAction - allow rotating KMS keys KMSKeyRotateAdminAction AdminAction = "admin:KMSKeyRotate" // ServerInfoAdminAction - allow listing server info ServerInfoAdminAction AdminAction = "admin:ServerInfo" // HealthInfoAdminAction - allow obtaining cluster health information HealthInfoAdminAction AdminAction = "admin:OBDInfo" // LicenseInfoAdminAction - allow obtaining license information LicenseInfoAdminAction AdminAction = "admin:LicenseInfo" // BandwidthMonitorAction - allow monitoring bandwidth usage BandwidthMonitorAction AdminAction = "admin:BandwidthMonitor" // InspectDataAction - allows downloading raw files from backend InspectDataAction AdminAction = "admin:InspectData" // ServerUpdateAdminAction - allow MinIO binary update ServerUpdateAdminAction AdminAction = "admin:ServerUpdate" // ServiceRestartAdminAction - allow restart of MinIO service. ServiceRestartAdminAction AdminAction = "admin:ServiceRestart" // ServiceStopAdminAction - allow stopping MinIO service. ServiceStopAdminAction AdminAction = "admin:ServiceStop" // ServiceFreezeAdminAction - allow freeze/unfreeze MinIO service. ServiceFreezeAdminAction AdminAction = "admin:ServiceFreeze" // ServiceCordonAdminAction - allow cordon/uncordon MinIO service. ServiceCordonAdminAction AdminAction = "admin:ServiceCordon" // ConfigUpdateAdminAction - allow MinIO config management ConfigUpdateAdminAction AdminAction = "admin:ConfigUpdate" // CreateUserAdminAction - allow creating MinIO user CreateUserAdminAction AdminAction = "admin:CreateUser" // DeleteUserAdminAction - allow deleting MinIO user DeleteUserAdminAction AdminAction = "admin:DeleteUser" // ListUsersAdminAction - allow list users permission ListUsersAdminAction AdminAction = "admin:ListUsers" // EnableUserAdminAction - allow enable user permission EnableUserAdminAction AdminAction = "admin:EnableUser" // DisableUserAdminAction - allow disable user permission DisableUserAdminAction AdminAction = "admin:DisableUser" // GetUserAdminAction - allows GET permission on user info GetUserAdminAction AdminAction = "admin:GetUser" // ChangeMyPasswordAdminAction - allow changing own password ChangeMyPasswordAdminAction AdminAction = "admin:ChangeMyPassword" // SiteReplicationAddAction - allow adding clusters for site-level replication SiteReplicationAddAction AdminAction = "admin:SiteReplicationAdd" // SiteReplicationDisableAction - allow disabling a cluster from replication SiteReplicationDisableAction AdminAction = "admin:SiteReplicationDisable" // SiteReplicationRemoveAction - allow removing a cluster from replication SiteReplicationRemoveAction AdminAction = "admin:SiteReplicationRemove" // SiteReplicationResyncAction - allow resyncing cluster data to another site SiteReplicationResyncAction AdminAction = "admin:SiteReplicationResync" // SiteReplicationInfoAction - allow getting site replication info SiteReplicationInfoAction AdminAction = "admin:SiteReplicationInfo" // SiteReplicationOperationAction - allow performing site replication // create/update/delete operations to peers SiteReplicationOperationAction AdminAction = "admin:SiteReplicationOperation" // TablesReplicationAddAction - allow adding tables replication targets TablesReplicationAddAction AdminAction = "admin:TablesReplicationAdd" // TablesReplicationRemoveAction - allow removing tables replication targets TablesReplicationRemoveAction AdminAction = "admin:TablesReplicationRemove" // TablesReplicationInfoAction - allow getting tables replication info/status TablesReplicationInfoAction AdminAction = "admin:TablesReplicationInfo" // TablesReplicationStartFailoverAction - allow starting tables replication failover TablesReplicationStartFailoverAction AdminAction = "admin:TablesReplicationStartFailover" // TablesReplicationCatalogAdminAction - allow catalog debugging operations (reset, dump contents) TablesReplicationCatalogAdminAction AdminAction = "admin:TablesReplicationCatalogAdmin" // CreateServiceAccountAdminAction - allow create a service account for a user CreateServiceAccountAdminAction AdminAction = "admin:CreateServiceAccount" // UpdateServiceAccountAdminAction - allow updating a service account UpdateServiceAccountAdminAction AdminAction = "admin:UpdateServiceAccount" // RemoveServiceAccountAdminAction - allow removing a service account RemoveServiceAccountAdminAction AdminAction = "admin:RemoveServiceAccount" // ListServiceAccountsAdminAction - allow listing service accounts ListServiceAccountsAdminAction AdminAction = "admin:ListServiceAccounts" // ListTemporaryAccountsAdminAction - allow listing of temporary accounts ListTemporaryAccountsAdminAction AdminAction = "admin:ListTemporaryAccounts" // AddUserToGroupAdminAction - allow adding user to group permission AddUserToGroupAdminAction AdminAction = "admin:AddUserToGroup" // RemoveUserFromGroupAdminAction - allow removing user to group permission RemoveUserFromGroupAdminAction AdminAction = "admin:RemoveUserFromGroup" // GetGroupAdminAction - allow getting group info GetGroupAdminAction AdminAction = "admin:GetGroup" // ListGroupsAdminAction - allow list groups permission ListGroupsAdminAction AdminAction = "admin:ListGroups" // EnableGroupAdminAction - allow enable group permission EnableGroupAdminAction AdminAction = "admin:EnableGroup" // DisableGroupAdminAction - allow disable group permission DisableGroupAdminAction AdminAction = "admin:DisableGroup" // CreatePolicyAdminAction - allow create policy permission CreatePolicyAdminAction AdminAction = "admin:CreatePolicy" // DeletePolicyAdminAction - allow delete policy permission DeletePolicyAdminAction AdminAction = "admin:DeletePolicy" // GetPolicyAdminAction - allow get policy permission GetPolicyAdminAction AdminAction = "admin:GetPolicy" // AttachPolicyAdminAction - allows attaching a policy to a user/group AttachPolicyAdminAction AdminAction = "admin:AttachUserOrGroupPolicy" // UpdatePolicyAssociationAction - allows to add/remove policy association // on a user or group. UpdatePolicyAssociationAction AdminAction = "admin:UpdatePolicyAssociation" // ListUserPoliciesAdminAction - allows listing user policies ListUserPoliciesAdminAction AdminAction = "admin:ListUserPolicies" // SetBucketQuotaAdminAction - allow setting bucket quota SetBucketQuotaAdminAction AdminAction = "admin:SetBucketQuota" // GetBucketQuotaAdminAction - allow getting bucket quota GetBucketQuotaAdminAction AdminAction = "admin:GetBucketQuota" // SetBucketCompressionAdminAction - allow setting per-bucket compression config SetBucketCompressionAdminAction AdminAction = "admin:SetBucketCompression" // GetBucketCompressionAdminAction - allow getting per-bucket compression config GetBucketCompressionAdminAction AdminAction = "admin:GetBucketCompression" // SetBucketTargetAction - allow setting bucket target SetBucketTargetAction AdminAction = "admin:SetBucketTarget" // GetBucketTargetAction - allow getting bucket targets GetBucketTargetAction AdminAction = "admin:GetBucketTarget" // ReplicationDiff - allow computing the unreplicated objects in a bucket ReplicationDiff AdminAction = "admin:ReplicationDiff" // ImportBucketMetadataAction - allow importing bucket metadata ImportBucketMetadataAction AdminAction = "admin:ImportBucketMetadata" // ExportBucketMetadataAction - allow exporting bucket metadata ExportBucketMetadataAction AdminAction = "admin:ExportBucketMetadata" // SetTierAction - allow adding/editing a remote tier SetTierAction AdminAction = "admin:SetTier" // ListTierAction - allow listing remote tiers ListTierAction AdminAction = "admin:ListTier" // ExportIAMAction - allow exporting of all IAM info ExportIAMAction AdminAction = "admin:ExportIAM" // ImportIAMAction - allow importing IAM info to MinIO ImportIAMAction AdminAction = "admin:ImportIAM" // ListBatchJobsAction allow listing current active jobs ListBatchJobsAction AdminAction = "admin:ListBatchJobs" // DescribeBatchJobAction allow getting batch job YAML DescribeBatchJobAction AdminAction = "admin:DescribeBatchJob" // StartBatchJobAction allow submitting a batch job StartBatchJobAction AdminAction = "admin:StartBatchJob" // CancelBatchJobAction allow canceling a batch job CancelBatchJobAction AdminAction = "admin:CancelBatchJob" // GenerateBatchJobAction allow requesting batch job templates GenerateBatchJobAction AdminAction = "admin:GenerateBatchJob" // DistJobStatusAction allow viewing status of distributed jobs // (decommission and any future job type built on the same framework), // regardless of which job type is being queried. DistJobStatusAction AdminAction = "admin:DistJobStatus" // InventoryControlAction - allows control of inventory jobs InventoryControlAction AdminAction = "admin:InventoryControl" // ClusterInfoAction - allow cluster summary ClusterInfoAction AdminAction = "admin:ClusterInfo" // PoolListAction - allow list how many pools and summary per pool PoolListAction AdminAction = "admin:PoolList" // PoolInfoAction - allow pool specific summary and detail information PoolInfoAction AdminAction = "admin:PoolInfo" // NodeListAction - allow listing of nodes NodeListAction AdminAction = "admin:NodeList" // NodeInfoAction - allow node specific summary and detailed information NodeInfoAction AdminAction = "admin:NodeInfo" // SetInfoAction - allow set specific summary and detail SetInfoAction AdminAction = "admin:SetInfo" // DriveListAction - allow listing of drives DriveListAction AdminAction = "admin:DriveList" // DriveInfoAction - allow drive specific summary and detail DriveInfoAction AdminAction = "admin:DriveInfo" // DeltaSharingAdminAction - allow managing Delta Sharing shares and tokens DeltaSharingAdminAction AdminAction = "admin:DeltaSharing" DeltaSharingCreateShareAction AdminAction = "admin:DeltaSharingCreateShare" DeltaSharingDeleteShareAction AdminAction = "admin:DeltaSharingDeleteShare" DeltaSharingListSharesAction AdminAction = "admin:DeltaSharingListShares" DeltaSharingGetShareAction AdminAction = "admin:DeltaSharingGetShare" DeltaSharingUpdateShareAction AdminAction = "admin:DeltaSharingUpdateShare" // DeltaSharingCreateTokenAction - allow creating Delta Sharing tokens DeltaSharingCreateTokenAction AdminAction = "admin:DeltaSharingCreateToken" // DeltaSharingDeleteTokenAction - allow deleting Delta Sharing tokens DeltaSharingDeleteTokenAction AdminAction = "admin:DeltaSharingDeleteToken" // DeltaSharingListTokensAction - allow listing Delta Sharing tokens DeltaSharingListTokensAction AdminAction = "admin:DeltaSharingListTokens" // ReadAlertsAction - allow reading stored alerts ReadAlertsAction AdminAction = "admin:ReadAlerts" // ReadAPILogsAction - allow reading stored API logs ReadAPILogsAction AdminAction = "admin:ReadAPILogs" // ReadErrorLogsAction - allow reading stored error logs ReadErrorLogsAction AdminAction = "admin:ReadErrorLogs" // ReadAuditLogsAction - allow reading stored audit logs ReadAuditLogsAction AdminAction = "admin:ReadAuditLogs" // AllAdminActions - provides all admin permissions AllAdminActions AdminAction = "admin:*" )
func (AdminAction) HasResource ¶ added in v3.7.0
func (action AdminAction) HasResource() bool
HasResource reports whether this admin action operates on a bucket resource.
func (AdminAction) IsValid ¶
func (action AdminAction) IsValid() bool
IsValid - checks if action is valid or not.
func (AdminAction) Match ¶ added in v3.6.1
func (action AdminAction) Match(a AdminAction) bool
Match - matches action name with action pattern.
type Args ¶
type Args struct {
AccountName string `json:"account"`
Groups []string `json:"groups"`
Action Action `json:"action"`
OriginalAction Action `json:"originalAction"`
BucketName string `json:"bucket"`
ConditionValues map[string][]string `json:"conditions"`
IsOwner bool `json:"owner"`
ObjectName string `json:"object"`
Claims map[string]any `json:"claims"`
DenyOnly bool `json:"denyOnly"` // only applies deny
}
Args - arguments to policy to check whether it is allowed
func (Args) GetPolicies ¶
GetPolicies returns the list of policies to be applied for this incoming request, extracting the information from JWT claims.
func (Args) GetRoleArn ¶
GetRoleArn returns the role ARN from JWT claims if present. Otherwise returns empty string.
type BPStatement ¶
type BPStatement struct {
SID ID `json:"Sid,omitempty"`
Effect Effect `json:"Effect"`
Principal Principal `json:"Principal"`
Actions ActionSet `json:"Action"`
NotActions ActionSet `json:"NotAction,omitempty"`
Resources ResourceSet `json:"Resource"`
NotResources ResourceSet `json:"NotResource,omitempty"`
Conditions condition.Functions `json:"Condition,omitempty"`
}
BPStatement - policy statement.
func NewBPStatement ¶
func NewBPStatement(sid ID, effect Effect, principal Principal, actionSet ActionSet, resourceSet ResourceSet, conditions condition.Functions) BPStatement
NewBPStatement - creates new statement.
func NewBPStatementWithNotAction ¶
func NewBPStatementWithNotAction(sid ID, effect Effect, principal Principal, notActions ActionSet, resources ResourceSet, conditions condition.Functions) BPStatement
NewBPStatementWithNotAction - creates new statement with NotAction.
func NewBPStatementWithNotResource ¶ added in v3.0.23
func NewBPStatementWithNotResource(sid ID, effect Effect, principal Principal, actions ActionSet, notResources ResourceSet, conditions condition.Functions) BPStatement
NewBPStatementWithNotResource - creates new statement with NotResource.
func (BPStatement) Clone ¶
func (statement BPStatement) Clone() BPStatement
Clone clones Statement structure
func (BPStatement) Equals ¶
func (statement BPStatement) Equals(st BPStatement) bool
Equals checks if two statements are equal
func (BPStatement) IsAllowed ¶
func (statement BPStatement) IsAllowed(args BucketPolicyArgs) bool
IsAllowed - checks given policy args is allowed to continue the Rest API.
func (BPStatement) Validate ¶
func (statement BPStatement) Validate(bucketName string) error
Validate - validates Statement is for given bucket or not.
type BucketPolicy ¶
type BucketPolicy struct {
ID ID `json:"ID,omitempty"`
Version string
Statements []BPStatement `json:"Statement"`
}
BucketPolicy - bucket policy.
func ParseBucketPolicyConfig ¶
func ParseBucketPolicyConfig(reader io.Reader, bucketName string) (*BucketPolicy, error)
ParseBucketPolicyConfig - parses data in given reader to Policy.
func (*BucketPolicy) Equals ¶
func (policy *BucketPolicy) Equals(p BucketPolicy) bool
Equals returns true if the two policies are identical
func (BucketPolicy) IsAllowed ¶
func (policy BucketPolicy) IsAllowed(args BucketPolicyArgs) bool
IsAllowed - checks given policy args is allowed to continue the Rest API.
func (BucketPolicy) IsEmpty ¶
func (policy BucketPolicy) IsEmpty() bool
IsEmpty - returns whether policy is empty or not.
func (BucketPolicy) MarshalJSON ¶
func (policy BucketPolicy) MarshalJSON() ([]byte, error)
MarshalJSON - encodes Policy to JSON data.
func (*BucketPolicy) UnmarshalJSON ¶
func (policy *BucketPolicy) UnmarshalJSON(data []byte) error
UnmarshalJSON - decodes JSON data to Policy.
func (BucketPolicy) Validate ¶
func (policy BucketPolicy) Validate(bucketName string) error
Validate - validates all statements are for given bucket or not.
type BucketPolicyArgs ¶
type BucketPolicyArgs struct {
AccountName string `json:"account"`
Groups []string `json:"groups"`
Action Action `json:"action"`
BucketName string `json:"bucket"`
ConditionValues map[string][]string `json:"conditions"`
IsOwner bool `json:"owner"`
ObjectName string `json:"object"`
}
BucketPolicyArgs - arguments to policy to check whether it is allowed
type Decision ¶ added in v3.3.2
type Decision uint8
Decision is an enum type representing the decision made by the policy for the given arguments.
type Effect ¶
type Effect string
Effect - policy statement effect Allow or Deny.
const ( // Allow - allow effect. Allow Effect = "Allow" // Deny - deny effect. Deny = "Deny" )
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is the generic type for any error happening during policy parsing.
type KMSAction ¶
type KMSAction string
KMSAction - KMS policy action.
const ( // KMSCreateKeyAction - allow creating a new KMS master key KMSCreateKeyAction KMSAction = "kms:CreateKey" // KMSDeleteKeyAction - allow deleting a KMS master key KMSDeleteKeyAction KMSAction = "kms:DeleteKey" // KMSListKeysAction - allow getting list of KMS keys KMSListKeysAction KMSAction = "kms:ListKeys" // KMSImportKeyAction - allow importing KMS key KMSImportKeyAction KMSAction = "kms:ImportKey" // KMSDescribePolicyAction - allow getting KMS policy KMSDescribePolicyAction KMSAction = "kms:DescribePolicy" // KMSAssignPolicyAction - allow assigning an identity to a KMS policy KMSAssignPolicyAction KMSAction = "kms:AssignPolicy" // KMSDeletePolicyAction - allow deleting a policy KMSDeletePolicyAction KMSAction = "kms:DeletePolicy" // KMSSetPolicyAction - allow creating or updating a policy KMSSetPolicyAction KMSAction = "kms:SetPolicy" // KMSGetPolicyAction - allow getting a policy KMSGetPolicyAction KMSAction = "kms:GetPolicy" // KMSListPoliciesAction - allow getting list of KMS policies KMSListPoliciesAction KMSAction = "kms:ListPolicies" // KMSDescribeIdentityAction - allow getting KMS identity KMSDescribeIdentityAction KMSAction = "kms:DescribeIdentity" // KMSDescribeSelfIdentityAction - allow getting self KMS identity KMSDescribeSelfIdentityAction KMSAction = "kms:DescribeSelfIdentity" // KMSDeleteIdentityAction - allow deleting a policy KMSDeleteIdentityAction KMSAction = "kms:DeleteIdentity" // KMSListIdentitiesAction - allow getting list of KMS identities KMSListIdentitiesAction KMSAction = "kms:ListIdentities" // KMSKeyStatusAction - allow getting KMS key status KMSKeyStatusAction KMSAction = "kms:KeyStatus" // KMSStatusAction - allow getting KMS status KMSStatusAction KMSAction = "kms:Status" // KMSAPIAction - allow getting a list of supported API endpoints KMSAPIAction KMSAction = "kms:API" // KMSMetricsAction - allow getting server metrics in the Prometheus exposition format KMSMetricsAction KMSAction = "kms:Metrics" // KMSVersionAction - allow getting version information KMSVersionAction KMSAction = "kms:Version" // KMSAuditLogAction - subscribes to the audit log KMSAuditLogAction KMSAction = "kms:AuditLog" // KMSErrorLogAction - subscribes to the error log KMSErrorLogAction KMSAction = "kms:ErrorLog" // AllKMSActions - provides all admin permissions AllKMSActions KMSAction = "kms:*" )
type MemoryAction ¶ added in v3.10.0
type MemoryAction string
MemoryAction - AIStor Memory API policy action. The Memory API is a MinIO AIStor extension serving agent memory on a Cortex (Memory Bucket).
const ( // MemoryCreateCortexAction - create a Memory cortex (Memory Bucket). MemoryCreateCortexAction MemoryAction = "memory:CreateCortex" // MemoryDeleteCortexAction - delete a Memory cortex. MemoryDeleteCortexAction MemoryAction = "memory:DeleteCortex" // MemoryGetCortexAction - read a Memory cortex's metadata. MemoryGetCortexAction MemoryAction = "memory:GetCortex" // MemoryListCortexesAction - list Memory cortexes. MemoryListCortexesAction MemoryAction = "memory:ListCortexes" // MemoryPutSecretAction - write a secret in a cortex. MemoryPutSecretAction MemoryAction = "memory:PutSecret" // MemoryGetSecretAction - read a secret's decrypted value from a cortex. MemoryGetSecretAction MemoryAction = "memory:GetSecret" // MemoryDeleteSecretAction - delete a secret from a cortex. MemoryDeleteSecretAction MemoryAction = "memory:DeleteSecret" // MemoryListSecretsAction - list the secrets in a cortex. MemoryListSecretsAction MemoryAction = "memory:ListSecrets" // MemorySearchAction - search (corpus-grep) the objects in a cortex. MemorySearchAction MemoryAction = "memory:Search" // AllMemoryActions - all AIStor Memory API actions. AllMemoryActions MemoryAction = "memory:*" )
func (MemoryAction) IsValid ¶ added in v3.10.0
func (action MemoryAction) IsValid() bool
IsValid - checks if action is valid or not.
type Policy ¶
type Policy struct {
ID ID `json:"ID,omitempty"`
Version string
Statements []Statement `json:"Statement"`
// contains filtered or unexported fields
}
Policy - iam bucket iamp.
func MergePolicies ¶
MergePolicies merges all the given policies into a single policy dropping any duplicate statements.
func ParseConfig ¶
ParseConfig - parses data in given reader to Iamp.
func ParseConfigStrict ¶ added in v3.7.0
ParseConfigStrict parses and validates with strict rules. Use this when the server is creating or updating policies — it rejects constructs that Validate allows for backward compatibility.
func (*Policy) Decide ¶ added in v3.3.2
Decide - decides whether the given args is allowed or not. If no policy statement explicitly allows or denies the operation in the Args, it returns `noDecision`. It is upto the caller to handle such cases.
func (*Policy) HasDenyStatement ¶ added in v3.3.3
HasDenyStatement returns if the policy has a deny statement.
func (Policy) IsAllowedActions ¶
func (iamp Policy) IsAllowedActions(bucketName, objectName string, conditionValues map[string][]string) ActionSet
IsAllowedActions returns all supported actions for this policy.
func (Policy) MatchResource ¶
MatchResource matches resource with match resource patterns
func (*Policy) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data to Iamp.
func (Policy) ValidateStrict ¶ added in v3.7.0
ValidateStrict applies strict validation rules suitable for new policy creation. It rejects policies that would be accepted by Validate for backward compatibility but are invalid going forward (e.g. admin statements with both Resource and NotResource).
type Principal ¶
Principal - policy principal.
func NewPrincipal ¶
NewPrincipal - creates new Principal.
func (Principal) Intersection ¶
Intersection - returns principals available in both Principal.
func (Principal) MarshalJSON ¶
MarshalJSON - encodes Principal to JSON data.
func (*Principal) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data to Principal.
type Resource ¶
type Resource struct {
Pattern string
Type ResourceARNType
}
Resource - resource in policy statement.
func NewKMSResource ¶ added in v3.0.8
NewKMSResource - creates new resource with type KMS
func NewResource ¶
NewResource - creates new resource with the default ARN type of S3.
func NewS3TablesResource ¶ added in v3.6.0
NewS3TablesResource - creates new resource with type S3 Tables
func ParseResource ¶ added in v3.4.2
ParseResource - parses string to Resource.
func (Resource) MarshalJSON ¶
MarshalJSON - encodes Resource to JSON data.
func (Resource) Match ¶
Match - matches object name with resource pattern, including specific conditionals.
func (Resource) MatchResource ¶
MatchResource matches object name with resource pattern only.
func (*Resource) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data to Resource.
func (Resource) ValidateBucket ¶
ValidateBucket - validates that given bucketName is matched by Resource.
type ResourceARNType ¶ added in v3.0.8
type ResourceARNType uint32
ResourceARNType - ARN prefix type
const ( // ResourceARNS3 is the ARN prefix type for S3 resources. ResourceARNS3 ResourceARNType // ResourceARNS3Tables is the ARN prefix type for Amazon S3 Tables resources. ResourceARNS3Tables // ResourceARNKMS is the ARN prefix type for MinIO KMS resources. ResourceARNKMS // ResourceARNAll is the ARN '*' ResourceARNAll )
func (ResourceARNType) String ¶ added in v3.0.8
func (a ResourceARNType) String() string
type ResourceSet ¶
type ResourceSet map[Resource]struct{}
ResourceSet - set of resources in policy statement.
func NewResourceSet ¶
func NewResourceSet(resources ...Resource) ResourceSet
NewResourceSet - creates new resource set.
func NewResourceStrings ¶ added in v3.2.2
func NewResourceStrings(resources ...string) ResourceSet
NewResourceStrings - creates new resource set from strings
func (ResourceSet) Add ¶
func (resourceSet ResourceSet) Add(resource Resource)
Add - adds resource to resource set.
func (ResourceSet) BucketResourceExists ¶
func (resourceSet ResourceSet) BucketResourceExists() bool
BucketResourceExists - checks if at least one bucket resource exists in the set.
func (ResourceSet) Clone ¶
func (resourceSet ResourceSet) Clone() ResourceSet
Clone clones ResourceSet structure
func (ResourceSet) Equals ¶
func (resourceSet ResourceSet) Equals(sresourceSet ResourceSet) bool
Equals - checks whether given resource set is equal to current resource set or not.
func (ResourceSet) Intersection ¶
func (resourceSet ResourceSet) Intersection(sset ResourceSet) ResourceSet
Intersection - returns resources available in both ResourceSet.
func (ResourceSet) MarshalJSON ¶
func (resourceSet ResourceSet) MarshalJSON() ([]byte, error)
MarshalJSON - encodes ResourceSet to JSON data.
func (ResourceSet) Match ¶
func (resourceSet ResourceSet) Match(resource string, conditionValues map[string][]string) bool
Match - matches object name with anyone of resource pattern in resource set.
func (ResourceSet) MatchResource ¶
func (resourceSet ResourceSet) MatchResource(resource string) bool
MatchResource matches object name with resource patterns only.
func (ResourceSet) ObjectResourceExists ¶
func (resourceSet ResourceSet) ObjectResourceExists() bool
ObjectResourceExists - checks if at least one object resource exists in the set.
func (ResourceSet) String ¶
func (resourceSet ResourceSet) String() string
func (ResourceSet) ToSlice ¶
func (resourceSet ResourceSet) ToSlice() []Resource
ToSlice - returns slice of resources from the resource set.
func (*ResourceSet) UnmarshalJSON ¶
func (resourceSet *ResourceSet) UnmarshalJSON(data []byte) error
UnmarshalJSON - decodes JSON data to ResourceSet.
func (ResourceSet) ValidateBucket ¶
func (resourceSet ResourceSet) ValidateBucket(bucketName string) error
ValidateBucket - validates ResourceSet is for given bucket or not.
func (ResourceSet) ValidateKMS ¶ added in v3.0.8
func (resourceSet ResourceSet) ValidateKMS() error
ValidateKMS - validates ResourceSet is KMS.
func (ResourceSet) ValidateMemory ¶ added in v3.10.0
func (resourceSet ResourceSet) ValidateMemory() error
ValidateMemory - validates ResourceSet for the AIStor Memory API. A Memory cortex is an S3 bucket, so resources use S3 ARN format (e.g., arn:aws:s3:::my-cortex or arn:aws:s3:::my-cortex/*).
func (ResourceSet) ValidateS3 ¶ added in v3.0.8
func (resourceSet ResourceSet) ValidateS3() error
ValidateS3 - validates ResourceSet is S3.
func (ResourceSet) ValidateTable ¶ added in v3.4.3
func (resourceSet ResourceSet) ValidateTable() error
ValidateTable - validates ResourceSet is S3 Tables.
func (ResourceSet) ValidateVectors ¶ added in v3.6.1
func (resourceSet ResourceSet) ValidateVectors() error
ValidateVectors - validates ResourceSet for S3 Vectors. S3 Vectors uses S3 ARN format for resources (e.g., arn:aws:s3:::vectors-bucket/*).
type STSAction ¶
type STSAction string
STSAction - STS policy action.
const ( // AssumeRoleAction - use to deny or allow sts:AssumeRole action under specific conditions. AssumeRoleAction STSAction = "sts:AssumeRole" // AssumeRoleLDAPIdentityAction - use to deny or allow sts:AssumeRoleLDAPIdentity action under specific conditions. AssumeRoleLDAPIdentityAction STSAction = "sts:AssumeRoleLDAPIdentity" // AssumeRoleWithCustomTokenAction - use to deny or allow sts:AssumeRoleWithCustomToken action under specific conditions. AssumeRoleWithCustomTokenAction STSAction = "sts:AssumeRoleWithCustomToken" // AssumeRoleWithWebIdentityAction - use to deny or allow sts:AssumeRoleWithWebIdentity action under specific conditions. AssumeRoleWithWebIdentityAction STSAction = "sts:AssumeRoleWithWebIdentity" // AssumeRoleWithClientGrantsAction - use to deny or allow sts:AssumeRoleWithClientGrants action under specific conditions. AssumeRoleWithClientGrantsAction STSAction = "sts:AssumeRoleWithClientGrants" // AssumeRoleWithClientCertificateAction - use to deny or allow sts:AssumeRoleWithClientCertificate action under specific conditions. AssumeRoleWithClientCertificateAction STSAction = "sts:AssumeRoleWithClientCertificate" // AllSTSActions - select all STS actions AllSTSActions STSAction = "sts:*" )
type Statement ¶
type Statement struct {
SID ID `json:"Sid,omitempty"`
Effect Effect `json:"Effect"`
Actions ActionSet `json:"Action,omitempty"`
NotActions ActionSet `json:"NotAction,omitempty"`
Resources ResourceSet `json:"Resource,omitempty"`
NotResources ResourceSet `json:"NotResource,omitempty"`
Conditions condition.Functions `json:"Condition,omitempty"`
}
Statement - iam policy statement.
func NewStatement ¶
func NewStatement(sid ID, effect Effect, actionSet ActionSet, resourceSet ResourceSet, conditions condition.Functions) Statement
NewStatement - creates new statement.
func NewStatementWithNotAction ¶
func NewStatementWithNotAction(sid ID, effect Effect, notActions ActionSet, resources ResourceSet, conditions condition.Functions) Statement
NewStatementWithNotAction - creates new statement with NotAction.
func NewStatementWithNotResource ¶ added in v3.0.28
func NewStatementWithNotResource(sid ID, effect Effect, actions ActionSet, notResources ResourceSet, conditions condition.Functions) Statement
NewStatementWithNotResource - creates new statement with NotAction.
func (Statement) IsAllowed ¶
IsAllowed - checks given policy args is allowed to continue the Rest API.
func (Statement) IsAllowedPtr ¶ added in v3.3.2
IsAllowedPtr - checks given policy args is allowed to continue the Rest API.
func (Statement) ValidateStrict ¶ added in v3.7.0
ValidateStrict validates the statement with strict rules suitable for new policy creation. See isValidStrict for details.
type TableAction ¶ added in v3.4.3
type TableAction string
TableAction - S3 Tables policy action.
const ( // S3TablesCreateNamespaceAction maps to the AWS `CreateNamespace` S3 Tables action. S3TablesCreateNamespaceAction TableAction = "s3tables:CreateNamespace" // S3TablesCreateTableAction maps to the AWS `CreateTable` S3 Tables action. S3TablesCreateTableAction TableAction = "s3tables:CreateTable" // S3TablesDeleteNamespaceAction maps to the AWS `DeleteNamespace` S3 Tables action. S3TablesDeleteNamespaceAction TableAction = "s3tables:DeleteNamespace" // S3TablesDeleteTableAction maps to the AWS `DeleteTable` S3 Tables action. S3TablesDeleteTableAction TableAction = "s3tables:DeleteTable" // S3TablesDeleteTablePolicyAction maps to the AWS `DeleteTablePolicy` S3 Tables action. S3TablesDeleteTablePolicyAction TableAction = "s3tables:DeleteTablePolicy" // S3TablesGetNamespaceAction maps to the AWS `GetNamespace` S3 Tables action. S3TablesGetNamespaceAction TableAction = "s3tables:GetNamespace" // S3TablesGetTableAction maps to the AWS `GetTable` S3 Tables action. S3TablesGetTableAction TableAction = "s3tables:GetTable" // S3TablesGetTableDataAction maps to the AWS `GetTableData` S3 Tables action. S3TablesGetTableDataAction TableAction = "s3tables:GetTableData" // S3TablesGetTableEncryptionAction maps to the AWS `GetTableEncryption` S3 Tables action. S3TablesGetTableEncryptionAction TableAction = "s3tables:GetTableEncryption" // S3TablesGetTableMaintenanceConfigurationAction maps to the AWS `GetTableMaintenanceConfiguration` S3 Tables action. S3TablesGetTableMaintenanceConfigurationAction TableAction = "s3tables:GetTableMaintenanceConfiguration" // S3TablesGetTableMaintenanceJobStatusAction maps to the AWS `GetTableMaintenanceJobStatus` S3 Tables action. S3TablesGetTableMaintenanceJobStatusAction TableAction = "s3tables:GetTableMaintenanceJobStatus" // S3TablesGetTableMetadataLocationAction maps to the AWS `GetTableMetadataLocation` S3 Tables action. S3TablesGetTableMetadataLocationAction TableAction = "s3tables:GetTableMetadataLocation" // S3TablesGetTablePolicyAction maps to the AWS `GetTablePolicy` S3 Tables action. S3TablesGetTablePolicyAction TableAction = "s3tables:GetTablePolicy" // S3TablesListNamespacesAction maps to the AWS `ListNamespaces` S3 Tables action. S3TablesListNamespacesAction TableAction = "s3tables:ListNamespaces" // S3TablesListTablesAction maps to the AWS `ListTables` S3 Tables action. S3TablesListTablesAction TableAction = "s3tables:ListTables" // S3TablesPutTableDataAction maps to the AWS `PutTableData` S3 Tables action. S3TablesPutTableDataAction TableAction = "s3tables:PutTableData" // S3TablesPutTableEncryptionAction maps to the AWS `PutTableEncryption` S3 Tables action. S3TablesPutTableEncryptionAction TableAction = "s3tables:PutTableEncryption" // S3TablesPutTableMaintenanceConfigurationAction maps to the AWS `PutTableMaintenanceConfiguration` S3 Tables action. S3TablesPutTableMaintenanceConfigurationAction TableAction = "s3tables:PutTableMaintenanceConfiguration" // S3TablesPutTablePolicyAction maps to the AWS `PutTablePolicy` S3 Tables action. S3TablesPutTablePolicyAction TableAction = "s3tables:PutTablePolicy" // S3TablesRegisterTableAction maps to the AWS `RegisterTable` S3 Tables action. S3TablesRegisterTableAction TableAction = "s3tables:RegisterTable" // S3TablesRenameTableAction maps to the AWS `RenameTable` S3 Tables action. S3TablesRenameTableAction TableAction = "s3tables:RenameTable" // S3TablesUpdateTableMetadataLocationAction maps to the AWS `UpdateTableMetadataLocation` S3 Tables action. S3TablesUpdateTableMetadataLocationAction TableAction = "s3tables:UpdateTableMetadataLocation" // S3TablesCreateWarehouseAction is a MinIO extension for Iceberg warehouse provisioning. S3TablesCreateWarehouseAction TableAction = "s3tables:CreateWarehouse" // S3TablesCreateTableBucketAction maps to the AWS `CreateTableBucket` S3 Tables action. // Prefer using S3TablesCreateWarehouseAction instead. S3TablesCreateTableBucketAction TableAction = "s3tables:CreateTableBucket" // S3TablesDeleteWarehouseAction is a MinIO extension for deleting Iceberg warehouses. S3TablesDeleteWarehouseAction TableAction = "s3tables:DeleteWarehouse" // S3TablesDeleteTableBucketAction maps to the AWS `DeleteTableBucket` S3 Tables action. // Prefer using S3TablesDeleteWarehouseAction instead. S3TablesDeleteTableBucketAction TableAction = "s3tables:DeleteTableBucket" // S3TablesDeleteWarehouseEncryptionAction is a MinIO extension for deleting warehouse encryption configuration. S3TablesDeleteWarehouseEncryptionAction TableAction = "s3tables:DeleteWarehouseEncryption" // S3TablesDeleteTableBucketEncryptionAction maps to the AWS `DeleteTableBucketEncryption` S3 Tables action. // Prefer using S3TablesDeleteWarehouseEncryptionAction instead. S3TablesDeleteTableBucketEncryptionAction TableAction = "s3tables:DeleteTableBucketEncryption" // S3TablesDeleteWarehousePolicyAction is a MinIO extension for deleting warehouse policies. S3TablesDeleteWarehousePolicyAction TableAction = "s3tables:DeleteWarehousePolicy" // S3TablesDeleteTableBucketPolicyAction maps to the AWS `DeleteTableBucketPolicy` S3 Tables action. // Prefer using S3TablesDeleteWarehousePolicyAction instead. S3TablesDeleteTableBucketPolicyAction TableAction = "s3tables:DeleteTableBucketPolicy" // S3TablesGetWarehouseAction is a MinIO extension for retrieving warehouse details. S3TablesGetWarehouseAction TableAction = "s3tables:GetWarehouse" // S3TablesGetTableBucketAction maps to the AWS `GetTableBucket` S3 Tables action. // Prefer using S3TablesGetWarehouseAction instead. S3TablesGetTableBucketAction TableAction = "s3tables:GetTableBucket" // S3TablesGetWarehouseEncryptionAction is a MinIO extension for retrieving warehouse encryption configuration. S3TablesGetWarehouseEncryptionAction TableAction = "s3tables:GetWarehouseEncryption" // S3TablesGetTableBucketEncryptionAction maps to the AWS `GetTableBucketEncryption` S3 Tables action. // Prefer using S3TablesGetWarehouseEncryptionAction instead. S3TablesGetTableBucketEncryptionAction TableAction = "s3tables:GetTableBucketEncryption" // S3TablesGetWarehouseMaintenanceConfigurationAction is a MinIO extension for retrieving warehouse maintenance configuration. S3TablesGetWarehouseMaintenanceConfigurationAction TableAction = "s3tables:GetWarehouseMaintenanceConfiguration" // S3TablesGetTableBucketMaintenanceConfigurationAction maps to the AWS `GetTableBucketMaintenanceConfiguration` S3 Tables action. // Prefer using S3TablesGetWarehouseMaintenanceConfigurationAction instead. S3TablesGetTableBucketMaintenanceConfigurationAction TableAction = "s3tables:GetTableBucketMaintenanceConfiguration" // S3TablesGetWarehousePolicyAction is a MinIO extension for retrieving warehouse policies. S3TablesGetWarehousePolicyAction TableAction = "s3tables:GetWarehousePolicy" // S3TablesGetTableBucketPolicyAction maps to the AWS `GetTableBucketPolicy` S3 Tables action. // Prefer using S3TablesGetWarehousePolicyAction instead. S3TablesGetTableBucketPolicyAction TableAction = "s3tables:GetTableBucketPolicy" // S3TablesListWarehousesAction is a MinIO extension for listing Iceberg warehouses. S3TablesListWarehousesAction TableAction = "s3tables:ListWarehouses" // S3TablesListTableBucketsAction maps to the AWS `ListTableBuckets` S3 Tables action. // Prefer using S3TablesListWarehousesAction instead. S3TablesListTableBucketsAction TableAction = "s3tables:ListTableBuckets" // S3TablesPutWarehouseEncryptionAction is a MinIO extension for setting warehouse encryption configuration. S3TablesPutWarehouseEncryptionAction TableAction = "s3tables:PutWarehouseEncryption" // S3TablesPutTableBucketEncryptionAction maps to the AWS `PutTableBucketEncryption` S3 Tables action. // Prefer using S3TablesPutWarehouseEncryptionAction instead. S3TablesPutTableBucketEncryptionAction TableAction = "s3tables:PutTableBucketEncryption" // S3TablesPutWarehouseMaintenanceConfigurationAction is a MinIO extension for setting warehouse maintenance configuration. S3TablesPutWarehouseMaintenanceConfigurationAction TableAction = "s3tables:PutWarehouseMaintenanceConfiguration" // S3TablesPutTableBucketMaintenanceConfigurationAction maps to the AWS `PutTableBucketMaintenanceConfiguration` S3 Tables action. // Prefer using S3TablesPutWarehouseMaintenanceConfigurationAction instead. S3TablesPutTableBucketMaintenanceConfigurationAction TableAction = "s3tables:PutTableBucketMaintenanceConfiguration" // S3TablesPutWarehousePolicyAction is a MinIO extension for setting warehouse policies. S3TablesPutWarehousePolicyAction TableAction = "s3tables:PutWarehousePolicy" // S3TablesPutTableBucketPolicyAction maps to the AWS `PutTableBucketPolicy` S3 Tables action. // Prefer using S3TablesPutWarehousePolicyAction instead. S3TablesPutTableBucketPolicyAction TableAction = "s3tables:PutTableBucketPolicy" // S3TablesGetConfigAction is a MinIO extension for retrieving catalog configuration. S3TablesGetConfigAction TableAction = "s3tables:GetConfig" // S3TablesTableMetricsAction is a MinIO extension exposing table metrics. S3TablesTableMetricsAction TableAction = "s3tables:TableMetrics" // S3TablesUpdateTableAction is a MinIO extension for Iceberg-compatible table updates. S3TablesUpdateTableAction TableAction = "s3tables:UpdateTable" // S3TablesCreateViewAction is a MinIO extension for creating Iceberg views. S3TablesCreateViewAction TableAction = "s3tables:CreateView" // S3TablesDeleteViewAction is a MinIO extension for deleting Iceberg views. S3TablesDeleteViewAction TableAction = "s3tables:DeleteView" // S3TablesGetViewAction is a MinIO extension for retrieving Iceberg views. S3TablesGetViewAction TableAction = "s3tables:GetView" // S3TablesRenameViewAction is a MinIO extension for renaming Iceberg views. S3TablesRenameViewAction TableAction = "s3tables:RenameView" // S3TablesUpdateViewAction is a MinIO extension for updating Iceberg views. S3TablesUpdateViewAction TableAction = "s3tables:UpdateView" // S3TablesListViewsAction is a MinIO extension for listing Iceberg views. S3TablesListViewsAction TableAction = "s3tables:ListViews" // S3TablesRegisterViewAction is a MinIO extension for registering Iceberg views. S3TablesRegisterViewAction TableAction = "s3tables:RegisterView" // S3TablesCreateFunctionAction is a MinIO extension for creating Iceberg functions (SQL UDFs). S3TablesCreateFunctionAction TableAction = "s3tables:CreateFunction" // S3TablesDeleteFunctionAction is a MinIO extension for deleting Iceberg functions (SQL UDFs). S3TablesDeleteFunctionAction TableAction = "s3tables:DeleteFunction" // S3TablesGetFunctionAction is a MinIO extension for retrieving Iceberg functions (SQL UDFs). S3TablesGetFunctionAction TableAction = "s3tables:GetFunction" // S3TablesRenameFunctionAction is a MinIO extension for renaming Iceberg functions (SQL UDFs). S3TablesRenameFunctionAction TableAction = "s3tables:RenameFunction" // S3TablesUpdateFunctionAction is a MinIO extension for updating Iceberg functions (SQL UDFs). S3TablesUpdateFunctionAction TableAction = "s3tables:UpdateFunction" // S3TablesListFunctionsAction is a MinIO extension for listing Iceberg functions (SQL UDFs). S3TablesListFunctionsAction TableAction = "s3tables:ListFunctions" // S3TablesRegisterFunctionAction is a MinIO extension for registering Iceberg functions (SQL UDFs). S3TablesRegisterFunctionAction TableAction = "s3tables:RegisterFunction" // S3TablesUpdateNamespacePropertiesAction is a MinIO extension for updating namespace properties. S3TablesUpdateNamespacePropertiesAction TableAction = "s3tables:UpdateNamespaceProperties" // S3TablesTagWarehouseAction is a MinIO extension for tagging Iceberg warehouses. S3TablesTagWarehouseAction TableAction = "s3tables:TagWarehouse" // S3TablesUntagWarehouseAction is a MinIO extension for removing tags from Iceberg warehouses. S3TablesUntagWarehouseAction TableAction = "s3tables:UntagWarehouse" // S3TablesListTagsForWarehouseAction is a MinIO extension for listing tags on Iceberg warehouses. S3TablesListTagsForWarehouseAction TableAction = "s3tables:ListTagsForWarehouse" // S3TablesTagTableAction is a MinIO extension for tagging tables. S3TablesTagTableAction TableAction = "s3tables:TagTable" // S3TablesUntagTableAction is a MinIO extension for removing tags from tables. S3TablesUntagTableAction TableAction = "s3tables:UntagTable" // S3TablesListTagsForTableAction is a MinIO extension for listing tags on tables. S3TablesListTagsForTableAction TableAction = "s3tables:ListTagsForTable" // AllS3TablesActions - all Amazon S3 Tables actions AllS3TablesActions TableAction = "s3tables:*" )
func (TableAction) IsValid ¶ added in v3.4.3
func (action TableAction) IsValid() bool
IsValid - checks if action is valid or not.
type VectorsAction ¶ added in v3.6.1
type VectorsAction string
VectorsAction - S3 Vectors policy action.
const ( // S3VectorsCreateVectorBucketAction maps to the AWS `CreateVectorBucket` S3 Vectors action. S3VectorsCreateVectorBucketAction VectorsAction = "s3vectors:CreateVectorBucket" // S3VectorsDeleteVectorBucketAction maps to the AWS `DeleteVectorBucket` S3 Vectors action. S3VectorsDeleteVectorBucketAction VectorsAction = "s3vectors:DeleteVectorBucket" // S3VectorsGetVectorBucketAction maps to the AWS `GetVectorBucket` S3 Vectors action. S3VectorsGetVectorBucketAction VectorsAction = "s3vectors:GetVectorBucket" // S3VectorsListVectorBucketsAction maps to the AWS `ListVectorBuckets` S3 Vectors action. S3VectorsListVectorBucketsAction VectorsAction = "s3vectors:ListVectorBuckets" // S3VectorsCreateIndexAction maps to the AWS `CreateIndex` S3 Vectors action. S3VectorsCreateIndexAction VectorsAction = "s3vectors:CreateIndex" // S3VectorsDeleteIndexAction maps to the AWS `DeleteIndex` S3 Vectors action. S3VectorsDeleteIndexAction VectorsAction = "s3vectors:DeleteIndex" // S3VectorsGetIndexAction maps to the AWS `GetIndex` S3 Vectors action. S3VectorsGetIndexAction VectorsAction = "s3vectors:GetIndex" // S3VectorsListIndexesAction maps to the AWS `ListIndexes` S3 Vectors action. S3VectorsListIndexesAction VectorsAction = "s3vectors:ListIndexes" // S3VectorsPutVectorsAction maps to the AWS `PutVectors` S3 Vectors action. S3VectorsPutVectorsAction VectorsAction = "s3vectors:PutVectors" // S3VectorsGetVectorsAction maps to the AWS `GetVectors` S3 Vectors action. S3VectorsGetVectorsAction VectorsAction = "s3vectors:GetVectors" // S3VectorsDeleteVectorsAction maps to the AWS `DeleteVectors` S3 Vectors action. S3VectorsDeleteVectorsAction VectorsAction = "s3vectors:DeleteVectors" // S3VectorsListVectorsAction maps to the AWS `ListVectors` S3 Vectors action. S3VectorsListVectorsAction VectorsAction = "s3vectors:ListVectors" // S3VectorsQueryVectorsAction maps to the AWS `QueryVectors` S3 Vectors action. S3VectorsQueryVectorsAction VectorsAction = "s3vectors:QueryVectors" // AllS3VectorsActions - all Amazon S3 Vectors actions AllS3VectorsActions VectorsAction = "s3vectors:*" )
func (VectorsAction) IsValid ¶ added in v3.6.1
func (action VectorsAction) IsValid() bool
IsValid - checks if action is valid or not.