Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge develop to main #116

Merged
merged 15 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
# # Only needed to build indy-sdk
# build-essential

# # nodejs
# # RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
# # RUN /bin/bash -c "source /root/.nvm/nvm.sh && nvm install 18 && nvm use 18"

# RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -

# # yarn
Expand All @@ -23,6 +19,10 @@
# RUN apt-get update -y && apt-get install -y --allow-unauthenticated \
# nodejs

# # install depdencies
# RUN apt-get update -y && apt-get install -y --allow-unauthenticated \
# nodejs

# # Install yarn seperately due to `no-install-recommends` to skip nodejs install
# RUN apt-get install -y --no-install-recommends yarn

Expand Down Expand Up @@ -76,5 +76,3 @@ COPY --from=builder /app/patches ./patches

# Set entry point
ENTRYPOINT ["node", "./bin/afj-rest.js", "start"]


24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
"validate": "yarn lint && yarn check-types && yarn check-format"
},
"dependencies": {
"@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.7",
"@credo-ts/anoncreds": "0.5.1",
"@credo-ts/askar": "0.5.1",
"@credo-ts/core": "0.5.1",
"@credo-ts/indy-vdr": "0.5.1",
"@credo-ts/node": "0.5.1",
"@ayanworks/credo-polygon-w3c-module": "0.0.2-alpha.8",
"@credo-ts/anoncreds": "0.5.3",
"@credo-ts/askar": "0.5.3",
"@credo-ts/core": "0.5.3",
"@credo-ts/indy-vdr": "0.5.3",
"@credo-ts/node": "0.5.3",
"@credo-ts/push-notifications": "^0.7.0",
"@credo-ts/question-answer": "0.5.1",
"@credo-ts/tenants": "0.5.1",
"@hyperledger/anoncreds-nodejs": "0.2.1",
"@hyperledger/aries-askar-nodejs": "0.2.0",
"@hyperledger/indy-vdr-nodejs": "0.2.0",
"@credo-ts/question-answer": "0.5.3",
"@credo-ts/tenants": "0.5.3",
"@hyperledger/anoncreds-nodejs": "0.2.2",
"@hyperledger/aries-askar-nodejs": "0.2.1",
"@hyperledger/indy-vdr-nodejs": "0.2.2",
"@tsoa/runtime": "^6.0.0",
"@types/node-fetch": "^2.6.4",
"@types/ref-struct-di": "^1.1.9",
Expand Down Expand Up @@ -100,6 +100,6 @@
"typescript": "^5.3.3"
},
"engines": {
"node": "18.19.0"
"node": ">=18"
}
}
50 changes: 50 additions & 0 deletions patches/@credo-ts+core+0.5.1+001+initial.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/node_modules/@credo-ts/core/build/agent/EnvelopeService.js b/node_modules/@credo-ts/core/build/agent/EnvelopeService.js
index 12261a9..0238d59 100644
--- a/node_modules/@credo-ts/core/build/agent/EnvelopeService.js
+++ b/node_modules/@credo-ts/core/build/agent/EnvelopeService.js
@@ -32,12 +32,14 @@ let EnvelopeService = class EnvelopeService {
let encryptedMessage = await agentContext.wallet.pack(message, recipientKeysBase58, senderKeyBase58 !== null && senderKeyBase58 !== void 0 ? senderKeyBase58 : undefined);
// If the message has routing keys (mediator) pack for each mediator
for (const routingKeyBase58 of routingKeysBase58) {
+ console.log(`message['@type']`, JSON.stringify(message['@type']))
const forwardMessage = new messages_1.ForwardMessage({
// Forward to first recipient key
to: recipientKeysBase58[0],
message: encryptedMessage,
});
recipientKeysBase58 = [routingKeyBase58];
+ forwardMessage["messageType"] = message['@type'];
this.logger.debug('Forward message created', forwardMessage);
const forwardJson = forwardMessage.toJSON({
useDidSovPrefixWhereAllowed: agentContext.config.useDidSovPrefixWhereAllowed,
diff --git a/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts b/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts
index 4f8577b..396f78a 100644
--- a/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts
+++ b/node_modules/@credo-ts/core/build/modules/routing/messages/ForwardMessage.d.ts
@@ -3,6 +3,7 @@ import { EncryptedMessage } from '../../../types';
export interface ForwardMessageOptions {
id?: string;
to: string;
+ messageType: string;
message: EncryptedMessage;
}
/**
@@ -19,5 +20,6 @@ export declare class ForwardMessage extends AgentMessage {
readonly type: string;
static readonly type: import("../../../utils/messageType").ParsedMessageType;
to: string;
+ messageType: string;
message: EncryptedMessage;
}
diff --git a/node_modules/@credo-ts/core/build/types.d.ts b/node_modules/@credo-ts/core/build/types.d.ts
index e0384d9..0a669fb 100644
--- a/node_modules/@credo-ts/core/build/types.d.ts
+++ b/node_modules/@credo-ts/core/build/types.d.ts
@@ -81,6 +81,7 @@ export interface PlaintextMessage {
thid?: string;
pthid?: string;
};
+ messageType: string;
[key: string]: unknown;
}
export interface OutboundPackage {
33 changes: 33 additions & 0 deletions patches/@credo-ts+core+0.5.3+002+fix-process-problem-report.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/node_modules/@credo-ts/core/build/modules/credentials/protocol/BaseCredentialProtocol.js b/node_modules/@credo-ts/core/build/modules/credentials/protocol/BaseCredentialProtocol.js
index 30dbb7a..5b1b54c 100644
--- a/node_modules/@credo-ts/core/build/modules/credentials/protocol/BaseCredentialProtocol.js
+++ b/node_modules/@credo-ts/core/build/modules/credentials/protocol/BaseCredentialProtocol.js
@@ -19,11 +19,9 @@ class BaseCredentialProtocol {
*/
async processProblemReport(messageContext) {
const { message: credentialProblemReportMessage, agentContext } = messageContext;
- const connection = messageContext.assertReadyConnection();
agentContext.config.logger.debug(`Processing problem report with message id ${credentialProblemReportMessage.id}`);
const credentialRecord = await this.getByProperties(agentContext, {
threadId: credentialProblemReportMessage.threadId,
- connectionId: connection.id,
});
// Update record
credentialRecord.errorMessage = `${credentialProblemReportMessage.description.code}: ${credentialProblemReportMessage.description.en}`;
diff --git a/node_modules/@credo-ts/core/build/modules/proofs/protocol/BaseProofProtocol.js b/node_modules/@credo-ts/core/build/modules/proofs/protocol/BaseProofProtocol.js
index 25d2948..cf9e315 100644
--- a/node_modules/@credo-ts/core/build/modules/proofs/protocol/BaseProofProtocol.js
+++ b/node_modules/@credo-ts/core/build/modules/proofs/protocol/BaseProofProtocol.js
@@ -8,11 +8,10 @@ const ProofState_1 = require("../models/ProofState");
const repository_1 = require("../repository");
class BaseProofProtocol {
async processProblemReport(messageContext) {
- const { message: proofProblemReportMessage, agentContext, connection } = messageContext;
+ const { message: proofProblemReportMessage, agentContext } = messageContext;
agentContext.config.logger.debug(`Processing problem report with message id ${proofProblemReportMessage.id}`);
const proofRecord = await this.getByProperties(agentContext, {
threadId: proofProblemReportMessage.threadId,
- connectionId: connection === null || connection === void 0 ? void 0 : connection.id,
});
// Update record
proofRecord.errorMessage = `${proofProblemReportMessage.description.code}: ${proofProblemReportMessage.description.en}`;
4 changes: 2 additions & 2 deletions samples/cliConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"autoAcceptMediationRequests": false,
"adminPort": 4001,
"tenancy": true,
"didRegistryContractAddress": "0xc087766218b885C6283072BA316a2Bc31B5c17db",
"schemaManagerContractAddress": "0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e",
"didRegistryContractAddress": "0xC1c392DC1073a86821B4ae37f1F0faCDcFFf45bF",
"schemaManagerContractAddress": "0x289c7Bd4C7d38cC54bff370d6f9f01b74Df51b11",
"rpcUrl": "https://rpc-amoy.polygon.technology",
"fileServerUrl": "https://schema.credebl.id/",
"fileServerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk"
Expand Down
4 changes: 2 additions & 2 deletions src/cliAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@

questionAnswer: new QuestionAnswerModule(),
polygon: new PolygonModule({
didContractAddress: '0xc087766218b885C6283072BA316a2Bc31B5c17db',
schemaManagerContractAddress: '0xD6f235F1159970211B3628CbC15e6c75D4Fb6e6e',
didContractAddress: '0xC1c392DC1073a86821B4ae37f1F0faCDcFFf45bF',
schemaManagerContractAddress: '0x289c7Bd4C7d38cC54bff370d6f9f01b74Df51b11',
fileServerToken:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJBeWFuV29ya3MiLCJpZCI6ImNhZDI3ZjhjLTMyNWYtNDRmZC04ZmZkLWExNGNhZTY3NTMyMSJ9.I3IR7abjWbfStnxzn1BhxhV0OEzt1x3mULjDdUcgWHk',
rpcUrl: 'https://rpc-amoy.polygon.technology',
Expand Down Expand Up @@ -346,7 +346,7 @@
// instead use the existin JWT token
// if JWT token is not found, create/generate a new token and save in genericRecords
// next time, the same token should be used - instead of creating a new token on every restart event of the agent
token = jwt.sign({ agentInfo: 'agentInfo' }, secretKeyInfo)

Check warning on line 349 in src/cliAgent.ts

View workflow job for this annotation

GitHub Actions / Validate

Caution: `jwt` also has a named export `sign`. Check if you meant to write `import {sign} from 'jsonwebtoken'` instead
await agent.genericRecords.save({
content: {
secretKey: secretKeyInfo,
Expand Down
2 changes: 0 additions & 2 deletions src/controllers/credentials/CredentialController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
CredentialState,
Agent,
RecordNotFoundError,
HandshakeProtocol,
W3cCredentialService,
Key,
KeyType,
Expand Down Expand Up @@ -231,7 +230,6 @@ export class CredentialController extends Controller {
const credentialMessage = offerOob.message
const outOfBandRecord = await this.agent.oob.createInvitation({
label: outOfBandOption.label,
handshakeProtocols: [HandshakeProtocol.Connections],
messages: [credentialMessage],
autoAcceptConnection: true,
imageUrl: outOfBandOption?.imageUrl,
Expand Down
Loading
Loading