Skip to content

[WFCORE-7258] Make use of ModuleIdentifierUtil.MODULE_NAME_CORRECTOR on the attributes that could require it#6584

Open
mskacelik wants to merge 1 commit into
wildfly:mainfrom
mskacelik:WFCORE-7258
Open

[WFCORE-7258] Make use of ModuleIdentifierUtil.MODULE_NAME_CORRECTOR on the attributes that could require it#6584
mskacelik wants to merge 1 commit into
wildfly:mainfrom
mskacelik:WFCORE-7258

Conversation

@mskacelik
Copy link
Copy Markdown
Contributor

issue: https://issues.redhat.com/browse/WFCORE-7258

Hopefully I applied correctly all the correctors.

Copy link
Copy Markdown
Contributor

@yersan yersan left a 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)
Copy link
Copy Markdown
Contributor

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

current = current.getModule(ModuleIdentifierUtil.parseCanonicalModuleIdentifier(module));

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.

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor

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

/**
* 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.

Copy link
Copy Markdown
Contributor

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

@wildfly-ci

This comment was marked as outdated.

@yersan yersan requested a review from darranl December 9, 2025 16:08
Copy link
Copy Markdown
Contributor

@darranl darranl left a 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

@darranl
Copy link
Copy Markdown
Contributor

darranl commented Dec 10, 2025

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?"

@yersan yersan added the 32.x PRs meant for 32.x (corresponding to WildFly 40.x) label Jan 7, 2026
@darranl
Copy link
Copy Markdown
Contributor

darranl commented Feb 3, 2026

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?

@yersan yersan removed the 32.x PRs meant for 32.x (corresponding to WildFly 40.x) label Feb 4, 2026
@github-actions
Copy link
Copy Markdown

There has been no activity on this PR for 45 days. It will be auto-closed after 90 days.

@github-actions github-actions Bot added the Stale label Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants