Skip to content
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

Add support for managing custom federated authenticators. #6105

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Thisara-Welmilla
Copy link
Contributor

@Thisara-Welmilla Thisara-Welmilla commented Nov 5, 2024

Issue:

With this PR, the IDP management service layer is enhanced to support custom federated authentication extensions.

The following changes are included:

  • Introduced a new authenticator configuration model for user-defined federated authenticators, extending the FederatedAuthenticatorConfig class.
  • The IDP management service will accept objects from both the new and existing classes.
  • Added a new class to manage the endpoint configuration of the custom authentication extension.
  • Enhanced the DAO layer to accommodate endpoint configuration management for user-defined federated authenticators.
  • Improved unit tests to cover the new code changes.

API layer PR:

@Thisara-Welmilla Thisara-Welmilla marked this pull request as draft November 5, 2024 08:28
@Thisara-Welmilla Thisara-Welmilla force-pushed the add-cutsom-fed-auth-mgt-support branch 2 times, most recently from 6ce13a6 to e887bdf Compare November 5, 2024 08:33
@Thisara-Welmilla Thisara-Welmilla force-pushed the add-cutsom-fed-auth-mgt-support branch 3 times, most recently from a6d7a29 to 16268ae Compare November 5, 2024 10:12
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 61.34969% with 63 lines in your changes missing coverage. Please review.

Project coverage is 40.75%. Comparing base (3f9afca) to head (17ca08e).
Report is 57 commits behind head on master.

Files with missing lines Patch % Lines
.../org/wso2/carbon/idp/mgt/dao/IdPManagementDAO.java 56.25% 27 Missing and 1 partial ⚠️
...til/AuthenticatorEndpointConfigurationManager.java 65.38% 24 Missing and 3 partials ⚠️
...dp/mgt/internal/IdPManagementServiceComponent.java 0.00% 4 Missing ⚠️
...action/management/ActionManagementServiceImpl.java 0.00% 1 Missing and 1 partial ⚠️
...enticatorEndpointConfigurationServerException.java 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6105      +/-   ##
============================================
- Coverage     40.94%   40.75%   -0.20%     
+ Complexity    14607    14569      -38     
============================================
  Files          1767     1775       +8     
  Lines        118050   118301     +251     
  Branches      19169    20420    +1251     
============================================
- Hits          48339    48210     -129     
- Misses        62426    62799     +373     
- Partials       7285     7292       +7     
Flag Coverage Δ
unit 25.12% <61.34%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Thisara-Welmilla Thisara-Welmilla force-pushed the add-cutsom-fed-auth-mgt-support branch 2 times, most recently from c34802d to 855a182 Compare November 5, 2024 11:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 suggestion.

Files not reviewed (2)
  • components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/dao/IdPManagementDAO.java: Evaluated as low risk
  • components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/IdPManagementConstants.java: Evaluated as low risk
Comments skipped due to low confidence (1)

components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/util/AuthenticatorEndpointConfigurationManager.java:166

  • The method should accept AuthenticationType as a parameter instead of hardcoding IDENTIFICATION.
return new UserDefinedFederatedAuthenticatorConfig(AuthenticatorPropertyConstants.AuthenticationType.IDENTIFICATION);

@Thisara-Welmilla Thisara-Welmilla force-pushed the add-cutsom-fed-auth-mgt-support branch 5 times, most recently from 4f4026e to e282f69 Compare November 6, 2024 05:47
Comment on lines 35 to 37
public UserDefinedAuthenticatorEndpointConfig(EndpointConfig endpointConfig) {

this.endpointConfig = endpointConfig;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need this ? Then why we need a builder and have a private constructor ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this constructor introduced, we can create UserDefinedAuthenticatorEndpointConfig object just giving the endpoint object from action, like here https://github.com/wso2/carbon-identity-framework/pull/6105/files#diff-e15e35779957907ba8ea90f73d573eed6e57f3180c7412df385ec887597b20a7R128

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the builder as well. Switch to one mode

@Thisara-Welmilla Thisara-Welmilla force-pushed the add-cutsom-fed-auth-mgt-support branch 2 times, most recently from 08d0add to fe5a424 Compare November 10, 2024 06:56
Copy link

sonarcloud bot commented Nov 12, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants