Documentation ¶
Index ¶
- Variables
- type Function
- func NewBinaryEqualsFunc(key Key, values ...string) (Function, error)
- func NewBoolFunc(key Key, value string) (Function, error)
- func NewIPAddressFunc(key Key, IPNets ...*net.IPNet) (Function, error)
- func NewNotIPAddressFunc(key Key, IPNets ...*net.IPNet) (Function, error)
- func NewNullFunc(key Key, value bool) (Function, error)
- func NewStringEqualsFunc(key Key, values ...string) (Function, error)
- func NewStringEqualsIgnoreCaseFunc(key Key, values ...string) (Function, error)
- func NewStringLikeFunc(key Key, values ...string) (Function, error)
- func NewStringNotEqualsFunc(key Key, values ...string) (Function, error)
- func NewStringNotEqualsIgnoreCaseFunc(key Key, values ...string) (Function, error)
- func NewStringNotLikeFunc(key Key, values ...string) (Function, error)
- type Functions
- func (functions Functions) Evaluate(values map[string][]string) bool
- func (functions *Functions) GobDecode(data []byte) error
- func (functions Functions) GobEncode() ([]byte, error)
- func (functions Functions) Keys() KeySet
- func (functions Functions) MarshalJSON() ([]byte, error)
- func (functions Functions) String() string
- func (functions *Functions) UnmarshalJSON(data []byte) error
- type Key
- type KeySet
- type Value
- func (v Value) GetBool() (bool, error)
- func (v Value) GetInt() (int, error)
- func (v Value) GetString() (string, error)
- func (v Value) GetType() reflect.Kind
- func (v Value) MarshalJSON() ([]byte, error)
- func (v *Value) StoreBool(b bool)
- func (v *Value) StoreInt(i int)
- func (v *Value) StoreString(s string)
- func (v Value) String() string
- func (v *Value) UnmarshalJSON(data []byte) error
- type ValueSet
Constants ¶
This section is empty.
Variables ¶
var AllSupportedAdminKeys = []Key{ AWSReferer, AWSSourceIP, AWSUserAgent, AWSSecureTransport, AWSCurrentTime, AWSEpochTime, }
AllSupportedAdminKeys - is list of all admin supported keys.
var AllSupportedKeys = []Key{ S3XAmzCopySource, S3XAmzServerSideEncryption, S3XAmzServerSideEncryptionCustomerAlgorithm, S3XAmzMetadataDirective, S3XAmzStorageClass, S3LocationConstraint, S3Prefix, S3Delimiter, S3MaxKeys, AWSReferer, AWSSourceIP, AWSUserAgent, AWSSecureTransport, AWSCurrentTime, AWSEpochTime, AWSPrincipalType, AWSUserID, AWSUsername, JWTSub, JWTIss, JWTAud, JWTJti, }
AllSupportedKeys - is list of all all supported keys.
var CommonKeys = []Key{ AWSReferer, AWSSourceIP, AWSUserAgent, AWSSecureTransport, AWSCurrentTime, AWSEpochTime, AWSPrincipalType, AWSUserID, AWSUsername, JWTSub, JWTIss, JWTAud, JWTJti, }
CommonKeys - is list of all common condition keys.
Functions ¶
This section is empty.
Types ¶
type Function ¶
type Function interface { // String() - returns string representation of function. String() string // contains filtered or unexported methods }
Function - condition function interface.
func NewBinaryEqualsFunc ¶
NewBinaryEqualsFunc - returns new BinaryEquals function.
func NewBoolFunc ¶
NewBoolFunc - returns new Bool function.
func NewIPAddressFunc ¶
NewIPAddressFunc - returns new IP address function.
func NewNotIPAddressFunc ¶
NewNotIPAddressFunc - returns new Not IP address function.
func NewNullFunc ¶
NewNullFunc - returns new Null function.
func NewStringEqualsFunc ¶
NewStringEqualsFunc - returns new StringEquals function.
func NewStringEqualsIgnoreCaseFunc ¶
NewStringEqualsIgnoreCaseFunc - returns new StringEqualsIgnoreCase function.
func NewStringLikeFunc ¶
NewStringLikeFunc - returns new StringLike function.
func NewStringNotEqualsFunc ¶
NewStringNotEqualsFunc - returns new StringNotEquals function.
func NewStringNotEqualsIgnoreCaseFunc ¶
NewStringNotEqualsIgnoreCaseFunc - returns new StringNotEqualsIgnoreCase function.
type Functions ¶
type Functions []Function
Functions - list of functions.
func NewFunctions ¶
NewFunctions - returns new Functions with given function list.
func (Functions) Evaluate ¶
Evaluate - evaluates all functions with given values map. Each function is evaluated sequencely and next function is called only if current function succeeds.
func (Functions) MarshalJSON ¶
MarshalJSON - encodes Functions to JSON data.
func (*Functions) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data to Functions.
type Key ¶
type Key string
Key - conditional key which is used to fetch values for any condition. Refer https://docs.aws.amazon.com/IAM/latest/UserGuide/list_s3.html for more information about available condition keys.
const ( // S3XAmzCopySource - key representing x-amz-copy-source HTTP header applicable to PutObject API only. S3XAmzCopySource Key = "s3:x-amz-copy-source" // S3XAmzServerSideEncryption - key representing x-amz-server-side-encryption HTTP header applicable // to PutObject API only. S3XAmzServerSideEncryption Key = "s3:x-amz-server-side-encryption" // S3XAmzServerSideEncryptionCustomerAlgorithm - key representing // x-amz-server-side-encryption-customer-algorithm HTTP header applicable to PutObject API only. S3XAmzServerSideEncryptionCustomerAlgorithm Key = "s3:x-amz-server-side-encryption-customer-algorithm" // S3XAmzMetadataDirective - key representing x-amz-metadata-directive HTTP header applicable to // PutObject API only. S3XAmzMetadataDirective Key = "s3:x-amz-metadata-directive" // S3XAmzStorageClass - key representing x-amz-storage-class HTTP header applicable to PutObject API // only. S3XAmzStorageClass Key = "s3:x-amz-storage-class" // S3LocationConstraint - key representing LocationConstraint XML tag of CreateBucket API only. S3LocationConstraint Key = "s3:LocationConstraint" // S3Prefix - key representing prefix query parameter of ListBucket API only. S3Prefix Key = "s3:prefix" // S3Delimiter - key representing delimiter query parameter of ListBucket API only. S3Delimiter Key = "s3:delimiter" // S3MaxKeys - key representing max-keys query parameter of ListBucket API only. S3MaxKeys Key = "s3:max-keys" // AWSReferer - key representing Referer header of any API. AWSReferer Key = "aws:Referer" // AWSSourceIP - key representing client's IP address (not intermittent proxies) of any API. AWSSourceIP Key = "aws:SourceIp" // AWSUserAgent - key representing UserAgent header for any API. AWSUserAgent Key = "aws:UserAgent" // AWSSecureTransport - key representing if the clients request is authenticated or not. AWSSecureTransport Key = "aws:SecureTransport" // AWSCurrentTime - key representing the current time. AWSCurrentTime Key = "aws:CurrentTime" // AWSEpochTime - key representing the current epoch time. AWSEpochTime Key = "aws:EpochTime" // AWSPrincipalType - user principal type currently supported values are "User" and "Anonymous". AWSPrincipalType Key = "aws:principaltype" // AWSUserID - user unique ID, in MinIO this value is same as your user Access Key. AWSUserID Key = "aws:userid" // AWSUsername - user friendly name, in MinIO this value is same as your user Access Key. AWSUsername Key = "aws:username" // JWTSub - JWT subject claim substitution. JWTSub Key = "jwt:sub" // JWTIss issuer claim substitution. JWTIss Key = "jwt:iss" // JWTAud audience claim substitution. JWTAud Key = "jwt:aud" // JWTJti JWT unique identifier claim substitution. JWTJti Key = "jwt:jti" )
func (Key) MarshalJSON ¶
MarshalJSON - encodes Key to JSON data.
func (*Key) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data to Key.
type KeySet ¶
type KeySet map[Key]struct{}
KeySet - set representation of slice of keys.
func (KeySet) Difference ¶
Difference - returns a key set contains difference of two keys. Example:
keySet1 := ["one", "two", "three"] keySet2 := ["two", "four", "three"] keySet1.Difference(keySet2) == ["one"]
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value - is enum type of string, int or bool.
func NewStringValue ¶
NewStringValue - returns new string value.
func (Value) MarshalJSON ¶
MarshalJSON - encodes Value to JSON data.
func (*Value) StoreString ¶
StoreString - stores string value.
func (*Value) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data.
type ValueSet ¶
type ValueSet map[Value]struct{}
ValueSet - unique list of values.
func NewValueSet ¶
NewValueSet - returns new value set containing given values.
func (ValueSet) MarshalJSON ¶
MarshalJSON - encodes ValueSet to JSON data.
func (*ValueSet) UnmarshalJSON ¶
UnmarshalJSON - decodes JSON data.