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

Update the /identity-providers/ API to manage user-defined federated authenticators. #735

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

Conversation

Thisara-Welmilla
Copy link
Contributor

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

Issue:

This PR introduces improvements to the following APIs for managing user-defined federated authenticators:

  • /identity-providers: Updated the request body for the PUT request to accept both authenticator configuration models.
  • /identity-providers/{identity-provider-id}/federated-authenticators: Updated the request body for the PUT request to accept both authenticator configuration models.
  • /identity-providers/{identity-provider-id}/federated-authenticators/{federated-authenticator-id}: Updated the response and request bodies for both GET and PUT requests to accommodate both models.

Service layer PR:

@Thisara-Welmilla Thisara-Welmilla force-pushed the add-API-support-create-user-def-auth-fed branch from 05be0f7 to cfc2832 Compare November 11, 2024 17:04
@Thisara-Welmilla Thisara-Welmilla force-pushed the add-API-support-create-user-def-auth-fed branch from 553c635 to 88ce34f Compare November 12, 2024 04:54
@Thisara-Welmilla Thisara-Welmilla changed the title Update /identity-provider/ API to manage user defined federated authenticators. Update the /identity-providers/ API to manage user-defined federated authenticators. Nov 12, 2024
@Thisara-Welmilla Thisara-Welmilla force-pushed the add-API-support-create-user-def-auth-fed branch 2 times, most recently from 2d0d880 to 65d508c Compare November 12, 2024 09:27
@Thisara-Welmilla Thisara-Welmilla force-pushed the add-API-support-create-user-def-auth-fed branch from 65d508c to 6d3a143 Compare November 12, 2024 09:49
String authenticatorName = getDecodedAuthenticatorName(authenticator.getAuthenticatorId());
String definedByType;
if (isNewFederatedAuthenticator) {
definedByType = resolveDefinedByTypeForCreateFederatedAuthenticator(
Copy link
Member

Choose a reason for hiding this comment

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

resolveDefinedByTypeForCreateFederatedAuthenticator -> resolveDefinedByTypeToCreateFederatedAuthenticator

String authenticatorName = getDecodedAuthenticatorName(authenticator.getAuthenticatorId());
String definedByType;
if (isNewFederatedAuthenticator) {
definedByType = resolveDefinedByTypeForCreateFederatedAuthenticator(
Copy link
Member

Choose a reason for hiding this comment

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

resolveDefinedByTypeForCreateFederatedAuthenticator -> resolveDefinedByTypeToCreateFederatedAuthenticator

definedByType = authenticator.getDefinedBy().toString();
String authenticatorName = getDecodedAuthenticatorName(authenticator.getAuthenticatorId());
String definedByType;
if (isNewFederatedAuthenticator) {
Copy link
Member

Choose a reason for hiding this comment

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

Also, when I said to get rid of this boolean I meant having separate methods from the 'updateFederatedAuthenticatorConfig' level. If that's hard it's fine to resolve passing this property

Copy link
Member

Choose a reason for hiding this comment

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

However I feel having these two methods separated is also good and it's clear.

Check if we can get to top level

FederatedAuthenticatorPUTRequest authenticator) throws IdentityProviderManagementClientException {

String authenticatorName = getDecodedAuthenticatorName(federatedAuthenticatorId);
String definedByType = resolveDefinedByTypeForUpdateFederatedAuthenticator(authenticatorName).toString();
Copy link
Member

Choose a reason for hiding this comment

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

resolveDefinedByTypeForUpdateFederatedAuthenticator -> resolveDefinedByTypeToUpdateFederatedAuthenticator

Comment on lines 149 to 154
ERROR_CODE_ENDPOINT_PROVIDED_FOR_SYSTEM_AUTH("60039", "No endpoint configuration is allowed " +
"for system defined authenticators.", "No endpoint configuration must be " +
"provided for the system defined federated authenticators %s."),
ERROR_CODE_PROPERTIES_PROVIDED_FOR_USER_AUTH("60040", "No properties are allowed for " +
"user defined authenticators.", "No properties must be provided for the user defined " +
"federated authenticators %s."),
Copy link
Member

Choose a reason for hiding this comment

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

Can we simplify the error message of these two cases. It's almost similar to a description

@Thisara-Welmilla Thisara-Welmilla force-pushed the add-API-support-create-user-def-auth-fed branch 5 times, most recently from 37e58e2 to fa4caea Compare November 13, 2024 11:36
@Thisara-Welmilla Thisara-Welmilla force-pushed the add-API-support-create-user-def-auth-fed branch from fa4caea to 6500b42 Compare November 13, 2024 11:52
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