Skip to content
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

File map storage: Entities changing their ID (example: clientId change) #16881

Closed
ahus1 opened this issue Feb 7, 2023 · 1 comment · Fixed by #17235
Closed

File map storage: Entities changing their ID (example: clientId change) #16881

ahus1 opened this issue Feb 7, 2023 · 1 comment · Fixed by #17235
Assignees
Labels
kind/enhancement Categorizes a PR related to an enhancement

Comments

@ahus1
Copy link
Contributor

ahus1 commented Feb 7, 2023

Description

For some entities, the file store uses the name humans refer to them as a file name and as a reference in the YAML files. One of these examples is the clientId.

When the user changes the clientId in the UI, the current implementation updates the clientId in the YAML file, but doesn't yet change the name of the file. In addition to that, all the references to that client in the file store need updating, for example the client roles (at the time of writing, they are stored in a folder with the clientId, and they also store the clientId in their YAML).

Discussion

Current behavior:

  • Create a client with the UI (and save)
  • Create a client role (and save)
  • Rename the clientId (and save)
  • Go to the list of clients -> client appears with the the new clientId
  • Pick the new client from the list -> client not found, as the file on disk hasn't been renamed

Expected behavior:

  • After renaming a clientId, the client should be pickable from the list of clients, and the client roles should still be visible.

Similar problems might appear for other entities.

Motivation

The file store uses for entities humans refer to a derived ID from a descriptive name of the entity. When that name changes, and therefore its ID, all references need to change.

Details

No response

@ahus1 ahus1 added kind/enhancement Categorizes a PR related to an enhancement status/triage labels Feb 7, 2023
@ahus1 ahus1 changed the title File store: Entities changing their ID (example: Client ID change) File map storage: Entities changing their ID (example: Client ID change) Feb 7, 2023
@ahus1 ahus1 changed the title File map storage: Entities changing their ID (example: Client ID change) File map storage: Entities changing their ID (example: clientId change) Feb 7, 2023
@hmlnarik
Copy link
Contributor

This issue is akin source refactoring (e.g. rename class), with additional complexity of maintaining the state across potentially multiple stores in tree store.

It may be developed for special cases in the future, but at this moment, changing ID will not be supported in the file store.

hmlnarik added a commit to hmlnarik/keycloak that referenced this issue Feb 22, 2023
@mhajas mhajas closed this as completed in 878debd Feb 22, 2023
@ghost ghost removed the status/triage label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes a PR related to an enhancement
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants