iam

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: Apache-2.0 Imports: 13 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 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

This section is empty.

Types

type AccessKeyItem added in v1.1.0

type AccessKeyItem struct {
	ProjectId    string `json:"projectId"`
	Name         string `json:"name"`
	AccessKey    string `json:"accessKey"`
	AccessSecret string `json:"accessSecret"`
	Status       string `json:"status"`
	Updated      string `json:"updated"`
}

func GetKeysByUid

func GetKeysByUid(uid string) (keyslist []AccessKeyItem, err error)

type Credential added in v1.1.0

type Credential struct {
	UserId          string
	DisplayName     string
	AccessKeyID     string
	SecretAccessKey string
}

credential container for access and secret keys.

func GetCredential

func GetCredential(accessKey string) (credential Credential, err error)

func GetCredentialByUserId

func GetCredentialByUserId(userId string) (credential Credential, err error)

func (Credential) String added in v1.1.0

func (a Credential) String() string

type Query added in v1.1.0

type Query struct {
	Action     string   `json:"action"`
	ProjectId  string   `json:"projectId,omitempty"`
	AccessKeys []string `json:"accessKeys,omitempty"`
	Offset     int      `json:"offset,omitempty"`
}

type QueryResp added in v1.1.0

type QueryResp struct {
	Limit        int             `json:"limit"`
	Total        int             `json:"total"`
	Offset       int             `json:"offset"`
	AccessKeySet []AccessKeyItem `json:"accessKeySet"`
}

type QueryRespAll added in v1.1.0

type QueryRespAll struct {
	Message string    `json:"message"`
	Data    QueryResp `json:"data"`
	RetCode int       `json:"retCode"`
}

Jump to

Keyboard shortcuts

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