Skip to content

Commit 09da701

Browse files
authored
Merge pull request #125 from proximax-storage/feature/new_server_security
Adjustments for server release after security audit
2 parents 1ec90c6 + f47a43a commit 09da701

File tree

163 files changed

+4311
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+4311
-268
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 0.6.0 Security audit
4+
5+
Breaking changes introduced by the security audit
6+
* DTO changes to match changes in REST API
7+
* e2e test cleanup (+ disabled contract tests as plugin is disabled now)
8+
39
## 0.5.1 Security audit
410

511
Fixing issues caused by changes introduced because of security audit

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ The ProximaX Sirius Chain Java SDK is a Java library for interacting with the Si
1212

1313
## Use the library ##
1414

15-
Current version of the library is <b>0.5.0</b>
15+
See [wiki](https://github.com/proximax-storage/java-xpx-chain-sdk/wiki) for latest version of the project.
1616

17-
This library requires use of Java8. Library is published to [Maven Central](https://search.maven.org/). To include library and its dependencies, add following to your build script:
17+
This library requires use of Java8. Releases of library are published to [Maven Central](https://search.maven.org/search?q=a:java-xpx-chain-sdk) and [snapshots](https://oss.sonatype.org/content/repositories/snapshots/io/proximax/java-xpx-chain-sdk/) are available in [Sonatype snapshot repository](https://oss.sonatype.org/content/repositories/snapshots/). To include library and its dependencies, add following to your build script:
1818

1919
### Maven ###
2020

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# repository group
22
group=io.proximax
33
# current version
4-
version=0.5.1-SNAPSHOT
4+
version=0.6.0-SNAPSHOT

schemas/swagger/swagger.yaml

Lines changed: 202 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ paths:
789789
content:
790790
application/json:
791791
schema:
792-
$ref: '#/components/schemas/CatapultConfigDTO'
792+
$ref: '#/components/schemas/NetworkConfigDTO'
793793
'404':
794794
description: resource not found
795795
'409':
@@ -1438,7 +1438,7 @@ paths:
14381438
content:
14391439
application/json:
14401440
schema:
1441-
$ref: '#/components/schemas/CatapultUpgradeDTO'
1441+
$ref: '#/components/schemas/BlockchainUpgradeDTO'
14421442
'404':
14431443
description: resource not found
14441444
'409':
@@ -1555,6 +1555,11 @@ components:
15551555
EntityTypeEnum:
15561556
type: integer
15571557
enum:
1558+
- 16728
1559+
- 16729
1560+
- 16701
1561+
- 16957
1562+
- 17213
15581563
- 16717
15591564
- 16973
15601565
- 16718
@@ -1575,6 +1580,11 @@ components:
15751580
- 33091
15761581
description: |
15771582
The entity type:
1583+
* 0x4158 (16728 decimal) - Blockchain Upgrade Transaction.
1584+
* 0x4159 (16729 decimal) - Network Config Transaction.
1585+
* 0x413D (16701 decimal) - Address Metadata Transaction.
1586+
* 0x423D (16957 decimal) - Mosaic Metadata Transaction.
1587+
* 0x433D (17213 decimal) - Namespace Metadata Transaction.
15781588
* 0x414D (16717 decimal) - Mosaic Definition Transaction.
15791589
* 0x424D (16973 decimal) - Mosaic Supply Change Transaction.
15801590
* 0x414E (16718 decimal) - Register Namespace Transaction.
@@ -1615,6 +1625,28 @@ components:
16151625
The type of the action:
16161626
* 0 - Link.
16171627
* 1 - Unlink.
1628+
MetadataTypeEnum:
1629+
type: integer
1630+
enum:
1631+
- 1
1632+
- 2
1633+
- 3
1634+
description: |
1635+
The type of the metadata:
1636+
* 1 - Address metadata.
1637+
* 2 - Mosaic metadata.
1638+
* 3 - Namespace metadata.
1639+
example: 0
1640+
MetadataModificationTypeEnum:
1641+
type: integer
1642+
enum:
1643+
- 0
1644+
- 1
1645+
description: |
1646+
The type of the metadata modification:
1647+
* 0 - Add metadata.
1648+
* 1 - Remove metadata.
1649+
example: 0
16181650
MessageTypeEnum:
16191651
type: integer
16201652
enum:
@@ -1872,44 +1904,44 @@ components:
18721904
- type: string
18731905
- $ref: "#/components/schemas/UInt64DTO"
18741906
- type: integer
1875-
CatapultConfigDTO:
1907+
NetworkConfigDTO:
18761908
type: object
18771909
required:
1878-
- catapultConfig
1910+
- networkConfig
18791911
properties:
1880-
catapultConfig:
1912+
networkConfig:
18811913
$ref: '#/components/schemas/ConfigDTO'
18821914
ConfigDTO:
18831915
type: object
18841916
required:
18851917
- height
1886-
- blockChainConfig
1918+
- networkConfig
18871919
- supportedEntityVersions
18881920
properties:
18891921
height:
18901922
$ref: '#/components/schemas/UInt64DTO'
1891-
blockChainConfig:
1923+
networkConfig:
18921924
type: string
18931925
example: "[network]\n\nidentifier = mijin-test\npublicKey = B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF\ngenerationHash = 7B631D803F912B00DC0CBED3014BBD17A302BA50B99D233B9C2D9533B842ABDF\n\n"
18941926
supportedEntityVersions:
18951927
type: string
18961928
example: "{\n\t\"entities\": [\n\t\t{\n\t\t\t\"name\": \"Block\",\n\t\t\t\"type\": \"33091\",\n\t\t\t\"supportedVersions\": [3]\n\t\t}]}"
1897-
CatapultUpgradeDTO:
1929+
BlockchainUpgradeDTO:
18981930
type: object
18991931
required:
1900-
- catapultUpgrade
1932+
- blockchainUpgrade
19011933
properties:
1902-
catapultConfig:
1934+
blockchainUpgrade:
19031935
$ref: '#/components/schemas/UpgradeDTO'
19041936
UpgradeDTO:
19051937
type: object
19061938
required:
19071939
- height
1908-
- catapultVersion
1940+
- blockChainVersion
19091941
properties:
19101942
height:
19111943
$ref: '#/components/schemas/UInt64DTO'
1912-
catapultVersion:
1944+
blockChainVersion:
19131945
$ref: '#/components/schemas/UInt64DTO'
19141946
ContractInfoDTO:
19151947
type: object
@@ -1958,6 +1990,21 @@ components:
19581990
items:
19591991
type: string
19601992
example: "3DCB6E5EFF4D63A38902EF948E895B01D6EA497EBF84B1460C14CA5BEDCAD9F3"
1993+
MetadataModificationDTO:
1994+
type: object
1995+
required:
1996+
- modificationType
1997+
- key
1998+
- value
1999+
properties:
2000+
modificationType:
2001+
$ref: "#/components/schemas/MetadataModificationTypeEnum"
2002+
key:
2003+
type: string
2004+
description: The key of metadata modification.
2005+
value:
2006+
type: string
2007+
description: The value of metadata modification.
19612008
MultisigAccountGraphInfoDTO:
19622009
type: object
19632010
required:
@@ -2696,6 +2743,11 @@ components:
26962743
$ref: "#/components/schemas/TransactionMetaDTO"
26972744
transaction:
26982745
anyOf:
2746+
- $ref: "#/components/schemas/BlockchainUpgradeTransactionDTO"
2747+
- $ref: "#/components/schemas/NetworkConfigTransactionDTO"
2748+
- $ref: "#/components/schemas/AddressMetadataTransactionDTO"
2749+
- $ref: "#/components/schemas/MosaicMetadataTransactionDTO"
2750+
- $ref: "#/components/schemas/NamespaceMetadataTransactionDTO"
26992751
- $ref: "#/components/schemas/MosaicDefinitionTransactionDTO"
27002752
- $ref: "#/components/schemas/MosaicSupplyChangeTransactionDTO"
27012753
- $ref: "#/components/schemas/RegisterNamespaceTransactionDTO"
@@ -2738,6 +2790,11 @@ components:
27382790
$ref: "#/components/schemas/EmbeddedTransactionMetaDTO"
27392791
transaction:
27402792
anyOf:
2793+
- $ref: "#/components/schemas/EmbeddedBlockchainUpgradeTransactionDTO"
2794+
- $ref: "#/components/schemas/EmbeddedNetworkConfigTransactionDTO"
2795+
- $ref: "#/components/schemas/EmbeddedAddressMetadataTransactionDTO"
2796+
- $ref: "#/components/schemas/EmbeddedMosaicMetadataTransactionDTO"
2797+
- $ref: "#/components/schemas/EmbeddedNamespaceMetadataTransactionDTO"
27412798
- $ref: "#/components/schemas/EmbeddedMosaicDefinitionTransactionDTO"
27422799
- $ref: "#/components/schemas/EmbeddedMosaicSupplyChangeTransactionDTO"
27432800
- $ref: "#/components/schemas/EmbeddedRegisterNamespaceTransactionDTO"
@@ -2771,6 +2828,137 @@ components:
27712828
allOf:
27722829
- $ref: "#/components/schemas/EntityDTO"
27732830
- $ref: "#/components/schemas/TransactionBodyDTO"
2831+
BlockchainUpgradeBodyDTO:
2832+
type: object
2833+
required:
2834+
- upgradePeriod
2835+
- newBlockChainVersion
2836+
properties:
2837+
upgradePeriod:
2838+
$ref: "#/components/schemas/UInt64DTO"
2839+
newBlockChainVersion:
2840+
$ref: "#/components/schemas/UInt64DTO"
2841+
BlockchainUpgradeTransactionDTO:
2842+
type: object
2843+
description: Transaction that change version of blockchain.
2844+
allOf:
2845+
- $ref: "#/components/schemas/TransactionDTO"
2846+
- $ref: "#/components/schemas/BlockchainUpgradeBodyDTO"
2847+
EmbeddedBlockchainUpgradeTransactionDTO:
2848+
type: object
2849+
allOf:
2850+
- $ref: "#/components/schemas/EmbeddedTransactionDTO"
2851+
- $ref: "#/components/schemas/BlockchainUpgradeBodyDTO"
2852+
NetworkConfigBodyDTO:
2853+
type: object
2854+
required:
2855+
- applyHeightDelta
2856+
- networkConfig
2857+
- supportedEntityVersions
2858+
properties:
2859+
applyHeightDelta:
2860+
$ref: "#/components/schemas/UInt64DTO"
2861+
networkConfig:
2862+
type: string
2863+
description: Network config like a raw text.
2864+
supportedEntityVersions:
2865+
type: string
2866+
description: Allowed versions of transaction in json format.
2867+
NetworkConfigTransactionDTO:
2868+
type: object
2869+
description: Transaction that updates config.
2870+
allOf:
2871+
- $ref: "#/components/schemas/TransactionDTO"
2872+
- $ref: "#/components/schemas/NetworkConfigBodyDTO"
2873+
EmbeddedNetworkConfigTransactionDTO:
2874+
type: object
2875+
allOf:
2876+
- $ref: "#/components/schemas/EmbeddedTransactionDTO"
2877+
- $ref: "#/components/schemas/NetworkConfigBodyDTO"
2878+
AddressMetadataBodyDTO:
2879+
type: object
2880+
required:
2881+
- metadataId
2882+
- metadataType
2883+
- modifications
2884+
properties:
2885+
metadataId:
2886+
type: string
2887+
description: The address in hexadecimal.
2888+
metadataType:
2889+
$ref: "#/components/schemas/MetadataTypeEnum"
2890+
modifications:
2891+
type: array
2892+
description: The array of metadata modifications.
2893+
items:
2894+
$ref: "#/components/schemas/MetadataModificationDTO"
2895+
AddressMetadataTransactionDTO:
2896+
type: object
2897+
description: Transaction that addes metadata to account.
2898+
allOf:
2899+
- $ref: "#/components/schemas/TransactionDTO"
2900+
- $ref: "#/components/schemas/AddressMetadataBodyDTO"
2901+
EmbeddedAddressMetadataTransactionDTO:
2902+
type: object
2903+
allOf:
2904+
- $ref: "#/components/schemas/EmbeddedTransactionDTO"
2905+
- $ref: "#/components/schemas/AddressMetadataBodyDTO"
2906+
MosaicMetadataBodyDTO:
2907+
type: object
2908+
required:
2909+
- metadataId
2910+
- metadataType
2911+
- modifications
2912+
properties:
2913+
metadataId:
2914+
$ref: "#/components/schemas/UInt64DTO"
2915+
description: Mosaic id.
2916+
metadataType:
2917+
$ref: "#/components/schemas/MetadataTypeEnum"
2918+
modifications:
2919+
type: array
2920+
description: The array of metadata modifications.
2921+
items:
2922+
$ref: "#/components/schemas/MetadataModificationDTO"
2923+
MosaicMetadataTransactionDTO:
2924+
type: object
2925+
description: Transaction that addes metadata to mosaic.
2926+
allOf:
2927+
- $ref: "#/components/schemas/TransactionDTO"
2928+
- $ref: "#/components/schemas/MosaicMetadataBodyDTO"
2929+
EmbeddedMosaicMetadataTransactionDTO:
2930+
type: object
2931+
allOf:
2932+
- $ref: "#/components/schemas/EmbeddedTransactionDTO"
2933+
- $ref: "#/components/schemas/MosaicMetadataBodyDTO"
2934+
NamespaceMetadataBodyDTO:
2935+
type: object
2936+
required:
2937+
- metadataId
2938+
- metadataType
2939+
- modifications
2940+
properties:
2941+
metadataId:
2942+
$ref: "#/components/schemas/UInt64DTO"
2943+
description: Namespace id.
2944+
metadataType:
2945+
$ref: "#/components/schemas/MetadataTypeEnum"
2946+
modifications:
2947+
type: array
2948+
description: The array of metadata modifications.
2949+
items:
2950+
$ref: "#/components/schemas/MetadataModificationDTO"
2951+
NamespaceMetadataTransactionDTO:
2952+
type: object
2953+
description: Transaction that addes metadata to namespace.
2954+
allOf:
2955+
- $ref: "#/components/schemas/TransactionDTO"
2956+
- $ref: "#/components/schemas/NamespaceMetadataBodyDTO"
2957+
EmbeddedNamespaceMetadataTransactionDTO:
2958+
type: object
2959+
allOf:
2960+
- $ref: "#/components/schemas/EmbeddedTransactionDTO"
2961+
- $ref: "#/components/schemas/NamespaceMetadataBodyDTO"
27742962
MosaicDefinitionTransactionBodyDTO:
27752963
type: object
27762964
required:
@@ -3144,12 +3332,12 @@ components:
31443332
type: object
31453333
required:
31463334
- remoteAccountKey
3147-
- linkAction
3335+
- action
31483336
properties:
31493337
remoteAccountKey:
31503338
type: string
31513339
description: The public key of the remote account.
3152-
linkAction:
3340+
action:
31533341
$ref: "#/components/schemas/LinkActionEnum"
31543342
AccountLinkTransactionDTO:
31553343
type: object

src/e2e/java/io/proximax/sdk/E2EBlockchainTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ void upgradeBlockchainVersion() {
207207
}
208208

209209
@Test
210+
@Disabled("Requires nemesis private key to be defined")
210211
void configTransaction() {
211212
Account nemesis = Account.createFromPrivateKey(NEMESIS_PRIVATE_KEY, getNetworkType());
212213
BigInteger height = blockchainHttp.getBlockchainHeight().blockingFirst();

src/e2e/java/io/proximax/sdk/E2EContractTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.apache.commons.lang3.RandomUtils;
1616
import org.junit.jupiter.api.AfterAll;
1717
import org.junit.jupiter.api.BeforeAll;
18+
import org.junit.jupiter.api.Disabled;
1819
import org.junit.jupiter.api.MethodOrderer;
1920
import org.junit.jupiter.api.Test;
2021
import org.junit.jupiter.api.TestInstance;
@@ -38,6 +39,7 @@
3839
*/
3940
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
4041
@TestMethodOrder(MethodOrderer.Alphanumeric.class)
42+
@Disabled("Contracts plugin is currently disabled after security review")
4143
public class E2EContractTest extends E2EBaseTest {
4244

4345
private Account customer;

0 commit comments

Comments
 (0)