-
Notifications
You must be signed in to change notification settings - Fork 107
feat: add selectedK8sContexts to Preference and user prefs API #673
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,53 @@ paths: | |
| $ref: "#/components/responses/401" | ||
| "500": | ||
| $ref: "#/components/responses/500" | ||
|
|
||
| /api/user/prefs: | ||
| get: | ||
| tags: | ||
| - users | ||
| operationId: getUserPrefs | ||
| summary: Get user preferences | ||
| description: Returns the current user's preferences including selected K8s contexts, load test settings, and other UI preferences. | ||
| x-internal: | ||
| - meshery | ||
| responses: | ||
| "200": | ||
| description: User preferences | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Preference" | ||
| "401": | ||
| $ref: "#/components/responses/401" | ||
| "500": | ||
| $ref: "#/components/responses/500" | ||
| post: | ||
| tags: | ||
| - users | ||
| operationId: updateUserPrefs | ||
| summary: Update user preferences | ||
| description: Merges the provided fields into the current user's preferences. Only the fields present in the request body are updated. | ||
| x-internal: | ||
| - meshery | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Preference" | ||
|
Comment on lines
+133
to
+141
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 description for this However, the For a partial update endpoint, the request body schema should not have required fields. Please consider one of the following solutions:
This will make the API more intuitive and align the schema with the endpoint's described functionality.
Comment on lines
+133
to
+141
|
||
| responses: | ||
| "200": | ||
| description: Updated user preferences | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Preference" | ||
| "401": | ||
| $ref: "#/components/responses/401" | ||
| "500": | ||
| $ref: "#/components/responses/500" | ||
|
|
||
| components: | ||
| responses: | ||
| 400: | ||
|
|
@@ -482,6 +529,11 @@ components: | |
| usersExtensionPreferences: | ||
| type: object | ||
| additionalProperties: true | ||
| selectedK8sContexts: | ||
| type: array | ||
| description: Persisted selection of active Kubernetes context IDs | ||
| items: | ||
| type: string | ||
| remoteProviderPreferences: | ||
| type: object | ||
| additionalProperties: true | ||
|
|
||
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.
/api/user/prefsoperations don’t declare anysecurityrequirements (and the spec has no top-levelsecurityeither), which makes these endpoints effectively unauthenticated in the OpenAPI contract despite defining 401 responses. Add a top-levelsecurity: [{ jwt: [] }]for this spec or add per-operationsecurityblocks for the new prefs endpoints.