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

Policy Deleted - Partial import of client authorization with multiple files #783

Closed
GretUp opened this issue Sep 15, 2022 · 2 comments · Fixed by #905
Closed

Policy Deleted - Partial import of client authorization with multiple files #783

GretUp opened this issue Sep 15, 2022 · 2 comments · Fixed by #905

Comments

@GretUp
Copy link

GretUp commented Sep 15, 2022

Problem Statement

I have multiple files which add roles, resources, policies and permissions. How am I able to do this without deleting the entities which are not present in the current json? At the moment if e.g. a policy does not exist in a json it gets deleted.

I tried to figure out a mechanism: https://github.com/adorsys/keycloak-config-cli/blob/0c14bb2f3ec14b1363f7a1e4fe85670d8542ea5f/docs/MANAGED.md
But still cant find a solution. Maybe you can rewrite the page so it is easier to understand; maybe with examples.

e.g. I have troubles understanding the sentence: "For example if a group isn't defined inside the import json but other groups specified, keycloak-config-cli will calculate the difference and delete the group from keycloak."

BTW: If I use "--import.state" I am getting an error: The elements [import.state] were left unbound.

Proposed Solution

Implement a flag where policies/permissions are not deleted when not present in a json.
Update the documentation so it is understandable.

Environment

  • Keycloak Version: [18.0.2]
  • keycloak-config-cli Version: [5.3.1]
  • Java Version: [11.0.2]

Additional information

I changed in application.properties:

import.managed.role=no-delete
import.managed.client=no-delete
import.managed.client-authorization-resources=no-delete

But still......policies are getting deleted.

Acceptance Criteria

No response

@GretUp GretUp changed the title Partial import of client authorization with multiple files Policy Deleted - Partial import of client authorization with multiple files Sep 16, 2022
@jkroepke
Copy link
Contributor

Could you try to use a different --import.cache.key for each file?

@GretUp
Copy link
Author

GretUp commented Sep 19, 2022

Hi @jkroepke ,

Sorry, I am new to this tool.
Can you give some examples?
Where are the parameters described?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants