-
Notifications
You must be signed in to change notification settings - Fork 9
add k8s rbac & project api #320
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: master
Are you sure you want to change the base?
Changes from all commits
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,5 @@ | ||
| # Connector [dex.coreos.com/v1] | ||
|
|
||
| <OpenAPIPath path="/apis/dex.coreos.com/v1/namespaces/{namespace}/connectors" /> | ||
|
|
||
| <OpenAPIPath path="/apis/dex.coreos.com/v1/namespaces/{namespace}/connectors/{name}" /> | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| --- | ||||||
| --- | ||||||
|
|
||||||
|
Comment on lines
+1
to
+3
|
||||||
| --- | |
| --- |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| --- | ||||||
| --- | ||||||
|
|
||||||
|
Comment on lines
+1
to
+3
|
||||||
| --- | |
| --- |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||||||||||||||
| # Project [auth.alauda.io/v1] | ||||||||||||||||||
| <OpenAPIPath path="/apis/auth.alauda.io/v1/projects" /> | ||||||||||||||||||
|
|
||||||||||||||||||
| <OpenAPIPath path="/apis/auth.alauda.io/v1/projects/{name}" /> | ||||||||||||||||||
|
|
||||||||||||||||||
| <K8sCrd name="projects.auth.alauda.io" /> | ||||||||||||||||||
|
Comment on lines
+1
to
+6
Contributor
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. 🧩 Analysis chainVerify corresponding CRD file exists for projects.auth.alauda.io. Line 6 references a CRD declaration for 🏁 Script executed: #!/bin/bash
# Verify the Project CRD file exists and is valid YAML
fd -e yaml docs/shared/crds | grep -i project
cat docs/shared/crds/auth.alauda.io_projects.yaml 2>/dev/null | head -20Length of output: 369 🏁 Script executed: #!/bin/bash
# Verify the Project CRD file exists using corrected fd syntax
echo "=== Searching for Project CRD files ==="
fd --full-path 'auth.alauda.io_projects.yaml' docs/shared/crds 2>/dev/null
echo "=== Checking if docs/shared/crds directory exists ==="
ls -la docs/shared/crds 2>&1 | head -30
echo "=== Listing all YAML files in CRDs directory ==="
fd . docs/shared/crds -e yaml 2>&1 | head -20Length of output: 2568 The CRD file for projects.auth.alauda.io is missing. Line 6 references 🤖 Prompt for AI Agents
Comment on lines
+2
to
+6
|
||||||||||||||||||
| <OpenAPIPath path="/apis/auth.alauda.io/v1/projects" /> | |
| <OpenAPIPath path="/apis/auth.alauda.io/v1/projects/{name}" /> | |
| <K8sCrd name="projects.auth.alauda.io" /> | |
| <OpenAPIPath pathPrefix="/kubernetes/{cluster}" path="/apis/auth.alauda.io/v1/projects" /> | |
| <OpenAPIPath pathPrefix="/kubernetes/{cluster}" path="/apis/auth.alauda.io/v1/projects/{name}" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # ClusterRole [rbac.authorization.k8s.io/v1] | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/clusterroles" pathPrefix="/kubernetes/{cluster}" /> | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" pathPrefix="/kubernetes/{cluster}" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # ClusterRoleBinding [rbac.authorization.k8s.io/v1] | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" pathPrefix="/kubernetes/{cluster}" /> | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" pathPrefix="/kubernetes/{cluster}" /> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| --- | ||||||
| --- | ||||||
|
|
||||||
|
Comment on lines
+1
to
+3
|
||||||
| --- | |
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Role [rbac.authorization.k8s.io/v1] | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" pathPrefix="/kubernetes/{cluster}" /> | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" pathPrefix="/kubernetes/{cluster}" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # RoleBinding [rbac.authorization.k8s.io/v1] | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" pathPrefix="/kubernetes/{cluster}" /> | ||
|
|
||
| <OpenAPIPath path="/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" pathPrefix="/kubernetes/{cluster}" /> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| --- | ||||||
| --- | ||||||
|
|
||||||
|
Comment on lines
+1
to
+3
|
||||||
| --- | |
| --- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # ServiceAccount [v1] | ||
|
|
||
| <OpenAPIPath path="/api/v1/namespaces/{namespace}/serviceaccounts" pathPrefix="/kubernetes/{cluster}" /> | ||
|
|
||
| <OpenAPIPath path="/api/v1/namespaces/{namespace}/serviceaccounts/{name}" pathPrefix="/kubernetes/{cluster}" /> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| --- | ||||||
| --- | ||||||
|
|
||||||
|
Comment on lines
+1
to
+3
|
||||||
| --- | |
| --- |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||||||||||
| # User [auth.alauda.io/v1] | ||||||||||||||
| <OpenAPIPath path="/apis/auth.alauda.io/v1/users" /> | ||||||||||||||
|
|
||||||||||||||
| <OpenAPIPath path="/apis/auth.alauda.io/v1/users/{name}" /> | ||||||||||||||
|
Comment on lines
+2
to
+4
|
||||||||||||||
| <OpenAPIPath path="/apis/auth.alauda.io/v1/users" /> | |
| <OpenAPIPath path="/apis/auth.alauda.io/v1/users/{name}" /> | |
| <OpenAPIPath pathPrefix="/kubernetes/{cluster}" path="/apis/auth.alauda.io/v1/users" /> | |
| <OpenAPIPath pathPrefix="/kubernetes/{cluster}" path="/apis/auth.alauda.io/v1/users/{name}" /> |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,161 @@ | ||||||||||||||||||||||||||||||||||||||||||
| apiVersion: apiextensions.k8s.io/v1 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| kind: CustomResourceDefinition | ||||||||||||||||||||||||||||||||||||||||||
| metadata: | ||||||||||||||||||||||||||||||||||||||||||
| annotations: | ||||||||||||||||||||||||||||||||||||||||||
| controller-gen.kubebuilder.io/version: v0.9.2 | ||||||||||||||||||||||||||||||||||||||||||
| name: users.auth.alauda.io | ||||||||||||||||||||||||||||||||||||||||||
| spec: | ||||||||||||||||||||||||||||||||||||||||||
| conversion: | ||||||||||||||||||||||||||||||||||||||||||
| strategy: None | ||||||||||||||||||||||||||||||||||||||||||
| group: auth.alauda.io | ||||||||||||||||||||||||||||||||||||||||||
| names: | ||||||||||||||||||||||||||||||||||||||||||
| kind: User | ||||||||||||||||||||||||||||||||||||||||||
| listKind: UserList | ||||||||||||||||||||||||||||||||||||||||||
| plural: users | ||||||||||||||||||||||||||||||||||||||||||
| singular: user | ||||||||||||||||||||||||||||||||||||||||||
| scope: Cluster | ||||||||||||||||||||||||||||||||||||||||||
| versions: | ||||||||||||||||||||||||||||||||||||||||||
| - additionalPrinterColumns: | ||||||||||||||||||||||||||||||||||||||||||
| - jsonPath: .spec.connector_type | ||||||||||||||||||||||||||||||||||||||||||
| name: Type | ||||||||||||||||||||||||||||||||||||||||||
| type: string | ||||||||||||||||||||||||||||||||||||||||||
| - jsonPath: .spec.email | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| - jsonPath: .spec.email | |
| - jsonPath: .spec.username |
Copilot
AI
Apr 20, 2026
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.
The connector_type field description still contains the kubebuilder scaffolding placeholder ("INSERT ADDITIONAL SPEC FIELDS..." / "Run "make" to regenerate..."). This reads like internal developer guidance rather than API documentation; it should be replaced with a real description (or removed).
| description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | |
| Important: Run "make" to regenerate code after modifying | |
| this file' | |
| description: ConnectorType identifies the type of identity connector | |
| associated with the user |
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.
Broad use of x-kubernetes-preserve-unknown-fields at multiple levels.
The CRD uses x-kubernetes-preserve-unknown-fields: true at both the spec level (line 85) and root level (line 134). While this enables flexibility for third-party integrations (noted in the extra field comment), it also:
- Allows arbitrary fields that may mask schema validation issues
- Increases the risk of unintended data acceptance
- Makes schema evolution harder to track
Consider narrowing the preserve-unknown-fields scope to only the extra field if possible, or document the rationale for the broader application.
Also applies to: 134-134
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.
The password and old_password fields are stored as plain strings in the User resource spec. Kubernetes resources are persisted in etcd by default, which is not the appropriate place for credential storage. Credentials should be managed via Kubernetes Secrets.
Consider:
- Removing password fields from the spec and managing them separately via Secrets.
- If passwords must be included, ensure etcd encryption and access controls are strictly configured.
- Document the security implications and expected access restrictions.
Copilot
AI
Apr 20, 2026
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.
This CRD manifest includes a populated status.conditions section with concrete timestamps/messages. In this repo, the CRD YAMLs under docs/shared/crds/ typically keep status empty (e.g., docs/shared/crds/ait.alauda.io_inspections.yaml:150-155), so these values will go stale and create noisy diffs. Consider stripping runtime status.* content (or normalizing it to the empty placeholder form).
| status: | |
| acceptedNames: | |
| kind: User | |
| listKind: UserList | |
| plural: users | |
| singular: user | |
| conditions: | |
| - lastTransitionTime: 2025-11-06T16:16:25Z | |
| message: no conflicts found | |
| reason: NoConflicts | |
| status: "True" | |
| type: NamesAccepted | |
| - lastTransitionTime: 2025-11-06T16:16:25Z | |
| message: the initial names have been accepted | |
| reason: InitialNamesAccepted | |
| status: "True" | |
| type: Established | |
| storedVersions: | |
| - v1 | |
| status: {} |
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.
These OpenAPI paths are missing
pathPrefix="/kubernetes/{cluster}", while other Kubernetes API docs in this PR include it (e.g., RBAC/ServiceAccount pages). Without the prefix, the rendered endpoint URLs will be inconsistent/likely incorrect for cluster-scoped routing.