Unverified Commit 681edaed authored by sknirmalkar89's avatar sknirmalkar89 Committed by GitHub
Browse files

SB-28404: User consent api soft delete when user migrated and return both...

SB-28404: User consent api soft delete when user migrated and return both active and revoke consents (#1050)

* SB-28404:[SSO > Global consent]issue:update consumer_id,object_id with root org id

* SB-28404:[SSO > Global consent]issue:Throw consent not found exception list is empty

* SB-28404:[SSO > Global consent] add new status as deleted when migration done

* SB-28404:[SSO > Global consent]issue:fix code refactor
No related merge requests found
Showing with 5 additions and 3 deletions
+5 -3
...@@ -541,6 +541,8 @@ public final class JsonKey { ...@@ -541,6 +541,8 @@ public final class JsonKey {
public static final String CONSENT_OBJECTTYPE = "objectType"; public static final String CONSENT_OBJECTTYPE = "objectType";
public static final String CONSENT_OBJECTTYPE_ORG = "Organisation"; public static final String CONSENT_OBJECTTYPE_ORG = "Organisation";
public static final String CONSENT_STATUS_REVOKED = "REVOKED"; public static final String CONSENT_STATUS_REVOKED = "REVOKED";
public static final String CONSENT_STATUS_DELETED = "DELETED";
// user consent req-response attributes listing - ended // user consent req-response attributes listing - ended
// user consent table columns listing - started // user consent table columns listing - started
public static final String CONSENT_CONSUMER_ID = "consumer_id"; public static final String CONSENT_CONSUMER_ID = "consumer_id";
......
...@@ -185,7 +185,7 @@ public class TenantMigrationActor extends BaseActor { ...@@ -185,7 +185,7 @@ public class TenantMigrationActor extends BaseActor {
consentReqMap.put(JsonKey.CONSENT_CONSUMERID, request.getRequest().get(JsonKey.ROOT_ORG_ID)); consentReqMap.put(JsonKey.CONSENT_CONSUMERID, request.getRequest().get(JsonKey.ROOT_ORG_ID));
consentReqMap.put(JsonKey.CONSENT_OBJECTID, request.getRequest().get(JsonKey.ROOT_ORG_ID)); consentReqMap.put(JsonKey.CONSENT_OBJECTID, request.getRequest().get(JsonKey.ROOT_ORG_ID));
consentReqMap.put(JsonKey.CONSENT_OBJECTTYPE, JsonKey.CONSENT_OBJECTTYPE_ORG); consentReqMap.put(JsonKey.CONSENT_OBJECTTYPE, JsonKey.CONSENT_OBJECTTYPE_ORG);
consentReqMap.put(JsonKey.STATUS, JsonKey.CONSENT_STATUS_REVOKED); consentReqMap.put(JsonKey.STATUS, JsonKey.CONSENT_STATUS_DELETED);
Response consentRes = Response consentRes =
userConsentService.updateConsent(consentReqMap, request.getRequestContext()); userConsentService.updateConsent(consentReqMap, request.getRequestContext());
......
...@@ -126,8 +126,8 @@ public class UserConsentActor extends BaseActor { ...@@ -126,8 +126,8 @@ public class UserConsentActor extends BaseActor {
.stream() .stream()
.filter( .filter(
consents -> consents ->
((String) consents.get(JsonKey.STATUS)).equalsIgnoreCase(JsonKey.ACTIVE)) !((String) consents.get(JsonKey.STATUS)).equalsIgnoreCase(JsonKey.CONSENT_STATUS_DELETED)
.map( ).map(
consent -> { consent -> {
Map<String, Object> consentRes = new HashMap<String, Object>(); Map<String, Object> consentRes = new HashMap<String, Object>();
consentRes.put(JsonKey.ID, consent.get(JsonKey.ID)); consentRes.put(JsonKey.ID, consent.get(JsonKey.ID));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment