-
Notifications
You must be signed in to change notification settings - Fork 44
[WIP] MCP Server and Route API Specs #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
876a0aa
2b39859
f21972e
36ee811
fe0343c
6b6a56a
447d6b4
85af93f
2f77a9b
04cf5e8
f7864d7
a662fed
55a2f45
3580071
12a4f41
a58ba21
b08c22c
e30cd79
04de4a4
e299754
9bc811d
2751615
6b7ca0f
f3e0878
924dbcb
76c7d0b
ef76cc3
0963ebb
6877511
80d5056
b90f94d
d871c10
0cad20c
0ff9cf9
7baa75a
36a63a4
e1b66dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| package v1beta1 | ||
|
|
||
| import ( | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // AuthMethod defines the authentication method to use. | ||
| // +kubebuilder:validation:Enum=None;Bearer;ApiKey;Basic;JWT;ClientCertificate;OAuth2 | ||
| type AuthMethod string | ||
|
|
||
| const ( | ||
| AuthMethodNone AuthMethod = "None" | ||
| AuthMethodBearer AuthMethod = "Bearer" | ||
| AuthMethodApiKey AuthMethod = "ApiKey" | ||
| AuthMethodBasic AuthMethod = "Basic" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. basic means user credential right? |
||
| AuthMethodJWT AuthMethod = "JWT" | ||
| AuthMethodClientCertificate AuthMethod = "ClientCertificate" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is mtls? |
||
| AuthMethodOAuth2 AuthMethod = "OAuth2" | ||
| ) | ||
|
|
||
| // CredentialRef provides a reference to a secret containing authentication credentials. | ||
| type CredentialRef struct { | ||
| // SecretRef references a Kubernetes secret containing the credential. | ||
| // +optional | ||
| SecretRef *corev1.SecretKeySelector `json:"secretRef,omitempty"` | ||
|
|
||
| // Value contains the credential value directly (not recommended for sensitive data). | ||
| // +optional | ||
| Value string `json:"value,omitempty"` | ||
|
|
||
| // HeaderName specifies the header name for API key authentication. | ||
| // +optional | ||
| HeaderName string `json:"headerName,omitempty"` | ||
| } | ||
|
|
||
| // AuthConfig provides unified authentication configuration for all components. | ||
| type AuthConfig struct { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would scope this down to |
||
| // Method defines the authentication method to use. | ||
| // +kubebuilder:validation:Required | ||
| Method AuthMethod `json:"method"` | ||
|
|
||
| // Token provides the authentication token (Bearer, API Key). | ||
| // +optional | ||
| Token *CredentialRef `json:"token,omitempty"` | ||
|
|
||
| // Basic provides basic authentication credentials. | ||
| // +optional | ||
| Basic *BasicCredentials `json:"basic,omitempty"` | ||
|
|
||
| // JWT provides JWT authentication configuration. | ||
| // +optional | ||
| JWT *JWTCredentials `json:"jwt,omitempty"` | ||
|
|
||
| // ClientCert provides client certificate authentication. | ||
| // +optional | ||
| ClientCert *ClientCertCredentials `json:"clientCert,omitempty"` | ||
|
|
||
| // OAuth2 provides OAuth2 authentication configuration. | ||
| // +optional | ||
| OAuth2 *OAuth2Credentials `json:"oAuth2,omitempty"` | ||
|
|
||
| // Timeout defines the authentication request timeout. | ||
| // +kubebuilder:default="30s" | ||
| // +optional | ||
| Timeout *metav1.Duration `json:"timeout,omitempty"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we have timeout in auth section? |
||
| } | ||
|
|
||
| // BasicCredentials defines basic authentication credentials. | ||
| type BasicCredentials struct { | ||
| // Username for basic authentication. | ||
| // +kubebuilder:validation:Required | ||
| Username string `json:"username"` | ||
|
|
||
| // Password references the password secret. | ||
| // +kubebuilder:validation:Required | ||
| Password CredentialRef `json:"password"` | ||
| } | ||
|
|
||
| // JWTCredentials defines JWT authentication credentials. | ||
| type JWTCredentials struct { | ||
| // SigningKey references the JWT signing key secret. | ||
| // +kubebuilder:validation:Required | ||
| SigningKey CredentialRef `json:"signingKey"` | ||
|
|
||
| // Algorithm defines the JWT signing algorithm. | ||
| // +kubebuilder:validation:Enum=HS256;HS384;HS512;RS256;RS384;RS512;ES256;ES384;ES512 | ||
| // +kubebuilder:default=RS256 | ||
| // +optional | ||
| Algorithm string `json:"algorithm,omitempty"` | ||
|
|
||
| // Issuer defines the expected JWT issuer. | ||
| // +optional | ||
| Issuer string `json:"issuer,omitempty"` | ||
|
|
||
| // Audience defines the expected JWT audience. | ||
| // +optional | ||
| Audience string `json:"audience,omitempty"` | ||
|
|
||
| // ExpirationTolerance defines tolerance for token expiration. | ||
| // +kubebuilder:default="30s" | ||
| // +optional | ||
| ExpirationTolerance *metav1.Duration `json:"expirationTolerance,omitempty"` | ||
| } | ||
|
|
||
| // ClientCertCredentials defines client certificate authentication. | ||
| type ClientCertCredentials struct { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how does it integrate with things such as cert manager and other cloud cert management |
||
| // CertificateRef references the client certificate secret. | ||
| // +kubebuilder:validation:Required | ||
| CertificateRef CredentialRef `json:"certificateRef"` | ||
|
|
||
| // PrivateKeyRef references the private key secret. | ||
| // +kubebuilder:validation:Required | ||
| PrivateKeyRef CredentialRef `json:"privateKeyRef"` | ||
|
|
||
| // CARef references the CA certificate secret for verification. | ||
| // +optional | ||
| CARef *CredentialRef `json:"caRef,omitempty"` | ||
|
|
||
| // VerifyServerCert controls whether to verify the server certificate. | ||
| // +kubebuilder:default=true | ||
| // +optional | ||
| VerifyServerCert *bool `json:"verifyServerCert,omitempty"` | ||
| } | ||
|
|
||
| // OAuth2Credentials defines OAuth2 authentication credentials. | ||
| type OAuth2Credentials struct { | ||
| // ClientID for OAuth2 authentication. | ||
| // +kubebuilder:validation:Required | ||
| ClientID string `json:"clientID"` | ||
|
|
||
| // ClientSecret references the OAuth2 client secret. | ||
| // +kubebuilder:validation:Required | ||
| ClientSecret CredentialRef `json:"clientSecret"` | ||
|
|
||
| // TokenURL is the OAuth2 token endpoint. | ||
| // +kubebuilder:validation:Required | ||
| TokenURL string `json:"tokenURL"` | ||
|
|
||
| // Scopes define the OAuth2 scopes to request. | ||
| // +optional | ||
| // +listType=set | ||
| Scopes []string `json:"scopes,omitempty"` | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bear token and api key are the same thing?