Documentation ¶
Index ¶
- type Constraints
- func (c Constraints) Evaluate(_ context.Context, policy *policyapi.CertificateRequestPolicy, ...) (approver.EvaluationResponse, error)
- func (c Constraints) Name() string
- func (c Constraints) Prepare(_ context.Context, _ manager.Manager) error
- func (c Constraints) Ready(_ context.Context, _ *policyapi.CertificateRequestPolicy) (approver.ReconcilerReadyResponse, error)
- func (c Constraints) RegisterFlags(_ *pflag.FlagSet)
- func (c Constraints) Validate(_ context.Context, policy *policyapi.CertificateRequestPolicy) (approver.WebhookValidationResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Constraints ¶
type Constraints struct{}
Constraints is a base approver-policy Approver that is responsible for ensuring incoming requests satisfy the Constraints defined on CertificateRequestPolicies. It is expected that constraints must _always_ be registered for all approver-policy builds.
func (Constraints) Evaluate ¶
func (c Constraints) Evaluate(_ context.Context, policy *policyapi.CertificateRequestPolicy, request *cmapi.CertificateRequest) (approver.EvaluationResponse, error)
Evaluate evaluates whether the given CertificateRequest satisfies the constraints which have been defined in the CertificateRequestPolicy. The request _must_ satisfy _all_ constraints defined in the policy to be permitted by the passed policy. If the request is denied by the constraints an explanation is returned. An error signals that the policy couldn't be evaluated to completion.
func (Constraints) Ready ¶
func (c Constraints) Ready(_ context.Context, _ *policyapi.CertificateRequestPolicy) (approver.ReconcilerReadyResponse, error)
Ready always returns ready, constraints doesn't have any dependencies to block readiness.
func (Constraints) RegisterFlags ¶
func (c Constraints) RegisterFlags(_ *pflag.FlagSet)
RegisterFlags is a no-op, constraints doesn't need any flags.
func (Constraints) Validate ¶
func (c Constraints) Validate(_ context.Context, policy *policyapi.CertificateRequestPolicy) (approver.WebhookValidationResponse, error)
Validate validates that the processed CertificateRequestPolicy has valid constraint fields defined and there are no parsing errors in the values.