Skip to content

Commit

Permalink
feat(sla/agreement creation): completed DID creation
Browse files Browse the repository at this point in the history
  • Loading branch information
James Taylor committed Jun 2, 2021
1 parent 304becd commit 1531588
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public class StakeholderStatusDto {

@JsonProperty("id_token")
private String authToken;
private String timestamp;
private String state;
@JsonProperty("credential_definition_id")
private String credentialDefinitionId;
private StakeholderClaimDto stakeholderClaim;

public StakeholderStatusDto() {
Expand All @@ -29,24 +33,51 @@ public void setAuthToken(String authToken) {
this.authToken = authToken;
}

public String getTimestamp() {
return timestamp;
}

public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}

public String getState() {
return state;
}

public void setState(String state) {
this.state = state;
}

public String getCredentialDefinitionId() {
return credentialDefinitionId;
}

public void setCredentialDefinitionId(String credentialDefinitionId) {
this.credentialDefinitionId = credentialDefinitionId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StakeholderStatusDto that = (StakeholderStatusDto) o;
return stakeholderClaim.equals(that.stakeholderClaim) && authToken.equals(that.authToken);
return credentialDefinitionId.equals(that.credentialDefinitionId);
}

@Override
public int hashCode() {
return Objects.hash(stakeholderClaim, authToken);
return Objects.hash(credentialDefinitionId);
}

@Override
public String toString() {
return "StakeholderStatusDto{" +
"stakeholderClaim='" + stakeholderClaim + '\'' +
", authToken='" + authToken + '\'' +
"authToken='" + authToken + '\'' +
", timestamp='" + timestamp + '\'' +
", state='" + state + '\'' +
", credentialDefinitionId='" + credentialDefinitionId + '\'' +
", stakeholderClaim=" + stakeholderClaim +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class CreateDidRequest {
private String authToken;
private CredentialRequestType type;
private List<ClaimDto> claims;

@JsonProperty("handler_url")
private String callbackUrl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ public class IdentityAndPermissionsApiClientImpl implements IdentityAndPermissio

private StakeholderStatusDto myStakeholderStatus;

public IdentityAndPermissionsApiClientImpl() {
this.myStakeholderStatus = didClient.getMyStakeholderCredential();
}
public IdentityAndPermissionsApiClientImpl() {}

@Override
public void createDID(CreateDidRequest request) {
request.authToken(myStakeholderStatus.getAuthToken());
request.authToken(getAuthToken());
didClient.create(request);
}

private String getAuthToken() {
if(myStakeholderStatus == null) {
this.myStakeholderStatus = didClient.getMyStakeholderCredential();
}
return myStakeholderStatus.getAuthToken();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ spec:
name: smart-contract-lifecycle-mgr-api-db-credentials
key: name
- name: IDENTITY_BASE_URL
value: { { .Values.identityBaseUrl } }
value: {{ .Values.identityBaseUrl }}
- name: UPDATE_SLA_CALLBACK_URL
value: { { .Values.callbacks.updateSlaIdentity } }
value: {{ .Values.callbacks.updateSlaIdentity }}
- name: UPDATE_AGREEMENT_CALLBACK_URL
value: { { .Values.callbacks.updateAgreementIdentity } }
value: {{ .Values.callbacks.updateAgreementIdentity }}
- name: CORDA_RPC_HOST
value: "{{ .Values.corda.host }}"
- name: CORDA_RPC_PORT
Expand Down

0 comments on commit 1531588

Please sign in to comment.