Documentation
¶
Index ¶
- Constants
- Variables
- func GetCredential(accessKey string) (credential common.Credential, err error)
- func GetCredentialByUserId(userId string) (credential common.Credential, err error)
- func GetKeysByUid(uid string) (credentials []common.Credential, err error)
- func InitializeIamCache()
- func InitializeIamClient(plugins map[string]*mods.YigPlugin)
- type CacheEntry
- type IamClient
Constants ¶
View Source
const ( CACHE_EXPIRE_TIME = 600 * time.Second CACHE_CHECK_TIME = 60 * time.Second )
Variables ¶
View Source
var IamCache sync.Map // accessKey -> cacheEntry
View Source
var IsValidAccessKey = regexp.MustCompile(`^[a-zA-Z0-9\\-\\.\\_\\~]{5,20}$`)
IsValidAccessKey - validate access key.
View Source
var IsValidSecretKey = regexp.MustCompile(`^.{8,40}$`)
IsValidSecretKey - validate secret key.
Functions ¶
func GetCredential ¶
func GetCredential(accessKey string) (credential common.Credential, err error)
func GetCredentialByUserId ¶
func GetCredentialByUserId(userId string) (credential common.Credential, err error)
func GetKeysByUid ¶
func GetKeysByUid(uid string) (credentials []common.Credential, err error)
func InitializeIamCache ¶
func InitializeIamCache()
func InitializeIamClient ¶
Types ¶
type CacheEntry ¶
type CacheEntry struct { CreateTime time.Time Credential common.Credential }
type IamClient ¶
type IamClient interface { GetKeysByUid(string) ([]common.Credential, error) GetCredential(string) (common.Credential, error) }
Click to show internal directories.
Click to hide internal directories.