iam

package
v0.0.0-...-0b283b2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package iam provides a wrapper for IAM APIs offered by google cloud libraries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAM

type IAM struct {
	// contains filtered or unexported fields
}

IAM is a wrapper for IAM APIs offered by google cloud libraries.

func NewIAMClient

func NewIAMClient(ctx context.Context, opts ...option.ClientOption) (*IAM, error)

NewIAMClient creates a new IAM API wrapper.

func (*IAM) CheckIAMPermissionsOnBucket

func (i *IAM) CheckIAMPermissionsOnBucket(ctx context.Context, bucketName string, permissions []string) (grantedPermissions []string, err error)

CheckIAMPermissionsOnBucket checks if the required IAM permissions are present for the caller's identity (service account, etc) on a given bucket, based on the connect params.

Returns the list of input permissions that are granted.

func (*IAM) CheckIAMPermissionsOnDisk

func (i *IAM) CheckIAMPermissionsOnDisk(ctx context.Context, project, zone, diskName string, permissions []string) (grantedPermissions []string, err error)

CheckIAMPermissionsOnDisk checks if the required IAM permissions are present for the caller's identity (service account, etc) on a given disk.

Returns the list of input permissions that are granted.

func (*IAM) CheckIAMPermissionsOnInstance

func (i *IAM) CheckIAMPermissionsOnInstance(ctx context.Context, project, zone, instanceName string, permissions []string) (grantedPermissions []string, err error)

CheckIAMPermissionsOnInstance checks if the required IAM permissions are present for the caller's identity (service account, etc) on a given instance.

Returns the list of input permissions that are granted.

func (*IAM) CheckIAMPermissionsOnProject

func (i *IAM) CheckIAMPermissionsOnProject(ctx context.Context, projectID string, permissions []string) (grantedPermissions []string, err error)

CheckIAMPermissionsOnProject checks if the required IAM permissions are present for the caller's identity (service account, etc) on a given project.

Returns the list of input permissions that are granted.

func (*IAM) CheckIAMPermissionsOnSecret

func (i *IAM) CheckIAMPermissionsOnSecret(ctx context.Context, projectID, secretID string, permissions []string) (grantedPermissions []string, err error)

CheckIAMPermissionsOnSecret checks if the required IAM permissions are present for the caller's identity (service account, etc) on a given secret.

Returns the list of input permissions that are granted.

type SecretManager

type SecretManager interface {
	TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
}

SecretManager is an interface for the Secret Manager client.

Jump to

Keyboard shortcuts

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