Skip to content

Commit

Permalink
* modify checkstyle issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chenhaozx committed Dec 18, 2019
1 parent 2618ba6 commit 379fc3c
Show file tree
Hide file tree
Showing 33 changed files with 1,358 additions and 1,108 deletions.
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ configurations {

dependencies {

compile("org.fisco-bcos:web3sdk:2.0.5"){
exclude group:"io.netty"
}
compile("org.fisco-bcos:web3sdk-weevent:1.2.5")

localDeps 'org.projectlombok:lombok:1.18.10'
if (gradleVer.startsWith("4")) {
if (!gradle.startParameter.isOffline()) {
Expand All @@ -147,6 +142,7 @@ dependencies {
compile("com.webank:weid-contract-java:1.2.11") {
exclude group: "org.slf4j", module: "slf4j-log4j12"
}
compile files("lib/WeDPR-Java-SDK.jar")
testCompile logger, apache_commons, json, junit, jmockit, rpc, pdfbox, protobuf
} else {
compileOnly files('dist/lib/lombok-1.18.10.jar')
Expand Down
Binary file added lib/WeDPR-Java-SDK.jar
Binary file not shown.
11 changes: 6 additions & 5 deletions src/main/java/com/webank/weid/constant/AmopMsgType.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ public enum AmopMsgType {
GET_POLICY_AND_CHALLENGE(4),

/**
* 请求issuer签credential
* 请求issuer签 pre-credential.
*/
GET_POLICY_AND_PRE_CREDENTIAL(5),

/**
* 请求issuer签credential
* 请求issuer签credential.
*/
REQUEST_SIGN_CREDENTIAL(6);
REQUEST_SIGN_CREDENTIAL(6);

private Integer value;

Expand All @@ -79,6 +79,7 @@ public Integer getValue() {

/**
* callback by type.
*
* @param amopCallback the callback instance
* @param messageId the messageId
* @param msgBodyStr the message body
Expand All @@ -96,7 +97,7 @@ public String callOnPush(AmopCallback amopCallback, String messageId, String msg
AmopNotifyMsgResult result = amopCallback.onPush(args);
resultBodyStr = DataToolUtils.serialize(result);
break;
}
}
case TYPE_TRANSPORTATION: {
AmopCommonArgs args = DataToolUtils.deserialize(msgBodyStr, AmopCommonArgs.class);
AmopResponse result = amopCallback.onPush(args);
Expand All @@ -110,7 +111,7 @@ public String callOnPush(AmopCallback amopCallback, String messageId, String msg
GetEncryptKeyResponse result = amopCallback.onPush(args);
resultBodyStr = DataToolUtils.serialize(result);
break;
}
}
case GET_POLICY_AND_CHALLENGE: {
// GET POLICY AND CHALLENGE
GetPolicyAndChallengeArgs args =
Expand Down
73 changes: 31 additions & 42 deletions src/main/java/com/webank/weid/constant/CredentialConstant.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

package com.webank.weid.constant;

import com.webank.weid.protocol.base.WeIdAuthentication;
import com.webank.weid.util.CredentialUtils;

/**
* The Class CredentialConstant.
*
Expand All @@ -40,12 +37,12 @@ public final class CredentialConstant {
* The Constant default Credential Context field name in Credential Json String.
*/
public static final String CREDENTIAL_CONTEXT_PORTABLE_JSON_FIELD = "@context";

/**
* The Constant default Credential type.
*/
public static final String DEFAULT_CREDENTIAL_TYPE = "VerifiableCredential";


/**
* The Constant zkp Credential type.
Expand All @@ -63,7 +60,7 @@ public final class CredentialConstant {
public static final String CLAIM_POLICY_FIELD = "policy";

/**
* credential id
* credential id.
*/
public static final String CREDENTIAL_META_KEY_ID = "id";

Expand Down Expand Up @@ -96,76 +93,68 @@ public final class CredentialConstant {
* The Constant is an field in claimPolicy.
*/
public static final String CLAIM_POLICY_DISCLOSED_FIELD = "fieldsToBeDisclosed";

/**
* The Credential Proof Type Enumerate.
*/
public static enum CredentialProofType {
ECDSA("Secp256k1");

/**
* The Type Name of the Credential Proof.
*/
private String typeName;

/**
* Constructor.
*/
CredentialProofType(String typeName) {
this.typeName = typeName;
}

/**
* Getter.
* @return typeName
*/
public String getTypeName() {
return typeName;
}
}

/**
* Default CPT ID for embedded credential signature subject (multi-sign support).
*/
public static final Integer CREDENTIAL_EMBEDDED_SIGNATURE_CPT = 106;

/**
* Default CPT ID for embedded credentialPojo subject (multi-sign support).
*/
public static final Integer CREDENTIALPOJO_EMBEDDED_SIGNATURE_CPT = 107;

/**
* Embedded trusted timestamp default CPT ID.
*/
public static final Integer EMBEDDED_TIMESTAMP_CPT = 108;

/**
* Embedded trusted timestamp envelop default CPT ID.
*/
public static final Integer TIMESTAMP_ENVELOP_CPT = 109;

/**
* Authorization CPT ID.
*/
public static final Integer AUTHORIZATION_CPT = 101;

/**
* Challenge CPT ID.
*/
public static final Integer CHALLENGE_CPT = 102;

/**
* Challenge Verification CPT ID.
*/
public static final Integer CHALLENGE_VERIFICATION_CPT = 103;

/**
* Claim Policy CPT ID.
*/
public static final Integer CLAIM_POLICY_CPT = 104;

/**
* Service Endpoint CPT ID.
*/
public static final Integer SERVICE_ENDPOINT_CPT = 105;

/**
* The Credential Proof Type Enumerate.
*/
public static enum CredentialProofType {
ECDSA("Secp256k1");

/**
* The Type Name of the Credential Proof.
*/
private String typeName;

/**
* Constructor.
*/
CredentialProofType(String typeName) {
this.typeName = typeName;
}

/**
* Getter.
*
* @return typeName
*/
public String getTypeName() {
return typeName;
}
}
}
5 changes: 5 additions & 0 deletions src/main/java/com/webank/weid/constant/ErrorCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public enum ErrorCode {
*/
CPT_EVENT_LOG_NULL(100304, "cpt event log is null."),

/**
* credential template save failed.
*/
CPT_CREDENTIAL_TEMPLATE_SAVE_ERROR(100305, "cpt credential template saved with error."),

/**
* Credential main error code.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ public final class JsonSchemaConstant {
**/
public static final String REQUIRED_KEY = "required";

/**
* json schema: $schema key.
**/
public static final String ADDITIONAL_PROPERTIES = "additionalProperties";

}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ public final class ParamKeyConstant {
public static final String BLINDING_FACTORS = "credentialSecretsBlindingFactors";


public static final String TRNSACTION_RECEIPT_STATUS_SUCCESS = "0x0";
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,50 @@
/*
* Copyright© (2018-2019) WeBank Co., Ltd.
*
* This file is part of weid-java-sdk.
*
* weid-java-sdk is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* weid-java-sdk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with weid-java-sdk. If not, see <https://www.gnu.org/licenses/>.
*/


package com.webank.weid.protocol.amop;

import java.util.Map;

import com.webank.weid.protocol.amop.base.AmopBaseMsgArgs;

import lombok.Getter;
import lombok.Setter;

import com.webank.weid.protocol.amop.base.AmopBaseMsgArgs;

/**
* args for GetPolicyAndPreCredential.
* @author tonychen 2019年12月3日
*
*/
@Getter
@Setter
public class GetPolicyAndPreCredentialArgs extends AmopBaseMsgArgs{

private String policyId;
private String targetUserWeId;
private Integer cptId;
/**
* 用户填入的claim数据
*/
private String userInputForm;
private Map<String, String>extra;
public class GetPolicyAndPreCredentialArgs extends AmopBaseMsgArgs {

private String policyId;

private String targetUserWeId;

private Integer cptId;

/**
* 用户填入的claim数据.
*/
private String userInputForm;

private Map<String, String> extra;
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
package com.webank.weid.protocol.amop;
/*
* Copyright© (2018-2019) WeBank Co., Ltd.
*
* This file is part of weid-java-sdk.
*
* weid-java-sdk is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* weid-java-sdk is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with weid-java-sdk. If not, see <https://www.gnu.org/licenses/>.
*/

import com.webank.weid.protocol.amop.base.AmopBaseMsgArgs;
import com.webank.weid.protocol.base.PresentationE;
package com.webank.weid.protocol.amop;

import lombok.Getter;
import lombok.Setter;

import com.webank.weid.protocol.amop.base.AmopBaseMsgArgs;
import com.webank.weid.protocol.base.PresentationE;

/**
* args for requesting issuer to issue credential.
* @author tonychen 2019年12月4日
*
*/
@Getter
@Setter
public class IssueCredentialArgs extends AmopBaseMsgArgs{

private PresentationE presentation;
private Integer cptId;
private String claim;
private String policyId;
private String userWeId;
public class IssueCredentialArgs extends AmopBaseMsgArgs {

private PresentationE presentation;

private Integer cptId;

private String claim;

private String policyId;

private String userWeId;

}
Loading

0 comments on commit 379fc3c

Please sign in to comment.