Documentation ¶
Overview ¶
Package iam provides funtions for managing objectscale IAM
Example function using IAM client to create new user in ObjectScale.
func ExampleCreateIAMUser(userName string) { x509Client := *http.DefaultClient objClient = client.AuthUser{Gateway: "https://testgateway", Username: "username", Password: "password"} iamSession, _ := session.NewSession(&aws.Config{ // github.com/aws/aws-sdk-go/service/session Endpoint: "https://testgateway/iam", Region: "us-west-2", CredentialsChainVerboseErrors: aws.Bool(true), HTTPClient: x509Client, }, }) iamClient = iam.New(iamSession) // github.com/aws/aws-sdk-go/service/iam InjectTokenToIAMClient(iamClient, &objClient, x509Client) InjectAccountIDToIAMClient(iamClient, "osaid185e2bf9e8ae35f") user, err := iamClient.CreateUser(&iam.CreateUserInput{ UserName: userName, }) }
Index ¶
Constants ¶
View Source
const ( SDSHandlerName = "X-Sds-Handler" SDSHeaderName = "X-Sds-Auth-Token" AccountIDHandlerName = "X-Emc-Handler" AccountIDHeaderName = "X-Emc-Namespace" )
Name of handlers and headers added to IAM.
Variables ¶
This section is empty.
Functions ¶
func InjectAccountIDToIAMClient ¶
InjectAccountIDToIAMClient configure IAM client to connect with Objectscale Account.
func InjectTokenToIAMClient ¶
func InjectTokenToIAMClient(clientIam iamiface.IAMAPI, clientObjectscale client.Authenticator, httpClient http.Client) error
InjectTokenToIAMClient configure IAM client to connect with Objectscale.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.