Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ public enum ErrorMessage {
"Server encountered an error while deleting the SAML inbound auth configs."),
ERROR_CODE_ERROR_PASSIVE_STS_INBOUND_AUTH_CONFIG_DELETE("65021",
"Unable to delete Passive STS inbound auth configs.",
"Server encountered an error while deleting the Passive STS inbound auth configs.");
"Server encountered an error while deleting the Passive STS inbound auth configs."),
ERROR_CODE_IMP_CONFIG_DELETE("65022",
"Unable to delete Impersonation configuration.",
"Server encountered an error while deleting the Impersonation configuration of %s.");

private final String code;
private final String message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,28 @@ public Response restoreServerRemoteLoggingConfigurations() {
return delegate.restoreServerRemoteLoggingConfigurations();
}

@Valid
@DELETE
@Path("/impersonation")

@Produces({ "application/json" })
@ApiOperation(value = "Revert the tenant impersonation configuration.", notes = "Revert the tenant impersonation configuration. <b>Scope (Permission) required:</b> <br> * internal_config_update ", response = Void.class, authorizations = {
@Authorization(value = "BasicAuth"),
@Authorization(value = "OAuth2", scopes = {

})
}, tags={ "Impersonation Configurations", })
@ApiResponses(value = {
@ApiResponse(code = 204, message = "Successful deletion", response = Void.class),
@ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
@ApiResponse(code = 403, message = "Forbidden", response = Void.class),
@ApiResponse(code = 500, message = "Server Error", response = Error.class)
})
public Response deleteImpersonationConfiguration() {

return delegate.deleteImpersonationConfiguration();
}

@Valid
@PUT
@Path("/provisioning/inbound/scim")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public interface ConfigsApiService {

public Response restoreServerRemoteLoggingConfigurations();

public Response deleteImpersonationConfiguration();

public Response updateInboundScimConfigs(ScimConfig scimConfig);

public Response updatePassiveSTSInboundAuthConfig(InboundAuthPassiveSTSConfig inboundAuthPassiveSTSConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,20 @@ public void patchImpersonationConfiguration(List<ImpersonationPatch> impersonati
}
}

/**
* Deletes the impersonation configuration for the current tenant domain.
*
* @throws ImpersonationConfigMgtException If there is an error deleting the impersonation configuration.
*/
public void deleteImpersonationConfiguration() {

String tenantDomain = ContextLoader.getTenantDomainFromContext();
Comment on lines +448 to +450

Choose a reason for hiding this comment

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

Log Improvement Suggestion No: 1

Suggested change
public void deleteImpersonationConfiguration() {
String tenantDomain = ContextLoader.getTenantDomainFromContext();
public void deleteImpersonationConfiguration() {
String tenantDomain = ContextLoader.getTenantDomainFromContext();
log.info("Deleting impersonation configuration for tenant domain: " + tenantDomain);

try {
impersonationConfigMgtService.deleteImpersonationConfig(tenantDomain);
} catch (ImpersonationConfigMgtException e) {
throw handleImpersonationConfigException(e, Constants.ErrorMessage.ERROR_CODE_IMP_CONFIG_DELETE, null);
}
}

/**
* Get the CORS config for a tenant.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ public Response patchImpersonationConfiguration(List<ImpersonationPatch> imperso
return Response.ok().build();
}

@Override
public Response deleteImpersonationConfiguration() {

configManagementService.deleteImpersonationConfiguration();
return Response.noContent().build();
}

@Override
public Response updateInboundScimConfigs(ScimConfig scimConfig) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,28 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
tags:
- Impersonation Configurations
summary: Revert the tenant impersonation configuration.
operationId: deleteImpersonationConfiguration
description: |
Revert the tenant impersonation configuration.
<b>Scope (Permission) required:</b> <br>
* internal_config_update
responses:
'204':
description: Successful deletion
'401':
description: Unauthorized
'403':
description: Forbidden
'500':
description: Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/configs/home-realm-identifiers:
get:
tags:
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -958,12 +958,12 @@
<maven.buildnumber.plugin.version>1.4</maven.buildnumber.plugin.version>
<org.apache.felix.annotations.version>1.2.4</org.apache.felix.annotations.version>
<identity.governance.version>1.11.103</identity.governance.version>
<carbon.identity.framework.version>7.8.405</carbon.identity.framework.version>
<carbon.identity.framework.version>7.8.466</carbon.identity.framework.version>
<maven.findbugsplugin.version>3.0.5</maven.findbugsplugin.version>
<findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
<maven.checkstyleplugin.excludes>**/gen/**/*</maven.checkstyleplugin.excludes>
<identity.event.handler.version>1.9.48</identity.event.handler.version>
<identity.inbound.oauth2.version>7.0.302</identity.inbound.oauth2.version>
<identity.inbound.oauth2.version>7.0.350</identity.inbound.oauth2.version>
<identity.inbound.saml2.version>5.11.51</identity.inbound.saml2.version>
<identity.x509Certificate.validation.version>1.1.19</identity.x509Certificate.validation.version>
<commons.beanutils.version>1.9.4</commons.beanutils.version>
Expand Down