Replies: 1 comment 1 reply
-
|
Summary of the team discussion: API that requires As an exception would make reading an inconsistent client unreadable and could, no exception should be thrown. Instead, issue a low priority warning. This would allow someone monitoring a production system to find the entity that has the inconsistency and to clean up the data. Action items for @ahus1:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem statement
While Keycloak uses current internal attributes that are sometimes single-value, there has been a decision to make all attribute-containing map storage entities multi-valued, please see: https://issues.redhat.com/browse/KEYCLOAK-15572.
The current code selects the first entry if there is one or multiple entries in MapClientAdapter via
entry.getValue().get(0).This could lead to problems when someone reads a client and doesn't see the additional values for an attribute.
The missing data might have a security implication.
This could occur in the following ways:
Approach
Apply a defensive programming style to throw an exception in this unsupported case of multiple attribute values and throw a runtime exception. Suggested exception type:
ModelException.Benefits
Ensuring that only consistent data is presented to the caller, and subsequent saving of incomplete data is prevented.
Alternatives
Leave it "as is".
For future cases, apply YAGNI and reduce complexity of the solution buy not adding features that are not needed at the moment.
Beta Was this translation helpful? Give feedback.
All reactions