[go: up one dir, main page]

policy

package
v6.0.49 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 5 Imported by: 13 modules, 43 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	BucketPolicyNone      BucketPolicy = "none"
	BucketPolicyReadOnly               = "readonly"
	BucketPolicyReadWrite              = "readwrite"
	BucketPolicyWriteOnly              = "writeonly"
)

Different types of Policies currently supported for buckets.

Variables

This section is empty.

Functions

func GetPolicies

func GetPolicies(statements []Statement, bucketName, prefix string) map[string]BucketPolicy

GetPolicies - returns a map of policies of given bucket name, prefix in given statements.

Types

type BucketAccessPolicy

type BucketAccessPolicy struct {
	Version    string      // date in YYYY-MM-DD format
	Statements []Statement `json:"Statement"`
}

BucketAccessPolicy - minio policy collection

type BucketPolicy

type BucketPolicy string

BucketPolicy - Bucket level policy.

func GetPolicy

func GetPolicy(statements []Statement, bucketName string, prefix string) BucketPolicy

GetPolicy - Returns policy of given bucket name, prefix in given statements.

func (BucketPolicy) IsValidBucketPolicy

func (p BucketPolicy) IsValidBucketPolicy() bool

IsValidBucketPolicy - returns true if policy is valid and supported, false otherwise.

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 Statement

type Statement struct {
	Actions    set.StringSet `json:"Action"`
	Conditions ConditionMap  `json:"Condition,omitempty"`
	Effect     string
	Principal  User          `json:"Principal"`
	Resources  set.StringSet `json:"Resource"`
	Sid        string
}

Statement - minio policy statement

func SetPolicy

func SetPolicy(statements []Statement, policy BucketPolicy, bucketName string, prefix string) []Statement

SetPolicy - Returns new statements containing policy of given bucket name and prefix are appended.

type User

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

User - canonical users list.

func (*User) UnmarshalJSON

func (u *User) UnmarshalJSON(data []byte) error

UnmarshalJSON is a custom json unmarshaler for Principal field, the reason is that Principal can take a json struct represented by User string but it can also take a string.

Jump to

Keyboard shortcuts

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