aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be
AgeCommit message (Collapse)AuthorFilesLines
2020-06-19Fix Sonar issuesChrisC1-3/+4
Fix assertThat usage and tests Issue-ID: SDC-3116 Signed-off-by: ChrisC <christophe.closset@intl.att.com> Change-Id: Ife533a479096047c4ccb7ae46dfaaa6e2ece974d
2020-06-18Importing VSP with node_type in separate fileMichaelMorris4-5/+88
Import fails when a node_type referenced in the main template is defined in a separate yaml file in the csar even when that separate file is correctly imported in the main template Change-Id: I6abe074585c2ce592fe9bed7abe76f0856bcfe93 Issue-ID: SDC-2850 Signed-off-by: MichaelMorris <michael.morris@est.tech>
2020-06-17Refactor ArtifactsBusinessLogic::getUpdatedGroupInstancesFrancis Toth1-23/+20
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I6d62c1f916aa820f84328d25d2afbc7470397b0d Issue-ID: SDC-2961
2020-06-17Extract ComponentCache from CsarUtilsFrancis Toth4-89/+306
This commit aims to decouple the component caching logic from CsarUtils to its own class. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ia7e9284639ec8cd87ca5107e12f295e2eb599768 Issue-ID: SDC-2812
2020-06-17Support the substitution_mappings in the VNFDMichaelMorris3-10/+44
Signed-off-by: MichaelMorris <michael.morris@est.tech> Issue-ID: SDC-2957 Change-Id: I8a385b02568b3bf3d83a250cbe36a7e7f61e710c
2020-06-15Add some unit testsSatoshi Fujii1-151/+403
This change added some unit tests for ComponentInstanceBusinessLogic to increase test coverage and removed unused variables for better readability. Also the test class was rewritten to use JUnit 5. Change-Id: I519976d00d8eccc194f8f1168d45f95392808652 Signed-off-by: Satoshi Fujii <fujii-satoshi@jp.fujitsu.com> Issue-ID: SDC-2885
2020-06-15Fix Critical security vulnerabilityvasraz1-11/+68
com.fasterxml.jackson.core : jackson-databind : 2.9.9 Change-Id: I81af7879cb1fbcd158177a3dc220b704ff2f3388 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3111
2020-06-14Use dummy info for distribution-engineOfir Sonsino1-11/+10
Change-Id: I7679e0ed8ce4c4217cf6c5f4a646fe06cf32372d Issue-ID: SDC-3115 Signed-off-by: Ofir Sonsino <os0695@intl.att.com>
2020-06-14Add support for directives on VFCaribeiro1-0/+1
This change also updates the directives values according to Tosca 1.3 spec Issue-ID: SDC-3074 Change-Id: Ia6a68c9a23a71a2c17ba2c006990342811aa7b4e Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
2020-06-11Rewrite of `updateArtifactOnInterfaceOperationByResourceUUID` to remove NPEChris André1-24/+25
Issue-ID: SDC-2978 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I60942ab1767bf65c806ce796ca62365396b20d93
2020-06-10Set properties on XML parsers to prevent XXE attackNeil Derraugh2-2/+10
- Set ACCESS_EXTERNAL_DTD and ACCESS_EXTERNAL_SCHEMA properties on XML parsers to prevent XXE attacks Issue-ID: SDC-3106 Signed-off-by: Neil Derraugh <neil.derraugh@yoppworks.com> Change-Id: If4e835858dd3d718d37b3ee41fb2fd0c94574c24
2020-06-10Fix sonar bugssebdet2-71/+67
Fix all sonar bugs reported in SwitchoverDetector class + fix all checkstyle issues Issue-ID: SDC-2931 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: Ic86a3526fc7030e10a61b150058c04a391c40c7b
2020-06-10Support setting SDC-BE configuration at deployment timevasraz3-6/+11
Change-Id: I4b384bc911630d6041a0c5c235d3aaf3ac148090 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3076
2020-06-08Make Directive values Tosca compliantaribeiro7-148/+128
Issue-ID: SDC-3079 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: Ie711c61244a4e2d68a96e2814ba2db52e067c6e4
2020-06-02ArtifactsBusinessLogic refactor to remove NullPointerExceptionChris André1-3/+11
- Reformatted `downloadResourceInstanceArtifactByUUIDs` - Fixed Sonar-related warning regarding a NPE in `validateInput` Issue-ID: SDC-2979 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I5a62daabcc436f28fba1f09317c5723281df15bf
2020-06-02Add constraints structure to ToscaPropertyandre.schmid3-47/+109
Add constraints structure to ToscaProperty and implements the valid_values property. Change-Id: Id69581582839a8937f0c76c24d6a6bfcc7f0a957 Issue-ID: SDC-3084 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-06-02Refactor CsarUtils::writeComponentInterfaceFrancis Toth3-13/+150
This commit aims to decouple the zip file writing logic from the CsarUtils::writeComponentInterface function. This should provide a higher level of testability and maintenance thanks to inversion of control. An extra helper has also been added to help the migration from the FJ library to VAVR. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I4f2df4749cae3082906a80acc39045ac8887ec39 Issue-ID: SDC-2812
2020-06-01Remove boolean entries in TOSCA MetadataMichaelMorris1-6/+6
Change-Id: I0101bbe35656b4c7d7405429d95939b892e85402 Issue-ID: SDC-2876 Signed-off-by: MichaelMorris <michael.morris@est.tech>
2020-06-01Add interface inputs handlingvasraz6-76/+178
Enables interface inputs specified in a node_type to be imported and included in the generated csar Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: Ia3acaad50b4091831d0c0471b07ba2b2e9bd380d Issue-ID: SDC-3077
2020-06-01Plugin to customize prop. during Service creationandre.schmid3-21/+118
Creates an entry point to customize properties of a Service Component before its creation. Change-Id: I102a70b37eec498dd9c6df009c38da57d0e5b17f Issue-ID: SDC-3062 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-28Fix interface types creationandre.schmid4-28/+196
Interface types creation logic was not interpreting some allowed TOSCA entries, that, when declared, were breaking the interface type creation. Every entry under the interface type was being considered as an interface operation, but it is possible to have "derived_from", "version", "metadata" and "description". Also it is not considering the Interface Type entries "inputs", "operations" and "notifications". Another thing is that TOSCA 1.3 changes the way operations should be declared, deprecating the previous way. Now there should be an entry "operations" with the operations entries under it, instead of having the operations entries direct under the interface type. The change allows both types, following the TOSCA rule: if operations entry is not present, then the deprecated way is considered. Change-Id: I13218bda60b29d19b9c5565cbfd63ae3250a78bf Issue-ID: SDC-3075 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-28Entry points in ToscaExportHandler for plugin useandre.schmid1-2/+2
Open the access for two methods in ToscaExportHandler so they can be called in a CsarEntryGenerator plugin. Change-Id: I0ee1daab348c0fc85db56428369a5ec190cb0101 Issue-ID: SDC-3083 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-28Extract artifact component belonging logicFrancis Toth5-119/+417
This commit extracts checkArtifactInComponent and checkArtifactInResourceInstance from ArtifactsBusinessLogic. Tests have been added along with a some utility functions designed to generate randomized test data. The former tests were deleted as they were not doing any assertions. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I1b27c55d064cf4e9a40cd7b152e7ea6032a09276 Issue-ID: SDC-2961
2020-05-28Allow global types generationaribeiro7-31/+225
This change allows to configure which global type file will be added to the generated CSAR Issue-ID: SDC-3021 Change-Id: I83c0c3f317c4a4e5e8dbf22cb3dbd47e63562d3a Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
2020-05-27Refactor CsarUtils::WriteArtifactDefinitionFrancis Toth2-68/+60
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I167a05d8fbc2085a3e25eeb5bfd6b30f0e80462e Issue-ID: SDC-2812
2020-05-27Add ArtifactsBusinessLogic::fetchLatestComponentMetadataFrancis Toth1-43/+47
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ibb8621a91551a2e4ffcac1145f85ed7983063d02 Issue-ID: SDC-2812
2020-05-27Work on unchecked Optional accessChris André1-21/+58
- extract code to static methods - throw an explicit exception now if element not found Issue-ID: SDC-2987 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I693bb53059b056235b567ac1f9f752a33512505a
2020-05-26Fix for locked componentaribeiro2-13/+22
After add, update or remove node_filter the component was left locked on SDC Issue-ID: SDC-3072 Change-Id: I27058760704bd6261619946becda3612a6386432 Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
2020-05-25Refactor CsarUtil::addInnerComponentsToCSARFrancis Toth1-20/+36
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I7f32d729a96f696c217631cd019105c17cb36a8c Issue-ID: SDC-2812
2020-05-24Support setting SDC-BE configuration at deployment timevasraz2-76/+77
Change-Id: Id1ebcb01d81b8e0cd681dcb304aa77bb3248d69c Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3076
2020-05-24500 error at WFD artifact-deliveries apiBen David, Elad (eb7504)1-3/+4
Change-Id: I9227387c26b6ee4c68c635b78c4980a9c07b3d35 Issue-ID: SDC-3052 Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
2020-05-21Refactor ArtifactsBusinessLogic::getRelatedComponentInstanceFrancis Toth1-51/+49
This commit aims to refactor the ArtifactsBusinessLogic::getRelatedComponentInstance, and getRelatedComponentComponentInstance. It improves how Either is used, fixes a potential NullPointerException, reduces some duplication along with cyclomatic complexity. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I2503f5e2a697f793e4dcf32d7793f83c4a25ff46 Issue-ID: SDC-2812
2020-05-20Remove wildcard pattern when retrieving componentsFrancis Toth3-40/+71
This commit aims to remove a redundant cast while preparing the field for some Either refactoring in ArtifactsBusinessLogic. The reasons for removing the wildcard pattern are explained in SDC-3040 (a sub-task of SDC-2812). Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I573c01eca56f096ccb54e564d0144291121bde22 Issue-ID: SDC-2812
2020-05-20Refactor ArtifactsBusinessLogic::handleDeleteInternalFrancis Toth1-18/+42
This commit is a first step towards the ArtifactsBusinessLogic::handleDeleteInternal function refactoring. It aims to improve how Either is used, and to reduce its cyclomatic complexity along with some duplications. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I1b476ccc0e0341975b80c10dc79c5dc1592267f4 Issue-ID: SDC-2812
2020-05-19remove powermock dependency from pom xmlsRodrigo Lima1-4/+0
- Remove powermock from pom xml files - Remove powermock from ActivityLogManagerFactoryImplTest Issue-ID: SDC-3071 Signed-off-by: Rodrigo Lima <rodrigo.lima@yoppworks.com> Change-Id: I4c4b8b0751f4ce8895617a951429111fc08d8e2e
2020-05-19Add null test to ComponentInstanceBusinessLogicChris André1-55/+81
- Added test in `changeInstanceVersion` for null value Issue-ID: SDC-2908 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I42a428c4b245a55b7229e2ec9b781e9af4403662
2020-05-19Refactor ArtifactsBusinessLogic::generateAndSaveToscaArtifactFrancis Toth1-34/+30
This commit aims to make some minor refactoring related to the either used in ArtifactsBusinessLogic::generateAndSaveToscaArtifact. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I4923e014146a17f1cd035db3513359a2ab8f38f2 Issue-ID: SDC-2812
2020-05-18Refactor CsarUtil::extractVfcArtifactFrancis Toth2-38/+58
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ica8d17d4f3c763920f406ccb89fb3e464d05eab4 Issue-ID: SDC-2812
2020-05-18Refactor tosca representation retrieval in CsarUtils::populateZipFrancis Toth1-30/+56
This commit aims to simplify CsarUtils::populateZip by extracting how a tosca representation is fetched to another function. this enables to reduce the overall cyclomatic complexity of the function. Some additional work still needs to be done especially regarding the ToscaRepresentation and MainYamlWithDependencies classes (These happen to be really similar). This will be done in another change in the near future. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I93600d0752565de523cf2285b1fa2ba43a96334f Issue-ID: SDC-2812
2020-05-17sdc-backend-init does not restart on healthcheck failureFuss, Areli (af732p)2-1/+3
Issue-ID: SDC-3063 Change-Id: I6c4a796f42060832ee8a37a708dedda7e7e98c70 Signed-off-by: Fuss, Areli (af732p) <areli.fuss@intl.att.com>
2020-05-12Remove unused ArtifactsBusinessLogic::updateArtifactsFlowForInterfaceOperationsFrancis Toth1-63/+0
This commit deletes the ArtifactsBusinessLogic::updateArtifactsFlowForInterfaceOperations function as it is no longer used anywhere. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I1dd950930485fc83bb02c889dafc5461192accbc Issue-ID: SDC-2812
2020-05-11Refactor CsarUtil::writeComponentInterfaceFrancis Toth1-18/+22
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I6a40119540c18469db44e218984b4d4b92d3f4af Issue-ID: SDC-2812
2020-05-11Refactor ArtifactsBusinessLogic::generateToscaArtifactFrancis Toth1-35/+55
This commit aims to refactor how Either is used in ArtifactsBusinessLogic::generateToscaArtifact. In order to keep the refactoring relatively small, we evalute its result at the call site. Change-Id: I669b30b44e9c69d1b3968fd719c5340b2dff83f5 Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Issue-ID: SDC-2812
2020-05-10Refactor to remove false positives from SonarChris André2-47/+111
- change `updateResourceInstancesNames` to account for case where `preparedResource` is null - change `findInputByName` to return an Either<InputDefinition, RuntimeException> in order to make exceptions explicit - create `rollbackWithEither` (+ tests) to make exceptions more explicit Issue-ID: SDC-2992 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I487994a3f9e88b0a2b14d2679c3587d85d8aa12d
2020-05-10Refactor ArtifactsBusinessLogic::handleDelete and ↵Francis Toth6-63/+53
ArtifactsBusinessLogic::deleteArtifactByInterface Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I89f12c70f388375ed13554edf62bf6a442c9036a Issue-ID: SDC-2812
2020-05-10Allow any extension to WORKFLOW artifact typeandre.schmid1-2/+0
Allow any extension to WORKFLOW artifact as it was before the artifact type configuration change SDC-2754. Change-Id: I6c497cd83e36fe4df0cc800b9301010c22aa79f7 Issue-ID: SDC-3019 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-10Moved ArtifactsBusinessLogic::buildJsonStringForCsarVfcArtifact to JsonUtilsFrancis Toth4-28/+125
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ia3bb9fe9f97e1759e4e5b70eb5e5396ed87d716d Issue-ID: SDC-2961
2020-05-08Refactor CsarUtil::addComponentToCacheFrancis Toth1-17/+40
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ib78be78780a97c873e710d805dd26273159d5354 Issue-ID: SDC-2812
2020-05-08Clean normatives file during mvn cleanandre.schmid1-3/+1
The configuration to clean the normatives.tar.gz was incorrect, so the file was not being cleaned up during mvn clean, which could create an inconsistent sdc-backend-init docker image. Change-Id: I15e3f4c49f404c147532c88c50f131cb61aea9c0 Issue-ID: SDC-3041 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-07Reduce scope from 'compile' to 'test' for 'junit-vintage-engine'vasraz1-6/+1
Change-Id: I39b0be6ba6650c9a7215acf359f3d74e0a24e553 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-2844 Issue-ID: SDC-2983