-
Notifications
You must be signed in to change notification settings - Fork 691
Provide support to add named configs map for authenticators #4363
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: 4.10.x
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds support for named configuration maps in authenticators, allowing configurations to be organized in named groups rather than just flat parameter maps. This enables more structured configuration management for authenticators while maintaining backward compatibility with existing flat parameter configurations.
Key changes:
- Introduces a nested parameter map structure alongside the existing flat parameter map
- Adds processing logic to handle both named and unnamed configuration elements
- Provides new getter methods to access named configurations
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...so2.carbon.core/src/main/java/org/wso2/carbon/core/security/AuthenticatorsConfiguration.java
Show resolved
Hide resolved
...so2.carbon.core/src/main/java/org/wso2/carbon/core/security/AuthenticatorsConfiguration.java
Show resolved
Hide resolved
...so2.carbon.core/src/main/java/org/wso2/carbon/core/security/AuthenticatorsConfiguration.java
Show resolved
Hide resolved
...so2.carbon.core/src/main/java/org/wso2/carbon/core/security/AuthenticatorsConfiguration.java
Outdated
Show resolved
Hide resolved
|
|
||
| // Only process configs that have an explicit name attribute. | ||
| OMAttribute configNameAttr = configElement.getAttribute(new QName(ATTR_NAME)); | ||
| if(configNameAttr == null){ |
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.
Formatting issue
...so2.carbon.core/src/main/java/org/wso2/carbon/core/security/AuthenticatorsConfiguration.java
Outdated
Show resolved
Hide resolved
...so2.carbon.core/src/main/java/org/wso2/carbon/core/security/AuthenticatorsConfiguration.java
Outdated
Show resolved
Hide resolved
|
|
||
| // Only process configs that have an explicit name attribute. | ||
| OMAttribute configNameAttr = configElement.getAttribute(new QName(ATTR_NAME)); | ||
| if(configNameAttr == null){ |
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.
It unclear what are we trying to achieve here.
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.
Currently we can have define as below
<Config>
<Parameter name="name01">value01</Parameter>
<Parameter name="name02">value02</Parameter>
</Config>
With this new config we are providing the support to define named config along with the previous support. so now we can have something like this
<Config>
<Parameter name="name01">value01</Parameter>
<Parameter name="name02">value02</Parameter>
</Config>
<Config name="configName">
<Parameter name="name01">value01</Parameter>
<Parameter name="name02">value02</Parameter>
</Config>
| OMAttribute configNameAttr = configElement.getAttribute(new QName(ATTR_NAME)); | ||
| if(configNameAttr == null){ | ||
| // Skip configs without name attribute - process parameters for flat map only. | ||
| for(Iterator paramIterator = configElement.getChildrenWithLocalName(ELEM_PARAMETER); |
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.
Can we avoid iterating the elements twice?
Purpose
$subject
With this new support we can define new configurations for Authenticators as below.