-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow the UI to store user preferences #926
Comments
@carlosthe19916 @chirino maybe you can take a look and check if that is what you'd need. |
Some context:
We can use this https://www.figma.com/design/go1K9B6nRryAqsyzZX8v9n/SPoG-useCases?node-id=720-30306&node-type=canvas&t=QTmiWaKbN9XlVqOr-0 as a reference How it currently works in V1:
{
"sbom1": null,
"sbom2": null,
"sbom3": null,
"sbom4": null
}
{
"sbom1": null,
"sbom2": "SBOM1_ID",
"sbom3": null,
"sbom4": "SBOM4_ID",
}
The client sends exactly the same body he will get when using the GET Method. E.g. {
"sbom1": null,
"sbom2": "SBOM1_ID",
"sbom3": null,
"sbom4": "SBOM4_ID",
} And this value is saved in the DB Notes:
Could we have something similar in this repository? We can rename the url endpoint and field names but the core principle could be the same. I am not sure allowing the client to set
|
The idea was to just use
Which basically means, that if you'd use the following endpoint: Again on the pro side, the UI can choose new keys, without any changes on the backend. Translating a 404 into an empty (default) result, shouldn't be a problem for the UI.
What makes you assume additional complexity?
That's ensured be the logic described above and in the original comment. Where do you see an issue? |
I don't think the user id should be part of the path key. That should be extracted by the http handler from the auth token. |
Proposal
We create a simple CRUD API for user preferences. The endpoint looks like this:
Where
key
is any ID the UI picks. Values are unique by a combination of user + key. The user is derived from the OIDC bearer token provided during the request. The content is opaque to the backend. If a key is not present for a user, it returns a 404.There is no way to list preferences. We could do that, but right now I don't see a use case.
Pros
Cons
The text was updated successfully, but these errors were encountered: