iam

package
v1.125.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CallCmd = &cobra.Command{
	Use:   "create",
	Short: "Create a new IAM Service Account with permissions for Apigee Runtime",
	Long:  "Create a new IAM Service Account with permissions for Apigee Runtime",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		if !generateName && name == "" {
			return fmt.Errorf("provide a service account name or allow the tool to generate one")
		}
		if !ValidateRoleType(roleType) {
			return fmt.Errorf("the role type %s is not a valid type. Please use one of %s", roleType, roles)
		}
		apiclient.SetProjectID(projectID)
		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		if generateName {
			name = GenerateName("apigee-" + roleType + "-")
		}
		return apiclient.CreateIAMServiceAccount(name, roleType)
	},
}

CallCmd to get org details

View Source
var Cmd = &cobra.Command{
	Use:   "iam",
	Short: "Manage IAM permissions for Apigee",
	Long: "Manage IAM permissions for Apigee. The SA to run this command requires Security Admin, " +
		"Create Service Accounts and Service Account Key Admin roles",
}

Cmd to manage orgs

View Source
var WidCmd = &cobra.Command{
	Use:   "addwid",
	Short: "Provide WID role to a Service Account for Apigee Runtime",
	Long:  "Provide Workload Identity user role to an IAM Service Account for Apigee Runtime",
	Args: func(cmd *cobra.Command, args []string) (err error) {
		apiclient.SetProjectID(projectID)
		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		return apiclient.AddWid(projectID, namespace,
			kubernetesServiceAccount, googleServiceAccount)
	},
}

WidCmd to get org details

Functions

func GenerateName

func GenerateName(prefix string) string

GenerateName

func ValidateRoleType

func ValidateRoleType(role string) bool

ValidateRoleType

Types

This section is empty.

Jump to

Keyboard shortcuts

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