Skip to main content

Approval Domain

The Approval domain provides configurable approval workflows for API and event subscriptions. It supports multiple approval strategies, tracks state through a finite state machine, and integrates with the Notification domain to keep all parties informed.

Custom Resources

Approval

Approval is the Schema for the approvals API

Group: approval.cp.ei.telekom.de · Version: v1 · Scope: Namespaced

ApprovalSpec

Appears in: Approval

ApprovalSpec defines the desired state of Approval

FieldTypeDefaultValidation
actionstringunknownRequired
approvedRequestApprovedRequestOptional
deciderDeciderOptional
decisionsDecisions[]
Required, maxItems: 5
requesterRequesterRequired
statestringPendingRequired, Enum: Pending \| Semigranted \| Granted \| Rejected \| Suspended \| Expired
strategystringAutoRequired, Enum: Auto \| Simple \| FourEyes
targetApplicationRefRequired

ApprovedRequest

Appears in: ApprovalSpec, ApprovalStatus, ApprovalExpirationSpec, SentReminder, ApprovalRequestStatus

ApprovedRequest contains the reference to the request that was approved with this approval

FieldTypeDefaultValidation
namestringRequired
namespacestringRequired
uidstringOptional

Decider

Appears in: ApprovalSpec, ApprovalRequestSpec

Decider contains the information about the entity that owns the requested object

FieldTypeDefaultValidation
applicationRefApplicationRefOptional
teamEmailstringOptional
teamNamestringOptional

ApplicationRef

Appears in: Decider, Requester, ApprovalSpec, ApprovalRequestSpec

ApplicationRef is a reference to the application that decides on the approval request

FieldTypeDefaultValidation
apiVersionstringOptional
kindstringOptional
namestringRequired
namespacestringRequired
uidstringOptional

Decisions

Appears in: ApprovalSpec, ApprovalRequestSpec

Decisions contains information about who or what changed this approval Only the most recent MaxDecisions entries are retained; older ones are dropped by the mutating webhook.

FieldTypeDefaultValidation
commentstringOptional
emailstringOptional
namestringRequired
resultingStatestringRequired, Enum: Pending \| Semigranted \| Granted \| Rejected \| Suspended \| Expired
timestampstringOptional, Format: date-time

Requester

Appears in: ApprovalSpec, ApprovalRequestSpec

Requester contains the information about the entity that is requesting access

FieldTypeDefaultValidation
applicationRefApplicationRefOptional
propertiesobjectOptional
reasonstringRequired
teamEmailstringRequired
teamNamestringRequired

ApprovalStatus

Appears in: Approval

ApprovalStatus defines the observed state of Approval

FieldTypeDefaultValidation
availableTransitionsAvailableTransition[]Optional
conditionsCondition[]Optional
expiresAtstringOptional, Format: date-time
lastStatestringPendingOptional, Enum: Pending \| Semigranted \| Granted \| Rejected \| Suspended \| Expired
notificationRefsApprovedRequest[]Optional

AvailableTransition

Appears in: ApprovalStatus, ApprovalRequestStatus

FieldTypeDefaultValidation
actionstringRequired
tostringRequired

Condition

Appears in: ApprovalStatus, ApprovalExpirationStatus, ApprovalRequestStatus

FieldTypeDefaultValidation
lastTransitionTimestringRequired, Format: date-time
messagestringRequired, maxLength: 32768
observedGenerationintegerOptional, Format: int64, minimum: 0
reasonstringRequired, minLength: 1, maxLength: 1024, pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
statusstringRequired, Enum: True \| False \| Unknown
typestringRequired, maxLength: 316, pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$

ApprovalExpiration

ApprovalExpiration is the Schema for the approvalexpirations API.

Group: approval.cp.ei.telekom.de · Version: v1 · Scope: Namespaced

ApprovalExpirationSpec

Appears in: ApprovalExpiration

