Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var STSAddressURL = os.Getenv("STS_SERVICE_URL")
STSAddressURL variable refers to the remote STS service URL via the env-var STS_SERVICE_URL
Functions ¶
This section is empty.
Types ¶
type AccessKeyQuerier ¶
type AccessKeyQuerier interface { // Query returns the single generic token from STS service Query(accessKey string) (*STSResponse, error) }
func NewAccessKeyQuerier ¶
func NewAccessKeyQuerier() AccessKeyQuerier
NewAccessKeyQuerier creates an object for querying access key
type CreateAccessKeyResponse ¶
type CreateAccessKeyResponse struct { AccessKey string `json:"accessKey"` SecretKey string `json:"secretKey"` CreatedAt time.Time `json:"createdAt"` }
CreateAccessKeyResponse returns the generated access/secret keys to client
type KeyInfo ¶
type KeyInfo struct { AccessKey string `json:"accessKey"` CreatedAt time.Time `json:"createdAt,omitempty"` }
KeyInfo struct only contains insensitive information, which can be displayed at UI
type STSClient ¶
type STSClient interface { // List lists all existing access key of the given user ListAccessKeys(username string) ([]KeyInfo, error) // DeleteAccessKey removes the access key from STS service DeleteAccessKey(accessKey string) error // Create invokes STS service to generate a new access key with given lifetime and user's attributes CreateAccessKey(username string, lifetime time.Duration, attributes map[string]interface{}) (*CreateAccessKeyResponse, error) }
STSClient invokes STS service APIs
type STSResponse ¶
type STSResponse struct { SecretKey string `json:"secretKey"` UserId string `json:"userId"` Attributes map[string]interface{} `json:"attributes,omitempty"` }
STSResponse is the response from STS::GetAccessKey() API, which is cloned from pkg/sts/pion-store/store.go:10
func (STSResponse) GetUserCustomer ¶
func (resp STSResponse) GetUserCustomer() string
GetUserCustomer returns the customer attribute in the STS response
func (STSResponse) GetUserGroups ¶
func (resp STSResponse) GetUserGroups() []string
GetUserGroups returns the groups attribute in the STS response
Click to show internal directories.
Click to hide internal directories.