The APIKey CRD is part of the Developer Portal extension for Kuadrant. It represents a request for API access credentials by a developer for a specific APIProduct and plan tier. The developer creates a Kubernetes Secret containing their API key in their own namespace, then creates an APIKey resource referencing that secret. When approved, the controller validates and registers the API key for use with the specified APIProduct. The APIKey resource manages the entire lifecycle of API access requests, from initial submission through approval/rejection to credential activation.
apiVersion:devportal.kuadrant.io/v1alpha1kind:APIKeymetadata:name:developer-john-premiumnamespace:developer-appsspec:apiProductRef:name:payment-apinamespace:payment-servicessecretRef:name:my-payment-api-keyplanTier:premiumuseCase:Building a mobile payment application for retail customersrequestedBy:userId:john-doe-123email:john.doe@example.com
Relationship to APIProduct, AuthPolicy, and APIKeyRequest¶
APIKey must reference an existing APIProduct via apiProductRef. The APIProduct defines the API being accessed and contains approval workflow configuration.
AuthPolicy is applied to the HTTPRoute that the APIProduct references. The APIKey controller discovers the authentication scheme from the AuthPolicy and populates it in the status.authScheme field. The AuthPolicy validates incoming API requests by checking the API key from the consumer's secret against configured selectors.
PlanPolicy defines the available tiers and their corresponding rate limits. When an APIKey specifies a planTier, the controller validates that this tier exists in the PlanPolicy attached to the HTTPRoute. The discovered rate limits are populated in the status.limits field.
When an APIKey is created, the controller creates a shadow APIKeyRequest resource that represents the approval workflow. The APIKeyRequest is used to track the approval status and connect to APIKeyApproval resources when manual approval is required. Once approved, the controller updates the APIKey conditions to indicate approval status.