Documentation ¶
Index ¶
- Variables
- type Function
- func NewBinaryEqualsFunc(key Key, values ...string) (Function, error)
- func NewBoolFunc(key Key, value string) (Function, error)
- func NewDateEqualsFunc(key Key, value time.Time) (Function, error)
- func NewDateGreaterThanEqualsFunc(key Key, value time.Time) (Function, error)
- func NewDateGreaterThanFunc(key Key, value time.Time) (Function, error)
- func NewDateLessThanEqualsFunc(key Key, value time.Time) (Function, error)
- func NewDateLessThanFunc(key Key, value time.Time) (Function, error)
- func NewDateNotEqualsFunc(key Key, value time.Time) (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 NewNumericEqualsFunc(key Key, value int) (Function, error)
- func NewNumericGreaterThanEqualsFunc(key Key, value int) (Function, error)
- func NewNumericGreaterThanFunc(key Key, value int) (Function, error)
- func NewNumericLessThanEqualsFunc(key Key, value int) (Function, error)
- func NewNumericLessThanFunc(key Key, value int) (Function, error)
- func NewNumericNotEqualsFunc(key Key, value int) (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 = append([]Key{ S3XAmzCopySource, S3XAmzServerSideEncryption, S3XAmzServerSideEncryptionCustomerAlgorithm, S3XAmzMetadataDirective, S3XAmzStorageClass, S3XAmzContentSha256, S3LocationConstraint, S3Prefix, S3Delimiter, S3MaxKeys, S3ObjectLockRemainingRetentionDays, S3ObjectLockMode, S3ObjectLockLegalHold, S3ObjectLockRetainUntilDate, AWSReferer, AWSSourceIP, AWSUserAgent, AWSSecureTransport, AWSCurrentTime, AWSEpochTime, AWSPrincipalType, AWSUserID, AWSUsername, }, JWTKeys...)
AllSupportedKeys - is list of all all supported keys.
var CommonKeys = append([]Key{ AWSReferer, AWSSourceIP, AWSUserAgent, AWSSecureTransport, AWSCurrentTime, AWSEpochTime, AWSPrincipalType, AWSUserID, AWSUsername, S3XAmzContentSha256, }, JWTKeys...)
CommonKeys - is list of all common condition keys.
var JWTKeys = []Key{ JWTSub, JWTIss, JWTAud, JWTJti, JWTName, JWTGivenName, JWTFamilyName, JWTMiddleName, JWTNickName, JWTPrefUsername, JWTProfile, JWTPicture, JWTWebsite, JWTEmail, JWTGender, JWTBirthdate, JWTPhoneNumber, JWTAddress, JWTScope, JWTClientID, }
JWTKeys - Supported JWT keys, non-exhaustive list please expand as new claims are standardized.
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 NewDateEqualsFunc ¶
NewDateEqualsFunc - returns new DateEquals function.
func NewDateGreaterThanEqualsFunc ¶
NewDateGreaterThanEqualsFunc - returns new DateNotEquals function.
func NewDateGreaterThanFunc ¶
NewDateGreaterThanFunc - returns new DateGreaterThan function.
func NewDateLessThanEqualsFunc ¶
NewDateLessThanEqualsFunc - returns new DateNotEquals function.
func NewDateLessThanFunc ¶
NewDateLessThanFunc - returns new DateLessThan function.
func NewDateNotEqualsFunc ¶
NewDateNotEqualsFunc - returns new DateNotEquals 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 NewNumericEqualsFunc ¶
NewNumericEqualsFunc - returns new NumericEquals function.
func NewNumericGreaterThanEqualsFunc ¶
NewNumericGreaterThanEqualsFunc - returns new NumericGreaterThanEquals function.
func NewNumericGreaterThanFunc ¶
NewNumericGreaterThanFunc - returns new NumericGreaterThan function.
func NewNumericLessThanEqualsFunc ¶
NewNumericLessThanEqualsFunc - returns new NumericLessThanEquals function.
func NewNumericLessThanFunc ¶
NewNumericLessThanFunc - returns new NumericLessThan function.
func NewNumericNotEqualsFunc ¶
NewNumericNotEqualsFunc - returns new NumericNotEquals 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 ( // 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" JWTName Key = "jwt:name" JWTGivenName Key = "jwt:given_name" JWTFamilyName Key = "jwt:family_name" JWTMiddleName Key = "jwt:middle_name" JWTNickName Key = "jwt:nickname" JWTPrefUsername Key = "jwt:preferred_username" JWTProfile Key = "jwt:profile" JWTPicture Key = "jwt:picture" JWTWebsite Key = "jwt:website" JWTEmail Key = "jwt:email" JWTGender Key = "jwt:gender" JWTBirthdate Key = "jwt:birthdate" JWTPhoneNumber Key = "jwt:phone_number" JWTAddress Key = "jwt:address" JWTScope Key = "jwt:scope" JWTClientID Key = "jwt:client_id" )
JWT claims supported substitutions. https://www.iana.org/assignments/jwt/jwt.xhtml#claims
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" // S3XAmzContentSha256 - set a static content-sha256 for all calls for a given action. S3XAmzContentSha256 = "s3:x-amz-content-sha256" // 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" // S3ObjectLockRemainingRetentionDays - key representing object-lock-remaining-retention-days // Enables enforcement of an object relative to the remaining retention days, you can set // minimum and maximum allowable retention periods for a bucket using a bucket policy. // This key are specific for s3:PutObjectRetention API. S3ObjectLockRemainingRetentionDays Key = "s3:object-lock-remaining-retention-days" // S3ObjectLockMode - key representing object-lock-mode // Enables enforcement of the specified object retention mode S3ObjectLockMode Key = "s3:object-lock-mode" // S3ObjectLockRetainUntilDate - key representing object-lock-retain-util-date // Enables enforcement of a specific retain-until-date S3ObjectLockRetainUntilDate Key = "s3:object-lock-retain-until-date" // S3ObjectLockLegalHold - key representing object-local-legal-hold // Enables enforcement of the specified object legal hold status S3ObjectLockLegalHold Key = "s3:object-lock-legal-hold" // 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" )
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.
Source Files ¶
- binaryequalsfunc.go
- boolfunc.go
- dateequalsfunc.go
- dategreaterthanfunc.go
- datelessthanfunc.go
- func.go
- ipaddressfunc.go
- jwt.go
- key.go
- name.go
- nullfunc.go
- numericequalsfunc.go
- numericgreaterfunc.go
- numericlessfunc.go
- stringequalsfunc.go
- stringequalsignorecasefunc.go
- stringlikefunc.go
- value.go
- valueset.go