iam

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func InitializeIamClient(plugins map[string]*mods.YigPlugin)

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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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