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

updated License and linked to docs #74

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
14d1bd4
Created 1.2.0-rc2 (#23)
MonobikashDas Aug 31, 2021
466dc34
MOSIP-15420: Upgraded swagger2.0 to openapi3.0 for packet manager ser…
kameshsr Oct 29, 2021
f59d453
Added logger and fixed test cases (#32)
MonobikashDas Nov 3, 2021
1e5a04d
MOSIP-15420: Generated openapi.json for packet manager service (#34)
kameshsr Nov 12, 2021
d89828b
MOSIP-18453 : improved usage of caching (#36)
MonobikashDas Dec 6, 2021
dff1aa2
Added sonar_analysis
Rakshitha650 Dec 10, 2021
38b4b93
Merge pull request #38 from Rakshitha650/patch-1
mandeepdhiman123 Dec 13, 2021
4b1da36
MOSIP-18450 : added exception for objects not available in minio (#37)
MonobikashDas Dec 30, 2021
ce361ff
Mosip:15286 Changed openapi.json name.
kameshsr Jan 5, 2022
7bd0f33
updated the Sonar_analysis code and removed the Dskiptests
Rakshitha650 Jan 7, 2022
1a380a0
updated the Sonar_analysis code and removed the Dskiptests
Rakshitha650 Jan 7, 2022
29ee19e
added gpg keys
Rakshitha650 Jan 10, 2022
61a1380
Merge pull request #44 from Rakshitha650/1.2.0-rc2
mandeepdhiman123 Jan 10, 2022
f35b07e
Merge pull request #43 from kameshsr/1.2.0-rc2
mandeepdhiman123 Jan 11, 2022
69c6882
changes for real bio
Jan 13, 2022
e84194b
Merged with 1.2.0-rc2
Jan 13, 2022
26baa99
Merge branch 'develop' into 1.2.0-rc2-real-bio
Jan 16, 2022
dabf23b
changes for real bio
Jan 16, 2022
7d1a7cc
Merge pull request #51 from MonobikashDas/1.2.0-rc2-real-bio
gsasikumar Jan 17, 2022
f131608
Auth role issue fixed (#46)
MonobikashDas Jan 19, 2022
0334a73
MOR-147 : multithreading issue for create packet api (#52)
MonobikashDas Jan 19, 2022
17002dc
Merge pull request #54 from MonobikashDas/1.2.0-rc2
gsasikumar Jan 21, 2022
2cc5c9f
Added documentation
Jan 27, 2022
ac9ee61
Merge pull request #59 from MonobikashDas/documentation
pjoshi751 Jan 28, 2022
b4d3264
Update README.md
pjoshi751 Jan 28, 2022
452b828
Update README.md
pjoshi751 Jan 28, 2022
9131407
[MOSIP-19587] Cleanup.
Jan 28, 2022
558b09f
Update configuration.md
MonobikashDas Jan 28, 2022
831d951
Update configuration.md
pjoshi751 Jan 28, 2022
7cf9cbc
Update configuration.md
MonobikashDas Jan 28, 2022
4cfb61e
Updated readme and sonar fix
Feb 1, 2022
a0e9ae8
Update README.md
MonobikashDas Feb 1, 2022
e007591
Merge pull request #60 from MonobikashDas/1.2.0-rc2-final
pjoshi751 Feb 1, 2022
37e4e12
[MOSIP-19883] updated worflows
ckm007 Feb 3, 2022
db3139a
[MOSIP-19883] updated worflows
ckm007 Feb 3, 2022
612cb23
Update push_trigger.yml
ckm007 Feb 3, 2022
a83bd34
Updated Pom versions for release changes
ckm007 Feb 3, 2022
b4cd57f
Merge pull request #65 from mosip/release-branch
ckm007 Feb 3, 2022
058e77c
[MOSIP-19910] updated badges
ckm007 Feb 3, 2022
f5c7017
minor doc update
ckm007 Mar 14, 2022
f5b049d
updated License and linked to docs
SwatiPeriwal Mar 14, 2022
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
Prev Previous commit
Next Next commit
MOR-147 : multithreading issue for create packet api (#52)
Co-authored-by: Admin <Admin@MONOBIKASH>
  • Loading branch information
2 people authored and Monobikash Das committed Jan 21, 2022
commit 0334a73c0d92adcc7102703bb1536879d4df3e0b
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class AuditLogEntry {

@Autowired
@Lazy
@Qualifier("selfTokenRestTemplate")
private RestTemplate restTemplate;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public enum PacketUtilityErrorCodes {
TAG_NOT_FOUND("KER-PUT-024", "Requested tag not present"),
SOURCE_NOT_PRESENT("KER-PUT-025", "Invalid source or process."),
DELETE_TAGGING_FAILED("KER-PUT-026", "Failed to delete tags."),
OBJECT_DOESNOT_EXISTS("KER-PUT-027", "Object doesnot exists."),;
OBJECT_DOESNOT_EXISTS("KER-PUT-027", "Object doesnot exists."),
UNKNOWN_EXCEPTION("KER-PUT-028", "Unknown Exception.");



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ public List<PacketInfo> createPacket(PacketDto packetDto) {
LOGGER.info(PacketManagerLogger.SESSIONID, PacketManagerLogger.REGISTRATIONID, packetDto.getId(),
ExceptionUtils.getStackTrace(e));
LOGGER.error(PacketManagerLogger.SESSIONID, PacketManagerLogger.REGISTRATIONID, packetDto.getId(), ExceptionUtils.getStackTrace(e));
} finally {
// remove object from registration packet hashmap
provider.removePacket(packetDto.getId());
}
return packetInfos;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public class OnlinePacketCryptoServiceImpl implements IPacketCryptoService {
private boolean isPrependThumbprintEnabled;

@Autowired
@Qualifier("selfTokenRestTemplate")
private RestTemplate restTemplate;

@Autowired
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ public interface IPacketWriter {

public List<PacketInfo> persistPacket(String id, String version, String schemaJson, String source,
String process, String additionalInfoReqId, String refId, boolean offlineMode);

void removePacket(String id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public class IdSchemaUtils {
private ObjectMapper objMapper;

@Autowired
@Qualifier("selfTokenRestTemplate")
private RestTemplate restTemplate;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,77 +59,4 @@ public static InputStream unzipAndGetFile(byte[] packet, String file) throws IOE

return null;
}

/**
* Method to unzip the file in-memeory and search the required file exists
*
* @param packetStream zip file to be unzipped
* @param file file to search within zip file
* @return return true if found the required file, false otherwise
* @throws IOException if any error occored while unzipping the file
*/
public static boolean unzipAndCheckIsFileExist(InputStream packetStream, String file) throws IOException {
boolean isExist = false;

try (ZipInputStream zis = new ZipInputStream(packetStream)) {
ZipEntry ze = zis.getNextEntry();
while (ze != null) {
String fileName = ze.getName();
String fileNameWithOutExt = FilenameUtils.removeExtension(fileName);
if (FilenameUtils.equals(fileNameWithOutExt, file, true, IOCase.INSENSITIVE)) {
isExist = true;
break;
}
zis.closeEntry();
ze = zis.getNextEntry();
}
zis.closeEntry();
} finally {
packetStream.close();
}
return isExist;
}

/**
* Method to unzip the file for passed destination path
*
* @param input zip file to be unzipped
* @param desDir location where to unzip the files
* @throws IOException if any error occurred while unzipping
*/
public static void unZipFromInputStream(InputStream input, String desDir) throws IOException {
byte[] buffer = new byte[1024];
try (ZipInputStream zis = new ZipInputStream(input)) {
File folder = FileUtils.getFile(desDir);
if (!folder.exists()) {
if (folder.mkdir()) {

}
}
ZipEntry ze = zis.getNextEntry();
while (ze != null) {
if (ze.isDirectory()) {
File file = FileUtils.getFile(desDir + ze.getName());
if (file.mkdir()) {

}
} else {
String fileName = ze.getName();
File newFile = FileUtils.getFile(desDir + File.separator + fileName);
if (FileUtils.getFile(newFile.getParent()).mkdirs()) {
FileOutputStream fos = new FileOutputStream(newFile);
int len;
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
fos.close();
}
}
ze = zis.getNextEntry();
}
zis.closeEntry();
} finally {
input.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
import io.mosip.kernel.core.util.JsonUtils;
import io.mosip.kernel.cryptomanager.dto.CryptomanagerResponseDto;
import io.mosip.kernel.cryptomanager.service.impl.CryptomanagerServiceImpl;
import io.mosip.kernel.signature.dto.ValidatorResponseDto;
import io.mosip.kernel.signature.service.SignatureService;
import io.mosip.kernel.signature.service.impl.SignatureServiceImpl;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public class PacketReaderController {
@Autowired
private PacketReaderService packetReaderService;
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostsearchfield())")
//@PreAuthorize("hasAnyRole('DATA_READ')")
@ResponseFilter
@PostMapping(path = "/searchField", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "searchField", description = "searchField", tags = { "packet-reader-controller" })
Expand All @@ -77,7 +76,6 @@ public ResponseWrapper<FieldResponseDto> searchField(@RequestBody(required = tru
return response;
}

//@PreAuthorize("hasAnyRole('DATA_READ')")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostsearchfields())")
@ResponseFilter
@PostMapping(path = "/searchFields", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand Down Expand Up @@ -107,7 +105,6 @@ public ResponseWrapper<FieldResponseDto> searchFields(@RequestBody(required = tr
return response;
}

//@PreAuthorize("hasAnyRole('DOCUMENT_READ')")
@ResponseFilter
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostdocument())")
@PostMapping(path = "/document", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand All @@ -129,7 +126,6 @@ public ResponseWrapper<Document> getDocument(@RequestBody(required = true) Reque
return response;
}

//@PreAuthorize("hasAnyRole('BIOMETRIC_READ')")
@ResponseFilter
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostbiometrics())")
@PostMapping(path = "/biometrics", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand All @@ -152,7 +148,6 @@ public ResponseWrapper<BiometricRecord> getBiometrics(@RequestBody(required = tr
return response;
}

//@PreAuthorize("hasAnyRole('METADATA_READ')")
@ResponseFilter
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostmetainfo())")
@PostMapping(path = "/metaInfo", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand All @@ -173,7 +168,6 @@ public ResponseWrapper<FieldResponseDto> getMetaInfo(@RequestBody(required = tru
return response;
}

//@PreAuthorize("hasAnyRole('REGISTRATION_PROCESSOR')")
@ResponseFilter
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostaudits())")
@PostMapping(path = "/audits", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand All @@ -200,7 +194,6 @@ public ResponseWrapper<List<FieldResponseDto>> getAudits(@RequestBody(required =
return response;
}

//@PreAuthorize("hasAnyRole('REGISTRATION_PROCESSOR')")
@ResponseFilter
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostvalidatepacket())")
@PostMapping(path = "/validatePacket", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand All @@ -219,7 +212,6 @@ public ResponseWrapper<ValidatePacketResponse> validatePacket(@RequestBody(requi
return response;
}

//@PreAuthorize("hasAnyRole('REGISTRATION_PROCESSOR')")
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostgettags())")
@ResponseFilter
@PostMapping(path = "/getTags", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand All @@ -238,7 +230,6 @@ public ResponseWrapper<TagResponseDto> getTags(
return response;
}

//@PreAuthorize("hasAnyRole('REGISTRATION_PROCESSOR')")
@ResponseFilter
@PreAuthorize("hasAnyRole(@authorizedRoles.getPostinfo())")
@PostMapping(path = "/info", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public class PacketWriterController {
@Autowired
private PacketWriterService packetWriterService;
@PreAuthorize("hasAnyRole(@authorizedRoles.getPutcreatepacket())")
//@PreAuthorize("hasAnyRole('REGISTRATION_PROCESSOR')")
@ResponseFilter
@PutMapping(path = "/createPacket", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "createPacket", description = "createPacket", tags = { "packet-writer-controller" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public class PacketReaderService {
private PacketReader packetReader;

@Autowired
@Qualifier("selfTokenRestTemplate")
private RestTemplate restTemplate;

@Autowired
Expand Down Expand Up @@ -147,7 +148,17 @@ private InfoResponseDto infoInternal(String id) {
return infoResponseDto;
} catch (Exception e) {
LOGGER.error(PacketManagerLogger.SESSIONID, PacketManagerLogger.REGISTRATIONID, id, ExceptionUtils.getStackTrace(e));
throw new BaseUncheckedException(e.getMessage());

if (e instanceof BaseUncheckedException) {
BaseUncheckedException ex = (BaseUncheckedException) e;
throw ex;
}
else if (e instanceof BaseCheckedException) {
BaseCheckedException ex = (BaseCheckedException) e;
throw new BaseUncheckedException(ex.getErrorCode(), ex.getMessage(), ex);
}
else
throw new BaseUncheckedException(PacketUtilityErrorCodes.UNKNOWN_EXCEPTION.getErrorCode(), e.getMessage(), e);
}
}

Expand Down Expand Up @@ -213,7 +224,7 @@ public ContainerInfoDto findPriority(String field, List<ContainerInfoDto> info)
}

private ContainerInfoDto getContainerInfoByDefaultPriority(String field, List<ContainerInfoDto> info) {
if (org.apache.commons.lang.StringUtils.isNotEmpty(defaultPriority)) {
if (StringUtils.isNotEmpty(defaultPriority)) {
String[] val = defaultPriority.split(",");
if (val != null && val.length > 0) {
for (String value : val) {
Expand Down Expand Up @@ -247,7 +258,7 @@ private ContainerInfoDto getContainerInfoBySourceAndProcess(String field, String
}

private String getDefaultSource(String process) {
if (org.apache.commons.lang.StringUtils.isNotEmpty(defaultPriority)) {
if (StringUtils.isNotEmpty(defaultPriority)) {
String[] val = defaultPriority.split(",");
if (val != null && val.length > 0) {
for (String value : val) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
spring.cloud.config.uri=http://localhost:51000/config
spring.cloud.config.label=master
spring.profiles.active=mz
spring.application.name=packet-manager,application
spring.cloud.config.name=packet-manager,application
spring.application.name=application,packet-manager
spring.cloud.config.name=application,packet-manager
server.port=8093
#disabling health check so that client doesnt try to load properties from sprint config server every
# 5 minutes (should not be done in production)
Expand Down