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 ¶
func (h *IAMHandler) Do(ctx context.Context, r *v1alpha1.IAMRequestWrapper) (nps []*v1alpha1.IAMResponse, retErr error)
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 ¶
WithCustomConditionTitle provides a custom condition title for IAM bindings expiration condition.
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 ¶
func (h *ToolHandler) Do(ctx context.Context, r *v1alpha1.ToolRequest) error
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.