minio

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 39 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LDAPGroupDistinguishedNamePattern = regexp.MustCompile(`^(?:((?:(?:CN|OU)=[^,]+,?)+),)+((?:DC=[^,]+,?)+)$`)
	StaticGroupNamePattern            = regexp.MustCompile(`^[0-9A-Za-z=,.@\-_+]+$`)
)
View Source
var (
	LDAPUserDistinguishedNamePattern = regexp.MustCompile(`^(?:(CN=([^,]*)),)+(?:((?:(?:CN|OU)=[^,]+,?)+),)+((?:DC=[^,]+,?)+)$`)
	StaticUserNamePattern            = regexp.MustCompile(`^[0-9A-Za-z=,.@\-_+]+$`)
)

Functions

func Contains

func Contains(slice []string, item string) bool

Contains check that an array has the given element

func Encode

func Encode(value []byte) []byte

Encode queues message

func Filter added in v1.17.0

func Filter(slice []string, item string) ([]string, bool)

func HashcodeString added in v1.3.0

func HashcodeString(s string) int

HashcodeString hashes a string to a unique hashcode.

crc32 returns a `uint32`, but for our use we need a non-negative integer. Here we cast to an integer and invert it if the result is negative.

func NewResourceError

func NewResourceError(msg string, resource string, err interface{}) diag.Diagnostics

NewResourceError creates a new error with the given msg argument.

func NewResourceErrorStr added in v1.3.0

func NewResourceErrorStr(msg string, resource string, err interface{}) string

NewResourceErrorStr creates a new error with the given msg argument.

func Provider

func Provider() *schema.Provider

Provider creates a new provider

Types

type BucketPolicy

type BucketPolicy struct {
	Version    string             `json:",omitempty"`
	ID         string             `json:",omitempty"`
	Statements []policy.Statement `json:"Statement"`
}

BucketPolicy defines bucket policy

func PublicPolicy

func PublicPolicy(bucket *S3MinioBucket) BucketPolicy

PublicPolicy returns policy where everyone can fully list/modify objects

func ReadOnlyPolicy

func ReadOnlyPolicy(bucket *S3MinioBucket) BucketPolicy

ReadOnlyPolicy returns policy where objects can be listed and read

func ReadWritePolicy

func ReadWritePolicy(bucket *S3MinioBucket) BucketPolicy

ReadWritePolicy returns a policy where objects can be uploaded and read

func WriteOnlyPolicy

func WriteOnlyPolicy(bucket *S3MinioBucket) BucketPolicy

WriteOnlyPolicy returns policy where objects can be listed and written

type ConditionKeyMap

type ConditionKeyMap map[string]set.StringSet

ConditionKeyMap - map of policy condition key and value.

func CopyConditionKeyMap

func CopyConditionKeyMap(condKeyMap ConditionKeyMap) ConditionKeyMap

CopyConditionKeyMap - returns new copy of given ConditionKeyMap.

func (ConditionKeyMap) Add

func (ckm ConditionKeyMap) Add(key string, value set.StringSet)

Add - adds key and value. The value is appended If key already exists.

func (ConditionKeyMap) Remove

func (ckm ConditionKeyMap) Remove(key string, value set.StringSet)

Remove - removes value of given key. If key has empty after removal, the key is also removed.

func (ConditionKeyMap) RemoveKey

func (ckm ConditionKeyMap) RemoveKey(key string)

RemoveKey - removes key and its value.

type ConditionMap

type ConditionMap map[string]ConditionKeyMap

ConditionMap - map of condition and conditional values.

func (ConditionMap) Add

func (cond ConditionMap) Add(condKey string, condKeyMap ConditionKeyMap)

Add - adds condition key and condition value. The value is appended if key already exists.

func (ConditionMap) Remove

func (cond ConditionMap) Remove(condKey string)

Remove - removes condition key and its value.

type IAMPolicyDoc

type IAMPolicyDoc struct {
	Version    string                `json:"Version,omitempty"`
	ID         string                `json:"Id,omitempty"`
	Statements []*IAMPolicyStatement `json:"Statement"`
}

IAMPolicyDoc returns IAM policy

type IAMPolicyStatement

type IAMPolicyStatement struct {
	Sid        string
	Effect     string      `json:",omitempty"`
	Actions    interface{} `json:"Action,omitempty"`
	Resources  interface{} `json:"Resource,omitempty"`
	Principal  string      `json:"Principal,omitempty"`
	Conditions interface{} `json:"Condition,omitempty"`
}

IAMPolicyStatement returns IAM policy statement

type IAMPolicyStatementCondition

type IAMPolicyStatementCondition struct {
	Test     string `json:"-"`
	Variable string `json:"-"`
	Values   interface{}
}

IAMPolicyStatementCondition returns IAM policy condition

type IAMPolicyStatementConditionSet

type IAMPolicyStatementConditionSet []IAMPolicyStatementCondition

IAMPolicyStatementConditionSet returns IAM policy condition set

