handler

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

handler package that handles AOD request.

handler package that handles AOD request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAMClient

type IAMClient interface {
	GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
	SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest, ...gax.CallOption) (*iampb.Policy, error)
}

IAMClient is the interface to get and set IAM policies for GCP organizations, folders, and projects.

type IAMHandler

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

IAMHandler updates IAM policies of GCP organizations, folders, and projects based on the IAM request received.

func NewIAMHandler

func NewIAMHandler(ctx context.Context, organizationsClient, foldersClient, projectsClient IAMClient, opts ...Option) (*IAMHandler, error)

NewIAMHandler creates a new IAMHandler with provided clients and options.

func (*IAMHandler) Cleanup

func (h *IAMHandler) Cleanup(ctx context.Context, r *v1alpha1.IAMRequest) (nps []*v1alpha1.IAMResponse, retErr error)

Cleanup removes expired IAM bindings added by AOD from the IAM policies of the resources in the request.

func (*IAMHandler) Do

Do removes expired or conflicting IAM bindings added by AOD and adds requested IAM bindings to current IAM policy.

type Option

type Option func(h *IAMHandler) (*IAMHandler, error)

Option is the option to set up an IAMHandler.

func WithCustomConditionTitle

func WithCustomConditionTitle(title string) Option

WithCustomConditionTitle provides a custom condition title for IAM bindings expiration condition.

func WithRetry

func WithRetry(b retry.Backoff) Option

WithRetry provides retry strategy to the handler.

type ToolHandler

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

ToolHandler runs tool commands in the ToolRequest.

func NewToolHandler

func NewToolHandler(ctx context.Context, opts ...ToolHandlerOption) *ToolHandler

NewToolHandler creates a new ToolHandler with provided options.

func (*ToolHandler) Do

Do runs the do commands.

type ToolHandlerOption

type ToolHandlerOption func(h *ToolHandler) *ToolHandler

ToolHandlerOption is the option to set up an ToolHandler.

func WithDefaultStdout

func WithDefaultStdout() ToolHandlerOption

WithDefaultStdout sets the handler's stdout to os.Stdout. Note that it may output sensitive information.

func WithStderr

func WithStderr(w io.Writer) ToolHandlerOption

WithStderr sets the handler's stderr.

func WithStdout

func WithStdout(w io.Writer) ToolHandlerOption

WithStdout sets the handler's stdout to w. Note that it may output sensitive information.

Jump to

Keyboard shortcuts

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