Skip to content

Commit

Permalink
[MOSIP-29805] Updated Anonymous profile (#634)
Browse files Browse the repository at this point in the history
* [MOSIP-29805] Updated Anonymous profile

Signed-off-by: Aiham <[email protected]>

* [MOSIP-29805] Updated naming convention

Signed-off-by: Aiham <[email protected]>

---------

Signed-off-by: Aiham <[email protected]>
  • Loading branch information
aihamh authored Jan 3, 2024
1 parent 1e2bf0b commit 5f0a0e2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,6 @@ auth.server.admin.allowed.audience=mosip-regproc-client,mosip-prereg-client,mosi
#the custom auth provider component names list
#mosip.security.authentication.provider.beans.list=customJWTAuthProvider
mosip.security.authentication.provider.beans.list.pre-registration-application-service=customJWTAuthProvider
mosip.security.authentication.provider.beans.list.pre-registration-booking-service=customJWTAuthProvider
mosip.security.authentication.provider.beans.list.pre-registration-booking-service=customJWTAuthProvider

mosip.preregistration.anonymous-profile-username:admin
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class AnonymousProfileService implements AnonymousProfileServiceIntf {
@Value("${mosip.utc-datetime-pattern}")
private String utcDateTimePattern;

@Value("${mosip.preregistration.anonymous-profile-username}")
private String anonymousProfileUsername;

/**
* Autowired reference for {@link #AnonymousProfileRepostiory}
*/
Expand Down Expand Up @@ -67,9 +70,9 @@ public AnonymousProfileResponseDTO saveAnonymousProfile(AnonymousProfileRequestD
AnonymousProfileEntity requestEntity = new AnonymousProfileEntity();
requestEntity.setId(UUIDGeneratorUtil.generateId());
requestEntity.setProfile(requestDto.getProfileDetails());
requestEntity.setCreatedBy(authUserDetails().getUserId());
requestEntity.setCreatedBy(anonymousProfileUsername);
requestEntity.setCreateDateTime(currentDateTime);
requestEntity.setUpdatedBy(authUserDetails().getUserId());
requestEntity.setUpdatedBy(anonymousProfileUsername);
requestEntity.setUpdateDateTime(currentDateTime);
requestEntity.setIsDeleted(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class AnonymousProfileServiceTest {
@Value("${mosip.utc-datetime-pattern}")
private String utcDateTimePattern;

@Value("${mosip.preregistration.anonymous-profile-username}")
private String anonymousProfileUsername;

AnonymousProfileResponseDTO responseDto = new AnonymousProfileResponseDTO();

LocalDateTime currentDateTime = LocalDateTime.now(ZoneId.of("UTC"));
Expand Down Expand Up @@ -70,9 +73,9 @@ public void saveAnonymousProfileTest() {

requestEntity.setId(id);
requestEntity.setProfile(requestDto.getProfileDetails());
requestEntity.setCreatedBy(anonymousProfileService.authUserDetails().getUserId());
requestEntity.setCreatedBy(anonymousProfileUsername);
requestEntity.setCreateDateTime(currentDateTime);
requestEntity.setUpdatedBy(anonymousProfileService.authUserDetails().getUserId());
requestEntity.setUpdatedBy(anonymousProfileUsername);
requestEntity.setUpdateDateTime(currentDateTime);
requestEntity.setIsDeleted(false);
requestDto.setProfileDetails(profile);
Expand All @@ -95,9 +98,9 @@ public void saveAnonymousProfileExceptionTest() throws Exception {

requestEntity.setId(id);
requestEntity.setProfile(requestDto.getProfileDetails());
requestEntity.setCreatedBy(anonymousProfileService.authUserDetails().getUserId());
requestEntity.setCreatedBy(anonymousProfileUsername);
requestEntity.setCreateDateTime(currentDateTime);
requestEntity.setUpdatedBy(anonymousProfileService.authUserDetails().getUserId());
requestEntity.setUpdatedBy(anonymousProfileUsername);
requestEntity.setUpdateDateTime(currentDateTime);
requestEntity.setIsDeleted(false);
requestDto.setProfileDetails(profile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,5 @@ spring.cloud.config.uri=${dev.dns.url}/config
spring.cloud.config.label=develop
spring.cloud.config.name=pre-registration
spring.profiles.active=mz

mosip.preregistration.anonymous-profile-username:admin

0 comments on commit 5f0a0e2

Please sign in to comment.