iam

package
v1.120.2-beta Latest Latest
Warning

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

Go to latest
Published: Apr 1, 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)
	},
}

Cmd 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, kServiceAccount, gServiceAccount)
	},
}

WidCmd to get org details

Functions

func GenerateName

func GenerateName(prefix string) string

func ValidateRoleType

func ValidateRoleType(role string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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