Skip to content

Commit

Permalink
use did_doc?: DIDDocument; (type from did-resolver)
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Sep 27, 2024
1 parent 17a7192 commit 5b84ea7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/iden3comm/handlers/credential-proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ import { IIdentityWallet } from '../../identity';
import { byteEncoder } from '../../utils';
import { W3CCredential } from '../../verifiable';
import { AbstractMessageHandler, IProtocolMessageHandler } from './message-handler';
import { DIDDocument } from 'did-resolver';

/** @beta ProposalRequestCreationOptions represents proposal-request creation options */
export type ProposalRequestCreationOptions = {
credentials: ProposalRequestCredential[];
metadata?: { type: string; data?: JsonDocumentObject };
did_doc?: JsonDocumentObject;
did_doc?: DIDDocument;
};

/**
Expand Down
5 changes: 3 additions & 2 deletions src/iden3comm/types/protocol/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BasicMessage, JsonDocumentObject } from '../packer';
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
import { ProofType } from '../../../verifiable';
import { CircuitId } from '../../../circuits';
import { DIDDocument } from 'did-resolver';

/** AuthorizationResponseMessage is struct the represents iden3message authorization response */
export type AuthorizationResponseMessage = BasicMessage & {
Expand All @@ -14,7 +15,7 @@ export type AuthorizationResponseMessage = BasicMessage & {

/** AuthorizationMessageResponseBody is struct the represents authorization response data */
export type AuthorizationMessageResponseBody = {
did_doc?: JsonDocumentObject;
did_doc?: DIDDocument;
message?: string;
scope: Array<ZeroKnowledgeProofResponse>;
};
Expand All @@ -31,7 +32,7 @@ export type AuthorizationRequestMessageBody = {
callbackUrl: string;
reason?: string;
message?: string;
did_doc?: JsonDocumentObject;
did_doc?: DIDDocument;
scope: Array<ZeroKnowledgeProofRequest>;
};

Expand Down
3 changes: 2 additions & 1 deletion src/iden3comm/types/protocol/proposal-request.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DIDDocument } from 'did-resolver';
import { BasicMessage, JsonDocumentObject } from '../';
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';

Expand All @@ -11,7 +12,7 @@ export type ProposalRequestMessage = BasicMessage & {
export type ProposalRequestMessageBody = {
credentials: ProposalRequestCredential[];
metadata?: { type: string; data?: JsonDocumentObject };
did_doc?: JsonDocumentObject;
did_doc?: DIDDocument;
};

/** @beta ProposalMessage is struct the represents proposal message */
Expand Down
8 changes: 0 additions & 8 deletions tests/handlers/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: [proofReq as ZeroKnowledgeProofRequest]
};

Expand Down Expand Up @@ -227,7 +226,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: [proofReq as ZeroKnowledgeProofRequest]
};

Expand Down Expand Up @@ -386,7 +384,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: proofReqs
};

Expand Down Expand Up @@ -550,7 +547,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: proofReqs
};

Expand Down Expand Up @@ -792,7 +788,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: proofReqs
};

Expand Down Expand Up @@ -1467,7 +1462,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: [
{
id: 1,
Expand Down Expand Up @@ -2092,7 +2086,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: proofReqs
};

Expand Down Expand Up @@ -2157,7 +2150,6 @@ describe('auth', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: [proofReq as ZeroKnowledgeProofRequest]
};

Expand Down
1 change: 0 additions & 1 deletion tests/iden3comm/message-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ describe('MessageHandler', () => {
callbackUrl: 'http://localhost:8080/callback?id=1234442-123123-123123',
reason: 'reason',
message: 'message',
did_doc: {},
scope: [
{
id: 1,
Expand Down

0 comments on commit 5b84ea7

Please sign in to comment.