-
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 @@ | ||
| --- | ||
| --- | ||
|
|
||
| # Connector APIs | ||
|
|
||
| <Overview overviewHeaders={[]} /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| --- | ||
|
|
||
| # Project APIs | ||
|
|
||
| <Overview overviewHeaders={[]} /> |
| 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" /> | ||
| 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 @@ | ||
| --- | ||
| --- | ||
|
|
||
| # RBAC APIs | ||
|
|
||
| <Overview overviewHeaders={[]} /> |
| 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 @@ | ||
| --- | ||
| --- | ||
|
|
||
| # ServiceAccount APIs | ||
|
|
||
| <Overview overviewHeaders={[]} /> |
| 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 @@ | ||
| --- | ||
| --- | ||
|
|
||
| # User APIs | ||
|
|
||
| <Overview overviewHeaders={[]} /> |
| 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}" /> | ||
|
|
||
| <K8sCrd name="users.auth.alauda.io" /> |
| 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 | ||
| name: Username | ||
| type: string | ||
| - jsonPath: .metadata.creationTimestamp | ||
| name: Age | ||
| type: date | ||
| name: v1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| description: User is the Schema for the users API | ||
| properties: | ||
| apiVersion: | ||
| description: "APIVersion defines the versioned schema of this representation of | ||
| an object. Servers should convert recognized schemas to the | ||
| latest internal value, and may reject unrecognized values. More | ||
| info: | ||
| https://git.k8s.io/community/contributors/devel/sig-architectur\ | ||
| e/api-conventions.md#resources" | ||
| type: string | ||
| kind: | ||
| description: "Kind is a string value representing the REST resource this object | ||
| represents. Servers may infer this from the endpoint the client | ||
| submits requests to. Cannot be updated. In CamelCase. More info: | ||
| https://git.k8s.io/community/contributors/devel/sig-architectur\ | ||
| e/api-conventions.md#types-kinds" | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: UserSpec defines the desired state of User | ||
| properties: | ||
| account: | ||
| type: string | ||
| connector_id: | ||
| type: string | ||
| connector_name: | ||
| type: string | ||
| connector_type: | ||
| description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
| Important: Run "make" to regenerate code after modifying | ||
| this file' | ||
| type: string | ||
| continuity_errors: | ||
| type: integer | ||
| email: | ||
| type: string | ||
| expired: | ||
| description: Expired ... | ||
| properties: | ||
| begin: | ||
| format: date-time | ||
| type: string | ||
| end: | ||
| format: date-time | ||
| type: string | ||
| required: | ||
| - begin | ||
| - end | ||
| type: object | ||
| extra: | ||
| description: Extra contains additional arbitrary metadata for the user from | ||
| third-party systems | ||
| type: object | ||
| x-kubernetes-preserve-unknown-fields: true | ||
|
Comment on lines
+82
to
+85
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. Broad use of x-kubernetes-preserve-unknown-fields at multiple levels. The CRD uses
Consider narrowing the preserve-unknown-fields scope to only the Also applies to: 134-134 |
||
| groups: | ||
| items: | ||
| type: string | ||
| type: array | ||
| ids: | ||
| items: | ||
| properties: | ||
| id: | ||
| type: string | ||
| type: | ||
| type: string | ||
| required: | ||
| - id | ||
| - type | ||
| type: object | ||
| type: array | ||
| is_admin: | ||
| type: boolean | ||
| is_disabled: | ||
| type: boolean | ||
| last_login_time: | ||
| type: string | ||
| mail: | ||
| type: string | ||
| mobile: | ||
| type: string | ||
| old_password: | ||
| type: string | ||
| password: | ||
| type: string | ||
|
Comment on lines
+112
to
+115
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. The Consider:
|
||
| state: | ||
| description: State is User's State | ||
| type: string | ||
| username: | ||
| type: string | ||
| valid: | ||
| type: boolean | ||
| webhookType: | ||
| type: string | ||
| webhookUrl: | ||
| type: string | ||
| required: | ||
| - connector_name | ||
| - connector_type | ||
| - is_admin | ||
| - username | ||
| type: object | ||
| x-kubernetes-preserve-unknown-fields: true | ||
| status: | ||
| description: UserStatus defines the observed state of User | ||
| type: object | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} | ||
| 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 | ||
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.
🧩 Analysis chain
Verify corresponding CRD file exists for projects.auth.alauda.io.
Line 6 references a CRD declaration for
projects.auth.alauda.io, but the corresponding CRD YAML file is not included in this PR for review. Ensuredocs/shared/crds/auth.alauda.io_projects.yamlexists and is properly formatted.🏁 Script executed:
Length of output: 369
🏁 Script executed:
Length of output: 2568
The CRD file for projects.auth.alauda.io is missing.
Line 6 references
<K8sCrd name="projects.auth.alauda.io" />, but the corresponding CRD YAML filedocs/shared/crds/auth.alauda.io_projects.yamldoes not exist in the repository. Thedocs/shared/crds/directory contains 16 CRD files, includingauth.alauda.io_users.yaml, but no projects CRD. Either create the missing CRD file or remove the K8sCrd reference if it is not yet implemented.🤖 Prompt for AI Agents