From f72fac400f1dd750163d56770e1ca68b37912b51 Mon Sep 17 00:00:00 2001 From: Linary Date: Fri, 16 Apr 2021 14:58:22 +0800 Subject: [PATCH] Improve some license params (#73) --- pom.xml | 4 ++-- .../hugegraph/license/LicenseCreateParam.java | 3 +++ .../hugegraph/license/LicenseVerifyParam.java | 2 ++ .../hugegraph/version/CommonVersion.java | 2 +- .../unit/license/LicenseCreateParamTest.java | 8 ++++---- .../unit/license/LicenseVerifyParamTest.java | 4 ++-- .../hugegraph/unit/util/VersionUtilTest.java | 2 +- src/test/resources/META-INF/MANIFEST.MF | 4 ++-- src/test/resources/create-license.json | 4 ++-- src/test/resources/privateKeys.store | Bin 1281 -> 1280 bytes src/test/resources/publicCerts.store | Bin 874 -> 873 bytes src/test/resources/verify-license.json | 2 +- 12 files changed, 20 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 23b7f4b73..993ae37ec 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.baidu.hugegraph hugegraph-common - 1.8.6 + 1.8.7 hugegraph-common https://github.com/hugegraph/hugegraph-common @@ -287,7 +287,7 @@ - 1.8.6.0 + 1.8.7.0 diff --git a/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java b/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java index 00f0bdc96..cd7c504d2 100644 --- a/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java +++ b/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java @@ -24,6 +24,7 @@ import org.apache.commons.lang3.time.DateUtils; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; @@ -35,9 +36,11 @@ public class LicenseCreateParam { @JsonProperty("private_alias") private String privateAlias; + @JsonAlias("key_ticket") @JsonProperty("key_password") private String keyPassword; + @JsonAlias("store_ticket") @JsonProperty("store_password") private String storePassword; diff --git a/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java b/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java index f2359bffd..97c200f51 100644 --- a/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java +++ b/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java @@ -19,6 +19,7 @@ package com.baidu.hugegraph.license; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonProperty; public class LicenseVerifyParam { @@ -29,6 +30,7 @@ public class LicenseVerifyParam { @JsonProperty("public_alias") private String publicAlias; + @JsonAlias("store_ticket") @JsonProperty("store_password") private String storePassword; diff --git a/src/main/java/com/baidu/hugegraph/version/CommonVersion.java b/src/main/java/com/baidu/hugegraph/version/CommonVersion.java index 0013e08d0..0ae81e531 100644 --- a/src/main/java/com/baidu/hugegraph/version/CommonVersion.java +++ b/src/main/java/com/baidu/hugegraph/version/CommonVersion.java @@ -27,5 +27,5 @@ public class CommonVersion { // The second parameter of Version.of() is for all-in-one JAR public static final Version VERSION = Version.of(CommonVersion.class, - "1.8.6"); + "1.8.7"); } diff --git a/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java b/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java index 76f684767..fb5a16fc6 100644 --- a/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java +++ b/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java @@ -37,8 +37,8 @@ public void testDeserializeLicenseCreateParam() String json = "{" + "\"subject\":\"hugegraph-evaluation\"," + "\"private_alias\":\"privatekey\"," - + "\"key_password\":\"123456\"," - + "\"store_password\":\"123456\"," + + "\"key_ticket\":\"a123456\"," + + "\"store_ticket\":\"a123456\"," + "\"privatekey_path\":\"./privateKeys.store\"," + "\"license_path\":\"./hugegraph-evaluation.license\"," + "\"issued_time\":\"2019-08-10 00:00:00\"," @@ -85,8 +85,8 @@ public void testDeserializeLicenseCreateParam() LicenseCreateParam.class); Assert.assertEquals("hugegraph-evaluation", param.subject()); Assert.assertEquals("privatekey", param.privateAlias()); - Assert.assertEquals("123456", param.keyPassword()); - Assert.assertEquals("123456", param.storePassword()); + Assert.assertEquals("a123456", param.keyPassword()); + Assert.assertEquals("a123456", param.storePassword()); Assert.assertEquals("./privateKeys.store", param.privateKeyPath()); Assert.assertEquals("./hugegraph-evaluation.license", param.licensePath()); diff --git a/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java b/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java index f1126ce77..5172f7df9 100644 --- a/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java +++ b/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java @@ -34,7 +34,7 @@ public void testDeserializeLicenseVerifyParam() throws IOException { String json = "{" + "\"subject\":\"hugegraph-evaluation\"," + "\"public_alias\":\"publiccert\"," - + "\"store_password\":\"123456\"," + + "\"store_ticket\":\"a123456\"," + "\"publickey_path\":\"./publicCerts.store\"," + "\"license_path\":\"./hugegraph-evaluation.license\"" + "}"; @@ -43,7 +43,7 @@ public void testDeserializeLicenseVerifyParam() throws IOException { LicenseVerifyParam.class); Assert.assertEquals("hugegraph-evaluation", param.subject()); Assert.assertEquals("publiccert", param.publicAlias()); - Assert.assertEquals("123456", param.storePassword()); + Assert.assertEquals("a123456", param.storePassword()); Assert.assertEquals("./publicCerts.store", param.publicKeyPath()); Assert.assertEquals("./hugegraph-evaluation.license", param.licensePath()); diff --git a/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java b/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java index 49fcdacc3..70a40c881 100644 --- a/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java +++ b/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java @@ -129,7 +129,7 @@ public void testGetImplementationVersion() throws MalformedURLException { //Mockito.when(clazz.getResource("fake.class")).thenReturn(manifest); String manifestPath = "file:./src/test/resources"; - Assert.assertEquals("1.8.6.0", + Assert.assertEquals("1.8.7.0", VersionUtil.getImplementationVersion(manifestPath)); manifestPath = "file:./src/test/resources2"; diff --git a/src/test/resources/META-INF/MANIFEST.MF b/src/test/resources/META-INF/MANIFEST.MF index fe44310d0..252019b37 100644 --- a/src/test/resources/META-INF/MANIFEST.MF +++ b/src/test/resources/META-INF/MANIFEST.MF @@ -1,9 +1,9 @@ Manifest-Version: 1.0 -Implementation-Version: 1.8.6.0 +Implementation-Version: 1.8.7.0 Archiver-Version: Plexus Archiver Built-By: jermy Specification-Title: hugegraph-common Created-By: Apache Maven 3.3.9 Build-Jdk: 1.8.0_111 -Specification-Version: 1.8.6 +Specification-Version: 1.8.7 diff --git a/src/test/resources/create-license.json b/src/test/resources/create-license.json index 26b3bd501..c1131312c 100644 --- a/src/test/resources/create-license.json +++ b/src/test/resources/create-license.json @@ -1,8 +1,8 @@ { "subject": "hugegraph-evaluation", "private_alias": "privatekey", - "key_password": "private_password123456", - "store_password": "public_password123456", + "key_ticket": "a123456", + "store_ticket": "a123456", "privatekey_path": "src/test/resources/privateKeys.store", "license_path": "src/test/resources/hugegraph-evaluation.license", "issued_time": "2019-08-01 00:00:00", diff --git a/src/test/resources/privateKeys.store b/src/test/resources/privateKeys.store index 836e413a7c76c1fae94922c567efd74e4d00008c..4982719687f2c84d2ad914ab34f86051832c1936 100644 GIT binary patch delta 735 zcmV<50wDc?3V;fbAAfk*xUEY700ECMf&qh9M<1_1;CDgqG!0R;dAf&q6C1?rYF zpk7R`9tXvW&{OR6VG6k{HdmK+yJot{fAqYUZVA%M&0MYWKxoOops*j$-<;CmSL#a& zXq|gZ<|)aQ#Wu?iH*DChM zhs*NKncMQgj>@Ozj6FQYE3-O5QY1x_58d9xf2sPlkJ-5=cDmHg=Mk8-DDej&%a zTCHhdU80I;Yk#`<9Uf_eshvNo|8_CGj5p~Id zgpQ`;u=8a#5MG8XI_XT^H7&?i%Ty{kAvA0zdSTsup#@_?9L)p2!yo`oH?e`shb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test/resources/publicCerts.store index 7eee045ffe85cb2de952e13da2248a5002b767b4..e6624be937cb1506763c8ac0d6b432c12529e958 100644 GIT binary patch delta 329 zcmV-P0k;0?2I&TnA0v3!xrqG$1z0XMFgXAK112zn10pbj0^pzn0s#U71Y@|uD3L;T z95OL5G%+?XGcq_ZG+Gx8GchnUF*GnUGB_|aT9Hp?vpNAf0e^kYhc0oz4yzz#_J8q6 z*2~D52esz1T&VB)UF7&&8rvogy?zurqTz0*qAut~>9R>qc9S#H*1QacjbFJ7Jo*a5$>IP!Ws_>;k*O4#_1_vsJ zNX|F}0|fvBF90ws0u)MoSg-;+(e~v-quYy;yMomKG}i(Y1XA|~$k^%o{|F|KEzf^F b6x3!!;d1bH?*n=Km;L5ZklTuNXs0FbC^wF_ delta 330 zcmV-Q0k!_=2I>ZoA0uqnuCY)61z0XMFgXAK11B(o10yhk0^pzn0s#U71Tj&GI*~$l z95FdCI5IdfFfcPSG+Gx8GC43fGBq(UFf%hWT9Hp?vpNAf0e=U+DN@)zdx%dxJHaq4 zn9Cvi*f+nypET^xf4T2ABW@?Ha;qA%G2XP!W6umf>)-1ktjQFToG@QoOy%lY$ZTt;30vctt59 z!v+4Z)SC2@jCXCLAut~>9R>qc9S#H*1Qapt+YN=*Z+(7%jFyrJHp&5wei$$d1_vsJ zNX|F}0|fvBFaR(u0u&y|z0f^tO0n36u_dn08(LAQhY|u60F-cn{YliYOX431$b^#2 cxw$