-
-
Notifications
You must be signed in to change notification settings - Fork 479
[WFCORE-7258] Make use of ModuleIdentifierUtil.MODULE_NAME_CORRECTOR on the attributes that could require it #6584
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
base: main
Are you sure you want to change the base?
Conversation
yersan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the module will be provided now in a canonicalized form, apparently, we can now remove the canonicalization request done at
Line 46 in 481cbde
| current = current.getModule(ModuleIdentifierUtil.parseCanonicalModuleIdentifier(module)); |
The only one I have in doubt is the invocation of that method from
wildfly-core/elytron/src/main/java/org/wildfly/extension/elytron/JaasCustomSecurityRealmWrapper.java
Line 63 in bb0806b
| String moduleNameParam = configuration.get("module"); |
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
wildfly-core/controller/src/main/java/org/jboss/as/controller/ModuleIdentifierUtil.java
Lines 94 to 97 in b5ab648
| /** | |
| * A {@link ParameterCorrector} that {@link #parseCanonicalModuleIdentifier(String) canonicalizes} | |
| * values that are meant to represent JBoss Modules module names. | |
| */ |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
elytron/src/main/java/org/wildfly/extension/elytron/DirContextDefinition.java
Show resolved
Hide resolved
.../src/main/java/org/jboss/as/host/controller/discovery/DiscoveryOptionResourceDefinition.java
Show resolved
Hide resolved
.../src/main/java/org/jboss/as/server/controller/resources/ModuleLoadingResourceDefinition.java
Show resolved
Hide resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?" |
issue: https://issues.redhat.com/browse/WFCORE-7258
Hopefully I applied correctly all the correctors.