ApprovalExpirationSpec defines the desired state of ApprovalExpiration.

FieldTypeDefaultValidation
approvalApprovedRequestRequired
expirationstringRequired, Format: date-time
thresholdsThresholds[]Optional

Thresholds

Appears in: ApprovalExpirationSpec

Thresholds defines when reminders should be sent relative to the expiration deadline. For example: [{Before: "720h"}, {Before: "168h", Repeat: "24h"}] sends one reminder 30 days before expiration, then daily reminders starting 7 days before.

FieldTypeDefaultValidation
beforestringRequired
repeatstringOptional

ApprovalExpirationStatus

Appears in: ApprovalExpiration

ApprovalExpirationStatus defines the observed state of ApprovalExpiration.

FieldTypeDefaultValidation
conditionsCondition[]Optional
sentRemindersSentReminder[]Optional

SentReminder

Appears in: ApprovalExpirationStatus

SentReminders tracks which reminder notifications have already been sent.

FieldTypeDefaultValidation
refApprovedRequestRequired
sentAtstringRequired, Format: date-time
thresholdstringRequired

ApprovalRequest

ApprovalRequest is the Schema for the approvalrequests API

Group: approval.cp.ei.telekom.de · Version: v1 · Scope: Namespaced

ApprovalRequestSpec

Appears in: ApprovalRequest

ApprovalRequestSpec defines the desired state of ApprovalRequest

FieldTypeDefaultValidation
actionstringunknownRequired
deciderDeciderOptional
decisionsDecisions[]
Required, maxItems: 5
requesterRequesterRequired
statestringPendingRequired, Enum: Pending \| Granted \| Semigranted \| Rejected
strategystringAutoRequired, Enum: Auto \| Simple \| FourEyes
targetApplicationRefRequired

ApprovalRequestStatus

Appears in: ApprovalRequest

ApprovalRequestStatus defines the observed state of ApprovalRequest

FieldTypeDefaultValidation
approvalApprovedRequestRequired
availableTransitionsAvailableTransition[]Optional
conditionsCondition[]Optional
lastStatestringPendingOptional, Enum: Pending \| Granted \| Semigranted \| Rejected
notificationRefsApprovedRequest[]Optional

Approval Strategies

Auto

The subscription is approved immediately. No human intervention is required.

Created ──▶ Granted

Simple

A single approver from the provider team must grant the request.

Created ──▶ Pending ──▶ Granted
└──▶ Rejected

FourEyes

Two separate approvers from the provider team must independently grant the request (dual-control principle).

Created ──▶ Pending ──▶ SemiGranted ──▶ Granted
└──▶ Rejected

Decision history

Every state change records a decision in spec.decisions on the Approval and the ApprovalRequest. The list is a rolling window: only the 5 most recent decisions are retained. When a sixth decision is recorded, the oldest one is dropped automatically by the admission webhook, so no client needs to trim the list itself. Decisions beyond that window are not preserved anywhere.

FourEyes validation is unaffected by this, because it only inspects the two most recent decisions to confirm that they were made by different people.

Trusted Teams

API and event providers can designate specific teams as trusted. When a trusted team subscribes, the approval is granted automatically regardless of the configured strategy. This is useful for pre-authorized internal services.

Notifications

The Approval domain creates Notification resources at key points in the lifecycle:

  • Request created — Provider team is notified of a new subscription request
  • State changed — Both parties are notified when an approval is granted, rejected, or suspended

Notification names are deterministic, so the same notification can be produced by several reconciles. Each Notification is therefore referenced at most once in status.notificationRefs. The field is a map-typed list keyed on namespace and name, so uniqueness is enforced by the CRD schema; the controllers normalise any duplicates left over from older objects before their next status write.

Domain Interactions

  • API domain — ApiSubscription resources trigger approval creation.
  • Event domain — EventSubscription resources trigger approval creation.
  • Notification domain — Approval lifecycle events create notifications.