[WFCORE-7258] Make use of ModuleIdentifierUtil.MODULE_NAME_CORRECTOR on the attributes that could require it#6584
[WFCORE-7258] Make use of ModuleIdentifierUtil.MODULE_NAME_CORRECTOR on the attributes that could require it#6584mskacelik wants to merge 1 commit into
Conversation
yersan
left a comment
There was a problem hiding this comment.
@mskacelik Added some comments, notice that the ultimate goal here by moving the module name corrector to the attributes, is also to avoid parsing to the canonize form twice ... it is a bit tricky, so we need to closely review this
| static final SimpleAttributeDefinition MODULE = new SimpleAttributeDefinitionBuilder(ElytronDescriptionConstants.MODULE, ModelType.STRING, true) | ||
| .setAttributeGroup(ElytronDescriptionConstants.CLASS_LOADING) | ||
| .setAllowExpression(false) | ||
| .setCorrector(ModuleIdentifierUtil.MODULE_NAME_CORRECTOR) |
There was a problem hiding this comment.
Since the module will be provided now in a canonicalized form, apparently, we can now remove the canonicalization request done at
The only one I have in doubt is the invocation of that method from
@darranl What's your feeling about this? Would this configuration.get("module") always be in a canonicalized form? I've tried by finding the usages of the enclosing method, but it returns that there are no usages at all, so not sure from where this method gets invoked.
There was a problem hiding this comment.
Unless I am misreading this comment this sounds like a breaking change we can not make to the management model.
Is the call to parseCanonicalModuleIdentifier more permissive than ModuleIdentifierUtil.MODULE_NAME_CORRECTOR?
There was a problem hiding this comment.
@darranl The ModuleIdentifierUtil.MODULE_NAME_CORRECTOR as an attribute corrector just moves the #parseCanonicalModuleIdentifier(String) to the attribute, so it will always return the canonicalized form of the module, see
They are equivalents, but having it at the attribute level is preferred since it is supposed to be the entry of the user values.
There was a problem hiding this comment.
The idea has always been to place this sort of conversions/adjustments as close as possible to the external inputs, hence on the attribute definitions via ModuleIdentifierUtil.MODULE_NAME_CORRECTOR, however, for this JaasCustomSecurityRealmWrapper.java class, which is indeed deprecated, I'm not sure what the external input is for this configuration object
efc8404 to
cd8bbd5
Compare
…on the attributes that could require it
cd8bbd5 to
927029f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
darranl
left a comment
There was a problem hiding this comment.
This sounds at risk of being a breaking model change.
I think I would like to see test cases that demonstrate that working values that can be specified today will continue to work without error even where we previously relied on passing them through parseCanonicalModuleIdentifier
|
The part I would still like to confirm is, "Is there a chance that this is going to break previously valid configurations causing those to have model time validation errors as they migrate to the WildFly version that contains this?" |
|
Can we guarantee that all existing configurations will still pass even if different formats may have been used in them? Should we maybe have a test case to demonstrate that this does not break backwards compatibility? |
|
There has been no activity on this PR for 45 days. It will be auto-closed after 90 days. |
issue: https://issues.redhat.com/browse/WFCORE-7258
Hopefully I applied correctly all the correctors.