type MutexKV added in v1.17.1

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

MutexKV is a simple key/value store for arbitrary mutexes. It can be used to serialize changes across arbitrary collaborators that share knowledge of the keys they must serialize on.

The initial use case is to let aws_security_group_rule resources serialize their access to individual security groups based on SG ID.

func NewMutexKV added in v1.17.1

func NewMutexKV() *MutexKV

Returns a properly initialized MutexKV

func (*MutexKV) Lock added in v1.17.1

func (m *MutexKV) Lock(key string)

Locks the mutex for the given key. Caller is responsible for calling Unlock for the same key

func (*MutexKV) Unlock added in v1.17.1

func (m *MutexKV) Unlock(key string)

Unlock the mutex for the given key. Caller must have called Lock for the same key first

type Princ

type Princ struct {
	AWS           set.StringSet `json:"AWS,omitempty"`
	CanonicalUser set.StringSet `json:"CanonicalUser,omitempty"`
}

Princ defines policy princ

type ResponseError

type ResponseError struct {
	Code       string `json:"Code,omitempty"`
	Message    string `json:"Message,omitempty"`
	BucketName string `json:"BucketName,omitempty"`
	Region     string `json:"Region,omitempty"`
}

ResponseError handles error message

type S3MinioBucket

type S3MinioBucket struct {
	MinioClient          *minio.Client
	MinioAdmin           *madmin.AdminClient
	MinioRegion          string
	MinioBucket          string
	MinioBucketPrefix    string
	MinioACL             string
	MinioAccess          string
	MinioForceDestroy    bool
	ObjectLockingEnabled bool
}

S3MinioBucket defines minio config

func BucketConfig

func BucketConfig(d *schema.ResourceData, meta interface{}) *S3MinioBucket

BucketConfig creates a new config for minio buckets

type S3MinioBucketNotification added in v1.10.0

type S3MinioBucketNotification struct {
	MinioClient   *minio.Client
	MinioBucket   string
	Configuration *notification.Configuration
}

S3MinioBucketNotification

func BucketNotificationConfig added in v1.10.0

func BucketNotificationConfig(d *schema.ResourceData, meta interface{}) *S3MinioBucketNotification

BucketNotificationConfig creates config for managing minio bucket notifications

type S3MinioBucketPolicy added in v1.5.0

type S3MinioBucketPolicy struct {
	MinioClient       *minio.Client
	MinioBucket       string
	MinioBucketPolicy string
}

S3MinioBucketPolicy defines bucket policy config

func BucketPolicyConfig added in v1.5.0

func BucketPolicyConfig(d *schema.ResourceData, meta interface{}) *S3MinioBucketPolicy

BucketPolicyConfig creates config for managing minio bucket policies

type S3MinioBucketServerSideEncryption added in v1.16.0

type S3MinioBucketServerSideEncryption struct {
	MinioClient   *minio.Client
	MinioBucket   string
	Configuration *sse.Configuration
}

S3MinioBucketServerSideEncryption defines bucket encryption

func BucketServerSideEncryptionConfig added in v1.16.0

func BucketServerSideEncryptionConfig(d *schema.ResourceData, meta interface{}) *S3MinioBucketServerSideEncryption

BucketServerSideEncryptionConfig creates config for managing minio bucket server side encryption

type S3MinioBucketVersioning added in v1.8.0

type S3MinioBucketVersioning struct {
	MinioClient             *minio.Client
	MinioBucket             string
	VersioningConfiguration *S3MinioBucketVersioningConfiguration
}

S3MinioBucketVersioning defines bucket versioning

func BucketVersioningConfig added in v1.8.0

func BucketVersioningConfig(d *schema.ResourceData, meta interface{}) *S3MinioBucketVersioning

BucketVersioningConfig creates config for managing minio bucket versioning

type S3MinioBucketVersioningConfiguration added in v1.8.0

type S3MinioBucketVersioningConfiguration struct {
	Status           string
	ExcludedPrefixes []string
	ExcludeFolders   bool
}

S3MinioBucketVersioningConfiguration defines bucket versioning config

type S3MinioClient

type S3MinioClient struct {
	S3UserAccess string
	S3Region     string
	S3Client     *minio.Client
	S3Admin      *madmin.AdminClient
}

S3MinioClient defines default minio

type S3MinioConfig

type S3MinioConfig struct {
	S3HostPort      string
	S3UserAccess    string
	S3UserSecret    string
	S3Region        string
	S3SessionToken  string
	S3APISignature  string
	S3SSL           bool
	S3SSLCACertFile string
	S3SSLCertFile   string
	S3SSLKeyFile    string
	S3SSLSkipVerify bool
}

S3MinioConfig defines variable for minio

func NewConfig

func NewConfig(d *schema.ResourceData) *S3MinioConfig

NewConfig creates a new config for minio

func (*S3MinioConfig) NewClient

func (config *S3MinioConfig) NewClient() (client interface{}, err error)

NewClient returns a new minio client

