Skip to content

Commit 2e262c6

Browse files
committed
crd: add SSO and AI specs
1 parent 84cf7d2 commit 2e262c6

8 files changed

Lines changed: 484 additions & 11 deletions

File tree

api/v1/config.go

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,59 @@ import (
44
corev1 "k8s.io/api/core/v1"
55
)
66

7+
type SSOSpec struct {
8+
Enabled bool `json:"enabled,omitempty"`
9+
// Default role for authenticated users (Admin, Editor, Viewer, or a custom role).
10+
DefaultRole string `json:"defaultRole,omitempty"`
11+
// SAML configuration.
12+
SAML *SSOSAMLSpec `json:"saml,omitempty"`
13+
}
14+
15+
type SSOSAMLSpec struct {
16+
// Identity Provider Metadata XML.
17+
Metadata string `json:"metadata,omitempty"`
18+
// Secret containing the Metadata XML.
19+
MetadataSecret *corev1.SecretKeySelector `json:"metadataSecret,omitempty"`
20+
}
21+
22+
type AISpec struct {
23+
// AI model provider (anthropic, openai, or openai_compatible).
24+
// +kubebuilder:validation:Enum=anthropic;openai;openai_compatible
25+
Provider string `json:"provider"`
26+
// Anthropic configuration.
27+
Anthropic *AnthropicSpec `json:"anthropic,omitempty"`
28+
// OpenAI configuration.
29+
OpenAI *OpenAISpec `json:"openai,omitempty"`
30+
// OpenAI-compatible configuration.
31+
OpenAICompatible *OpenAICompatibleSpec `json:"openaiCompatible,omitempty"`
32+
}
33+
34+
type AnthropicSpec struct {
35+
// Anthropic API key.
36+
APIKey string `json:"apiKey,omitempty"`
37+
// Secret containing the API key.
38+
APIKeySecret *corev1.SecretKeySelector `json:"apiKeySecret,omitempty"`
39+
}
40+
41+
type OpenAISpec struct {
42+
// OpenAI API key.
43+
APIKey string `json:"apiKey,omitempty"`
44+
// Secret containing the API key.
45+
APIKeySecret *corev1.SecretKeySelector `json:"apiKeySecret,omitempty"`
46+
}
47+
48+
type OpenAICompatibleSpec struct {
49+
// API key.
50+
APIKey string `json:"apiKey,omitempty"`
51+
// Secret containing the API key.
52+
APIKeySecret *corev1.SecretKeySelector `json:"apiKeySecret,omitempty"`
53+
// Base URL (eg., https://generativelanguage.googleapis.com/v1beta/openai).
54+
// +kubebuilder:validation:Pattern="^https?://.+$"
55+
BaseUrl string `json:"baseURL"`
56+
// Model name (eg., gemini-2.5-pro-preview-06-05).
57+
Model string `json:"model"`
58+
}
59+
760
type ProjectSpec struct {
861
// Project name (e.g., production, staging; required).
962
// +kubebuilder:validation:Required

api/v1/coroot_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ type CorootSpec struct {
272272

273273
// Projects configuration (Coroot will create or update the specified projects).
274274
Projects []ProjectSpec `json:"projects,omitempty"`
275+
// Single Sign-On configuration (Coroot Enterprise Edition only).
276+
SSO *SSOSpec `json:"sso,omitempty"`
277+
// AI configuration (Coroot Enterprise Edition only).
278+
AI *AISpec `json:"ai,omitempty"`
275279
}
276280

277281
type CorootStatus struct {

api/v1/zz_generated.deepcopy.go

Lines changed: 140 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)