Documentation ¶
Overview ¶
handler package that handles AOD request.
handler package that handles AOD request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
// ConditionTitle of IAM bindings added by AOD.
ConditionTitle = "abcxyz-aod-expiry"
)
Functions ¶
This section is empty.
Types ¶
type CLIHandler ¶
type CLIHandler struct {
// contains filtered or unexported fields
}
CLIHandler runs cli commands in the CLIRequest.
func NewCLIHandler ¶
func NewCLIHandler(ctx context.Context, opts ...CLIHandlerOption) *CLIHandler
NewCLIHandler creates a new CLIHandler with provided options.
func (*CLIHandler) Cleanup ¶
func (h *CLIHandler) Cleanup(ctx context.Context, r *v1alpha1.CLIRequest) error
Cleanup runs the cleanup commands.
func (*CLIHandler) Do ¶
func (h *CLIHandler) Do(ctx context.Context, r *v1alpha1.CLIRequest) error
Do runs the do commands.
type CLIHandlerOption ¶
type CLIHandlerOption func(h *CLIHandler) *CLIHandler
CLIHandlerOption is the option to set up an CLIHandler.
func WithDebugMode ¶
func WithDebugMode(w io.Writer) CLIHandlerOption
WithDebugMode sets the handler's stdout to w.
func WithDefaultDebugMode ¶
func WithDefaultDebugMode() CLIHandlerOption
WithDefaultDebugMode sets the handler's stdout to os.Stdout.
func WithStderr ¶
func WithStderr(w io.Writer) CLIHandlerOption
WithStderr sets the handler's stderr.
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.IAMRequestWrapper) (nps []*v1alpha1.IAMResponse, retErr error)
Do removes expired or duplicative IAM bindings added by AOD and adds requested IAM bindings to current IAM policy.
func (*IAMHandler) Do ¶
func (h *IAMHandler) Do(ctx context.Context, r *v1alpha1.IAMRequestWrapper) (nps []*v1alpha1.IAMResponse, retErr error)
Do removes expired or duplicative 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.