type S3MinioIAMGroupAttachmentConfig

type S3MinioIAMGroupAttachmentConfig struct {
	MinioAdmin    *madmin.AdminClient
	MinioIAMUser  string
	MinioIAMGroup string
}

S3MinioIAMGroupAttachmentConfig defines IAM Group membership config

func IAMGroupAttachmentConfig

func IAMGroupAttachmentConfig(d *schema.ResourceData, meta interface{}) *S3MinioIAMGroupAttachmentConfig

IAMGroupAttachmentConfig creates new membership config for a single user

type S3MinioIAMGroupConfig

type S3MinioIAMGroupConfig struct {
	MinioAdmin        *madmin.AdminClient
	MinioIAMName      string
	MinioDisableGroup bool
	MinioForceDestroy bool
}

S3MinioIAMGroupConfig defines IAM Group config

func IAMGroupConfig

func IAMGroupConfig(d *schema.ResourceData, meta interface{}) *S3MinioIAMGroupConfig

IAMGroupConfig creates new group config

type S3MinioIAMGroupMembershipConfig

type S3MinioIAMGroupMembershipConfig struct {
	MinioAdmin    *madmin.AdminClient
	MinioIAMName  string
	MinioIAMUsers []*string
	MinioIAMGroup string
}

S3MinioIAMGroupMembershipConfig defines IAM Group membership config

func IAMGroupMembersipConfig

func IAMGroupMembersipConfig(d *schema.ResourceData, meta interface{}) *S3MinioIAMGroupMembershipConfig

IAMGroupMembersipConfig creates new membership config

type S3MinioIAMGroupPolicyConfig

type S3MinioIAMGroupPolicyConfig struct {
	MinioAdmin         *madmin.AdminClient
	MinioIAMName       string
	MinioIAMNamePrefix string
	MinioIAMPolicy     string
	MinioIAMGroup      string
}

S3MinioIAMGroupPolicyConfig defines IAM Policy config

func IAMGroupPolicyConfig

func IAMGroupPolicyConfig(d *schema.ResourceData, meta interface{}) *S3MinioIAMGroupPolicyConfig

IAMGroupPolicyConfig creates new group policy config

type S3MinioIAMPolicyConfig

type S3MinioIAMPolicyConfig struct {
	MinioAdmin         *madmin.AdminClient
	MinioIAMName       string
	MinioIAMNamePrefix string
	MinioIAMPolicy     string
}

S3MinioIAMPolicyConfig defines IAM Policy config

func IAMPolicyConfig

func IAMPolicyConfig(d *schema.ResourceData, meta interface{}) *S3MinioIAMPolicyConfig

IAMPolicyConfig creates new policy config

type S3MinioIAMUserConfig

type S3MinioIAMUserConfig struct {
	MinioAdmin        *madmin.AdminClient
	MinioIAMName      string
	MinioSecret       string
	MinioDisableUser  bool
	MinioForceDestroy bool
	MinioUpdateKey    bool
	MinioIAMTags      map[string]string
}

S3MinioIAMUserConfig defines IAM config

func IAMUserConfig

func IAMUserConfig(d *schema.ResourceData, meta interface{}) *S3MinioIAMUserConfig

IAMUserConfig creates new user config

type S3MinioKMSKeyConfig added in v1.16.0

type S3MinioKMSKeyConfig struct {
	MinioAdmin    *madmin.AdminClient
	MinioKMSKeyID string
}

S3MinioKMSKeyConfig defines service account config

func KMSKeyConfig added in v1.16.0

func KMSKeyConfig(d *schema.ResourceData, meta interface{}) *S3MinioKMSKeyConfig

KMSKeyConfig creates new service account config

type S3MinioServiceAccountConfig added in v1.7.0

type S3MinioServiceAccountConfig struct {
	MinioAdmin        *madmin.AdminClient
	MinioTargetUser   string
	MinioAccessKey    string
	MinioSecretKey    string
	MinioSAPolicy     string
	MinioDisableUser  bool
	MinioForceDestroy bool
	MinioUpdateKey    bool
	MinioIAMTags      map[string]string
}

S3MinioServiceAccountConfig defines service account config

func ServiceAccountConfig added in v1.7.0

func ServiceAccountConfig(d *schema.ResourceData, meta interface{}) *S3MinioServiceAccountConfig

ServiceAccountConfig creates new service account config

type ServiceAccountStatus added in v1.7.0

type ServiceAccountStatus struct {
	AccessKey     string `json:"accessKey,omitempty"`
	SecretKey     string `json:"secretKey,omitempty"`
	AccountStatus string `json:"status,omitempty"`
}

ServiceAccountStatus User status

type UserStatus

type UserStatus struct {
	AccessKey string               `json:"accessKey,omitempty"`
	SecretKey string               `json:"secretKey,omitempty"`
	Status    madmin.AccountStatus `json:"status,omitempty"`
}

UserStatus User status

Jump to

Keyboard shortcuts

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