iam

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

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

func InjectAccountIDToIAMClient(clientIam iamiface.IAMAPI, accountID string) error

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.

Jump to

Keyboard shortcuts

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