Skip to content
Snippets Groups Projects
Commit 96c6d3f7 authored by Alexey Lunin's avatar Alexey Lunin
Browse files

Merge branch '79-reject-proof-and-presentation' into 'main'

Reject Proof Request and Reject Presentation for OC

See merge request gaiax/ocm/proof-manager!47
parents 11dbe3cc 089f2830
Branches
No related merge requests found
Showing
with 912 additions and 144 deletions
......@@ -5,6 +5,7 @@ ECSURL=http://localhost:9200/
ACCEPT_PRESENTATION_CONFIG=AUTO
NATS_URL=nats://localhost:4222
AGENT_URL=http://localhost:3010
DIDCOMM_URL=http://localhost:3009
USE_AUTH=false
OAUTH_CLIENT_ID=clientid
OAUTH_CLIENT_SECRET=clientsecret
......
......@@ -12,6 +12,7 @@ const config = () => ({
},
agent: {
agentUrl: process.env.AGENT_URL,
didcommUrl: process.env.DIDCOMM_URL,
},
DATABASE: {
type: 'postgres',
......
......@@ -61,7 +61,7 @@ describe('Proof Presentation Controller', () => {
1,
{
id: '3b5e9083-2c2d-4acf-8b18-13f43e31c7df',
presentation_id: '0448de40-415c-4448-bfa0-456fd8936f91',
proof_record_id: '0448de40-415c-4448-bfa0-456fd8936f91',
participant_id: '7780cd24-af13-423e-b1ff-ae944ab6fd71',
connectionId: '9c80d8c0-8893-4638-97d2-221024f5bafa',
credential_def_id: 'LC5aqqDP6sB7Nyn3GHn4eC:3:CL:242017:UID',
......@@ -77,7 +77,7 @@ describe('Proof Presentation Controller', () => {
count: 1,
records: {
id: '3b5e9083-2c2d-4acf-8b18-13f43e31c7df',
presentation_id: '0448de40-415c-4448-bfa0-456fd8936f91',
proof_record_id: '0448de40-415c-4448-bfa0-456fd8936f91',
participant_id: '7780cd24-af13-423e-b1ff-ae944ab6fd71',
connectionId: '9c80d8c0-8893-4638-97d2-221024f5bafa',
credential_def_id: 'LC5aqqDP6sB7Nyn3GHn4eC:3:CL:242017:UID',
......@@ -124,7 +124,7 @@ describe('Proof Presentation Controller', () => {
describe('find-by-presentation-id', () => {
it('should return an proof presentation', async () => {
const query = {
presentation_id: '6703e2e3-4bb3-463d-b2e4-5ea41ccd031f',
proof_record_id: '6703e2e3-4bb3-463d-b2e4-5ea41ccd031f',
participant_id: '7780cd24-af13-423e-b1ff-ae944ab6fd71',
};
const serviceResult: any = {
......@@ -190,9 +190,9 @@ describe('Proof Presentation Controller', () => {
const response = httpMocks.createResponse();
jest
.spyOn(service, 'findProofByPresentationId')
.spyOn(service, 'findProofByProofRecordId')
.mockResolvedValueOnce(serviceResult);
const res: any = await controller.findProofByPresentationId(
const res: any = await controller.findProofByProofRecordId(
query,
response,
);
......@@ -202,9 +202,9 @@ describe('Proof Presentation Controller', () => {
expect(resData.data).toStrictEqual(result);
});
it('should return an presentation request required following attributes ( presentation_id, participant_id )', async () => {
it('should return an presentation request required following attributes ( proof_record_id, participant_id )', async () => {
const query = {
presentation_id: '',
proof_record_id: '',
participant_id: '',
};
const serviceResult: any = [];
......@@ -213,13 +213,13 @@ describe('Proof Presentation Controller', () => {
const result = {
statusCode: HttpStatus.BAD_REQUEST,
message:
'Find presentation request required following attributes ( presentation_id, participant_id )',
'Find presentation request required following attributes ( proof_record_id, participant_id )',
};
jest
.spyOn(service, 'findProofByPresentationId')
.spyOn(service, 'findProofByProofRecordId')
.mockImplementation(() => serviceResult);
const res: any = await controller.findProofByPresentationId(
const res: any = await controller.findProofByProofRecordId(
query,
response,
);
......@@ -231,16 +231,16 @@ describe('Proof Presentation Controller', () => {
it('should return an proof presentation no data found', async () => {
const query = {
presentation_id: '6703e2e3-4bb3-463d-b2e4-5ea41ccd031f',
proof_record_id: '6703e2e3-4bb3-463d-b2e4-5ea41ccd031f',
participant_id: '7780cd24-af13-423e-b1ff-ae944ab6fd71',
};
const serviceResult: any = '';
const result: any = { statusCode: 404, message: 'No Data found' };
const response = httpMocks.createResponse();
jest
.spyOn(service, 'findProofByPresentationId')
.spyOn(service, 'findProofByProofRecordId')
.mockResolvedValueOnce(serviceResult);
const res: any = await controller.findProofByPresentationId(
const res: any = await controller.findProofByProofRecordId(
query,
response,
);
......@@ -264,7 +264,7 @@ describe('Proof Presentation Controller', () => {
},
],
participantId: '',
presentationId: '',
proofRecordId: '',
};
const serviceResult: any = [];
const response = httpMocks.createResponse();
......@@ -301,7 +301,7 @@ describe('Proof Presentation Controller', () => {
},
],
participantId: '',
presentationId: '',
proofRecordId: '',
};
const serviceResult: any = {
_tags: {},
......@@ -325,7 +325,7 @@ describe('Proof Presentation Controller', () => {
const result: any = {
id: 'aa74842c-6bf5-4647-864c-4c45012cfef3',
presentation_id: '03469be8-a70e-4190-952c-d1b3778e81e5',
proof_record_id: '03469be8-a70e-4190-952c-d1b3778e81e5',
participant_id: '662dc769-a4de-4c95-934c-f6dab8cf432c',
connectionId: '1d50f39b-200a-460d-8198-c2dac92d813a',
credential_def_id:
......@@ -367,7 +367,7 @@ describe('Proof Presentation Controller', () => {
},
],
participantId: '',
presentationId: '',
proofRecordId: '',
};
const serviceResult: any = {
state: 'request-sent',
......@@ -412,7 +412,7 @@ describe('Proof Presentation Controller', () => {
},
],
participantId: '',
presentationId: '',
proofRecordId: '',
};
const serviceResult: any = [];
const response = httpMocks.createResponse();
......@@ -449,7 +449,7 @@ describe('Proof Presentation Controller', () => {
},
],
participantId: '1d50f39b-200a-460d-8198-c2dac92d813a',
presentationId: '',
proofRecordId: '',
};
const serviceResult: any = {
message:
......@@ -478,7 +478,7 @@ describe('Proof Presentation Controller', () => {
const result: any = {
id: '4cb19a07-0a3c-4a73-bbd6-006b73b26eeb',
presentation_id: '98c9840b-f47e-4572-8666-f17c13a6efa8',
proof_record_id: '98c9840b-f47e-4572-8666-f17c13a6efa8',
participant_id: '662dc769-a4de-4c95-934c-f6dab8cf432c',
connectionId: '',
credential_def_id:
......@@ -522,7 +522,7 @@ describe('Proof Presentation Controller', () => {
},
],
participantId: '1d50f39b-200a-460d-8198-c2dac92d813a',
presentationId: '',
proofRecordId: '',
};
const serviceResult: any = {
state: 'request-sent',
......
This diff is collapsed.
......@@ -4,5 +4,5 @@ import { IsString } from 'class-validator';
export default class AcceptPresentationDto {
@IsString()
@ApiProperty()
presentationId: string;
proofRecordId: string;
}
import { IsNumber } from 'class-validator';
import { IsNumber, IsString, IsDateString } from 'class-validator';
export default class FindProofPresentationDto {
@IsNumber()
......@@ -6,4 +6,34 @@ export default class FindProofPresentationDto {
@IsNumber()
pageSize: string;
@IsString()
proofRecordId: string;
@IsString()
connectionId: string;
@IsString()
credentialDefId: string;
@IsString()
schemaId: string;
@IsString()
theirDid: string;
@IsString()
status: string;
@IsDateString()
createdDateStart: string;
@IsDateString()
createdDateEnd: string;
@IsDateString()
updatedDateStart: string;
@IsDateString()
updatedDateEnd: string;
}
......@@ -3,7 +3,7 @@ import { IsString, IsNotEmpty } from 'class-validator';
export default class PresentationSubscriptionEndpointDto {
@IsString()
@IsNotEmpty()
presentationId: string;
proofRecordId: string;
@IsString()
@IsNotEmpty()
......
......@@ -10,7 +10,7 @@ export default class SendProofRequest {
connectionId?: string;
@IsString()
presentationId?: string;
proofRecordId?: string;
@IsString()
status?: string;
......
......@@ -45,6 +45,12 @@ export default class PresentationProofRepository {
]);
}
async deleteProofRequest(proofRecordId: string) {
return this.prismaService.proof.delete({
where: { proofRecordId },
});
}
async createShortUrl(originalUrl: string) {
return this.prismaService.shortUrl.create({
data: {
......
......@@ -101,7 +101,7 @@ describe('ConnectionsService', () => {
jest.spyOn(restClient, 'get').mockResolvedValueOnce(result);
const res: any = await service.findProofByPresentationId(
const res: any = await service.findProofByProofRecordId(
'117631fe-06c8-4b2c-9132-9e9f775709d8',
'662dc769-a4de-4c95-934c-f6dab8cf432c',
);
......@@ -115,7 +115,7 @@ describe('ConnectionsService', () => {
[
{
id: '77e98b6d-cbd0-41e4-b878-8161888ff489',
presentation_id: '698fa724-675b-437d-bee9-b9e86a520572',
proof_record_id: '698fa724-675b-437d-bee9-b9e86a520572',
participant_id: '66398cf4-e14d-4d92-9dc4-b40a48ae97dd',
connectionId: '',
credential_def_id:
......@@ -128,7 +128,7 @@ describe('ConnectionsService', () => {
},
{
id: 'c02f4723-510a-4966-b3fa-de7ef6d8f1aa',
presentation_id: 'ab0b3681-eccb-4c5d-9c2f-4dabc1828255',
proof_record_id: 'ab0b3681-eccb-4c5d-9c2f-4dabc1828255',
participant_id: '66398cf4-e14d-4d92-9dc4-b40a48ae97dd',
connectionId: 'b213f9bd-3774-40dd-8f1f-085950c10c30',
credential_def_id:
......@@ -147,7 +147,7 @@ describe('ConnectionsService', () => {
[
{
id: '77e98b6d-cbd0-41e4-b878-8161888ff489',
presentation_id: '698fa724-675b-437d-bee9-b9e86a520572',
proof_record_id: '698fa724-675b-437d-bee9-b9e86a520572',
participant_id: '66398cf4-e14d-4d92-9dc4-b40a48ae97dd',
connectionId: '',
credential_def_id:
......@@ -160,7 +160,7 @@ describe('ConnectionsService', () => {
},
{
id: 'c02f4723-510a-4966-b3fa-de7ef6d8f1aa',
presentation_id: 'ab0b3681-eccb-4c5d-9c2f-4dabc1828255',
proof_record_id: 'ab0b3681-eccb-4c5d-9c2f-4dabc1828255',
participant_id: '66398cf4-e14d-4d92-9dc4-b40a48ae97dd',
connectionId: 'b213f9bd-3774-40dd-8f1f-085950c10c30',
credential_def_id:
......@@ -187,7 +187,7 @@ describe('ConnectionsService', () => {
it('create presentation request', async () => {
const serviceDto: any = [
{
presentation_id: '698fa724-675b-437d-bee9-b9e86a520572',
proof_record_id: '698fa724-675b-437d-bee9-b9e86a520572',
participant_id: '66398cf4-e14d-4d92-9dc4-b40a48ae97dd',
connectionId: '',
credential_def_id:
......@@ -201,7 +201,7 @@ describe('ConnectionsService', () => {
const repositoryResult: any = {
id: 'c7e06b9e-d796-4a54-b8f2-9746d3188c97',
presentation_id: '117631fe-06c8-4b2c-9132-9e9f775709d8',
proof_record_id: '117631fe-06c8-4b2c-9132-9e9f775709d8',
participant_id: '662dc769-a4de-4c95-934c-f6dab8cf432c',
connectionId: 'b6724f85-a633-43ee-9c1c-736eaccbb6f9',
credential_def_id:
......@@ -215,7 +215,7 @@ describe('ConnectionsService', () => {
const result: any = {
id: 'c7e06b9e-d796-4a54-b8f2-9746d3188c97',
presentation_id: '117631fe-06c8-4b2c-9132-9e9f775709d8',
proof_record_id: '117631fe-06c8-4b2c-9132-9e9f775709d8',
participant_id: '662dc769-a4de-4c95-934c-f6dab8cf432c',
connectionId: 'b6724f85-a633-43ee-9c1c-736eaccbb6f9',
credential_def_id:
......@@ -256,7 +256,7 @@ describe('ConnectionsService', () => {
'Knwz4KG97ta6EnC5BT7uH3:3:CL:241901:gaia-x principal member credential 0.2',
connectionId: 'b6724f85-a633-43ee-9c1c-736eaccbb6f9',
participantId: '',
presentationId: '',
proofRecordId: '',
};
const getAgentDetails: any = {
......@@ -346,7 +346,7 @@ describe('ConnectionsService', () => {
'Knwz4KG97ta6EnC5BT7uH3:3:CL:241901:gaia-x principal member credential 0.2',
connectionId: '',
participantId: '662dc769-a4de-4c95-934c-f6dab8cf432c',
presentationId: '',
proofRecordId: '',
};
const getAgentDetails: any = {
......
......@@ -21,6 +21,8 @@ export default class PresentationProofsService {
private agentURL;
private didcommUrl;
constructor(
private readonly natsClient: NatsClientService,
private readonly prismaService: PrismaService,
......@@ -33,6 +35,7 @@ export default class PresentationProofsService {
);
this.agentURL = this.configService.get('agent').agentUrl;
this.didcommUrl = this.configService.get('agent').didcommUrl;
}
getAppUrl() {
......@@ -43,25 +46,79 @@ export default class PresentationProofsService {
TRUSTED: 'trusted',
};
async findProofByPresentationId(presentation_id: string) {
return this.restClient.get(`${this.agentURL}/proofs/${presentation_id}`);
async findProofByProofRecordId(proof_record_id: string) {
return this.restClient.get(`${this.agentURL}/proofs/${proof_record_id}`);
}
async findProofPresentation(pageSize: number, page: number) {
async findProofPresentation(
pageSize: number,
page: number,
proofRecordId?: string | false,
connectionId?: string | false,
credentialDefId?: string | false,
schemaId?: string | false,
theirDid?: string | false,
status?: string | false,
createdDateStart?: string | false,
createdDateEnd?: string | false,
updatedDateStart?: string | false,
updatedDateEnd?: string | false,
) {
let query: {
skip?: number;
take?: number;
cursor?: Prisma.ProofWhereUniqueInput;
where?: Prisma.ProofWhereInput;
where: Prisma.ProofWhereInput;
orderBy?: Prisma.ProofOrderByWithRelationInput;
} = {};
} = {
where: {},
};
if (status) {
const states: string[] = status.split(',');
query.where.status = { in: states };
}
if (proofRecordId) {
query.where.proofRecordId = proofRecordId;
}
if (connectionId) {
query.where.connectionId = connectionId;
}
if (credentialDefId) {
query.where.credentialDefId = credentialDefId;
}
if (schemaId) {
query.where.schemaId = schemaId;
}
if (theirDid) {
query.where.theirDid = theirDid;
}
if (createdDateStart) {
query.where.createdDate = { gte: createdDateStart };
}
if (createdDateEnd) {
// eslint-disable-next-line prefer-object-spread
query.where.createdDate = Object.assign({}, query.where.createdDate, {
lte: createdDateEnd,
});
}
if (updatedDateStart) {
query.where.updatedDate = { gte: updatedDateStart };
}
if (updatedDateEnd) {
// eslint-disable-next-line prefer-object-spread
query.where.updatedDate = Object.assign({}, query.where.updatedDate, {
lte: updatedDateEnd,
});
}
query = { ...query, ...pagination(pageSize, page) };
return this.presentationProofRepository.findProofPresentation(query);
}
async createPresentationRequest(sendProofRequest: SendProofRequest) {
const query: Prisma.ProofCreateInput = {
presentationId: sendProofRequest.presentationId || '',
proofRecordId: sendProofRequest.proofRecordId || '',
connectionId: sendProofRequest.connectionId,
status: sendProofRequest.status,
};
......@@ -146,44 +203,24 @@ export default class PresentationProofsService {
for (let i = 0; i < sendProofRequest.attributes.length; i += 1) {
const attribute = sendProofRequest.attributes[i];
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
] = requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
] || {
const key = `${attribute.schemaId}_${attribute.credentialDefId}`;
requestedAttributes[key] = requestedAttributes[key] || {
names: [],
restrictions: [],
};
if (attribute.schemaId) {
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
].restrictions[0] =
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
].restrictions[0] || {};
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
].restrictions[0].schema_id = attribute.schemaId;
requestedAttributes[key].restrictions[0] = requestedAttributes[key].restrictions[0] || {};
requestedAttributes[key].restrictions[0].schema_id = attribute.schemaId;
}
if (attribute.credentialDefId) {
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
].restrictions[0] =
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
].restrictions[0] || {};
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
].restrictions[0].cred_def_id = attribute.credentialDefId;
requestedAttributes[key].restrictions[0] = requestedAttributes[key].restrictions[0] || {};
requestedAttributes[key].restrictions[0].cred_def_id = attribute.credentialDefId;
}
if (attribute.attributeName) {
requestedAttributes[
`${attribute.schemaId}_${attribute.credentialDefId}`
].names.push(attribute.attributeName);
requestedAttributes[key].names.push(attribute.attributeName);
}
}
......@@ -311,7 +348,7 @@ export default class PresentationProofsService {
async updatePresentationStatus(getProofRequest: GetProofRequest) {
const getRes =
await this.presentationProofRepository.updatePresentationStatus({
where: { presentationId: getProofRequest.id },
where: { proofRecordId: getProofRequest.id },
data: {
status: getProofRequest.state,
updatedDate: new Date(),
......@@ -320,10 +357,10 @@ export default class PresentationProofsService {
return getRes;
}
async acceptPresentation(presentation_id: string) {
async acceptPresentation(proof_record_id: string) {
return lastValueFrom(
this.httpService
.post(`${this.agentURL}/proofs/${presentation_id}/accept-presentation`)
.post(`${this.agentURL}/proofs/${proof_record_id}/accept-presentation`)
.pipe(map((response) => response.data)),
);
}
......@@ -336,6 +373,28 @@ export default class PresentationProofsService {
);
}
async deleteProofRequest(proofRecordId: string) {
const response = lastValueFrom(
this.httpService
.delete(`${this.agentURL}/proofs/${proofRecordId}`)
.pipe(map((response) => response.data)),
);
await this.presentationProofRepository.deleteProofRequest(proofRecordId);
return response;
}
async declineProofRequest(proofRecordId: string) {
return lastValueFrom(
this.httpService
.post(`${this.didcommUrl}/v1/agent/proofs/declineRequest`, {
data: [proofRecordId],
})
.pipe(map((response) => response.data)),
);
}
async getAllProofRequest(threadId: string) {
const url = threadId
? `${this.agentURL}/proofs/?threadId=${threadId}`
......
......@@ -10,7 +10,7 @@ datasource db {
model Proof {
id String @id @default(uuid())
presentationId String @unique @map("presentation_id")
proofRecordId String @unique @map("proof_record_id")
connectionId String @default("") @map("connection_id")
credentialDefId String @default("") @map("credential_def_id")
schemaId String @default("") @map("schema_id")
......
......@@ -29,6 +29,66 @@
"get": {
"operationId": "PresentationProofsController_findProofPresentation",
"parameters": [
{
"name": "updatedDateEnd",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "updatedDateStart",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "createdDateEnd",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "createdDateStart",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "status",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "theirDid",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "schemaId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "credentialDefId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "connectionId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "proofRecordId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "pageSize",
"required": false,
......@@ -58,7 +118,7 @@
"records": [
{
"id": "30774a7e",
"presentationId": "9b4ab922",
"proofRecordId": "9b4ab922",
"connectionId": "",
"credentialDefId": "",
"schemaId": "",
......@@ -97,12 +157,144 @@
]
}
},
"/v1/find-pending-proof-presentation": {
"get": {
"operationId": "PresentationProofsController_findPendingProofPresentation",
"parameters": [
{
"name": "updatedDateEnd",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "updatedDateStart",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "createdDateEnd",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "createdDateStart",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "status",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "theirDid",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "schemaId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "credentialDefId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "connectionId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "proofRecordId",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "pageSize",
"required": false,
"in": "query",
"schema": {}
},
{
"name": "page",
"required": false,
"in": "query",
"schema": {}
}
],
"responses": {
"200": {
"description": "Proof presentations fetched successfully",
"content": {
"application/json": {
"schema": {},
"examples": {
"Proof presentations fetched successfully": {
"value": {
"statusCode": 200,
"message": "Proof presentations fetched successfully",
"data": {
"count": 1,
"records": [
{
"id": "30774a7e",
"proofRecordId": "9b4ab922",
"connectionId": "",
"credentialDefId": "",
"schemaId": "",
"theirDid": "",
"status": "request-received",
"createdDate": "1970-01-01T00:00:00.642Z",
"updatedDate": "1970-01-01T00:00:00.642Z"
}
]
}
}
}
}
}
}
},
"404": {
"description": "No Data found",
"content": {
"application/json": {
"schema": {},
"examples": {
"No Data found": {
"value": {
"statusCode": 404,
"message": "No Data found"
}
}
}
}
}
}
},
"tags": [
"Proofs"
]
}
},
"/v1/find-by-presentation-id": {
"get": {
"operationId": "PresentationProofsController_findProofByPresentationId",
"operationId": "PresentationProofsController_findProofByProofRecordId",
"parameters": [
{
"name": "presentationId",
"name": "proofRecordId",
"required": true,
"in": "query",
"schema": {
......@@ -140,15 +332,15 @@
}
},
"400": {
"description": "Find presentation request required following attributes: ( presentationId )",
"description": "Find presentation request required following attributes: ( proofRecordId )",
"content": {
"application/json": {
"schema": {},
"examples": {
"Find presentation request required following attributes: ( presentationId )": {
"Find presentation request required following attributes: ( proofRecordId )": {
"value": {
"statusCode": 400,
"message": "Find presentation request required following attributes: ( presentationId )"
"message": "Find presentation request required following attributes: ( proofRecordId )"
}
}
}
......@@ -204,7 +396,7 @@
"message": "Presentation request sent successfully",
"data": {
"id": "a7ccc2f7",
"presentationId": "fb556018-1907-47c1-a6d6-c7cbca7d23b4",
"proofRecordId": "fb556018-1907-47c1-a6d6-c7cbca7d23b4",
"connectionId": "a9371aed-67ed-4448-ace0-d773e7b30e1c",
"credentialDefId": "",
"schemaId": "",
......@@ -221,15 +413,15 @@
}
},
"400": {
"description": "Find presentation request required following attributes: ( presentationId )",
"description": "Find presentation request required following attributes: ( proofRecordId )",
"content": {
"application/json": {
"schema": {},
"examples": {
"Find presentation request required following attributes: ( presentationId )": {
"Find presentation request required following attributes: ( proofRecordId )": {
"value": {
"statusCode": 400,
"message": "Find presentation request required following attributes: ( presentationId )"
"message": "Find presentation request required following attributes: ( proofRecordId )"
}
}
}
......@@ -269,7 +461,7 @@
"message": "Presentation request sent successfully",
"data": {
"id": "d6667caa",
"presentationId": "600dd422",
"proofRecordId": "600dd422",
"connectionId": "",
"credentialDefId": "",
"schemaId": "",
......@@ -332,7 +524,7 @@
"message": "Presentation request sent successfully",
"data": {
"id": "60f38aa4",
"presentationId": "852ee278",
"proofRecordId": "852ee278",
"connectionId": "",
"credentialDefId": "",
"schemaId": "",
......@@ -371,14 +563,14 @@
]
}
},
"/v1/accept-presentation": {
"/v1/accept-presentation/{proofRecordId}": {
"post": {
"operationId": "PresentationProofsController_acceptPresentation",
"parameters": [
{
"name": "presentationId",
"name": "proofRecordId",
"required": true,
"in": "query",
"in": "path",
"schema": {
"type": "string"
}
......@@ -399,15 +591,15 @@
}
},
"400": {
"description": "Accept presentation request required following attributes ( presentation_id )",
"description": "Accept presentation request required following attributes ( proof_record_id )",
"content": {
"application/json": {
"schema": {},
"examples": {
"Accept presentation request required following attributes ( presentation_id )": {
"Accept presentation request required following attributes ( proof_record_id )": {
"value": {
"statusCode": 400,
"message": "Accept presentation request required following attributes ( presentation_id )"
"message": "Accept presentation request required following attributes ( proof_record_id )"
}
}
}
......@@ -437,17 +629,10 @@
]
}
},
"/v1/accept-proof-request": {
"/v1/accept-proof-request/{proofRecordId}": {
"post": {
"operationId": "PresentationProofsController_acceptProofRequest",
"parameters": [
{
"name": "proofRecordId",
"required": true,
"in": "query",
"schema": {}
}
],
"parameters": [],
"responses": {
"200": {
"description": "Request accepted successfully",
......@@ -548,6 +733,172 @@
]
}
},
"/v1/delete-proof-request/{proofRecordId}": {
"post": {
"operationId": "PresentationProofsController_deleteProofRequest",
"parameters": [],
"responses": {
"200": {
"description": "Delete proof request",
"content": {
"application/json": {
"schema": {},
"examples": {
"Delete proof request": {
"value": {
"statusCode": 200,
"message": "Proof request deleted successfully",
"data": ""
}
}
}
}
}
},
"400": {
"description": "Delete proof request required following attributes ( proofRecordId )",
"content": {
"application/json": {
"schema": {},
"examples": {
"Delete proof request required following attributes ( proofRecordId )": {
"value": {
"statusCode": 400,
"timestamp": "1970-01-01T00:00:00.891Z",
"message": "Delete proof request required following attributes ( proofRecordId )"
}
}
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {},
"examples": {
"Internal Server Error": {
"value": {
"statusCode": 500,
"timestamp": "1970-01-01T00:00:00.891Z",
"message": "Something went wrong: Lorem Ipsum"
}
}
}
}
}
}
},
"tags": [
"Proofs"
]
}
},
"/v1/decline-proof-request/{proofRecordId}": {
"post": {
"operationId": "PresentationProofsController_declineProofRequest",
"parameters": [],
"responses": {
"200": {
"description": "Request declined successfully",
"content": {
"application/json": {
"schema": {},
"examples": {
"Request declined successfully": {
"value": {
"statusCode": 200,
"message": "Request declined successfully",
"data": {
"_tags": {
"threadId": "6b5c57b3",
"state": "request-received",
"connectionId": "653b8cdc"
},
"metadata": {},
"id": "19c5269f",
"createdAt": "1970-01-01T00:00:00.498Z",
"requestMessage": {
"@type": "https://didcomm.org/present-proof/1.0/request-presentation",
"@id": "6b5c57b3",
"comment": "Proof Presenation",
"request_presentations~attach": [
{
"@id": "libindy-request-presentation-0",
"mime-type": "application/json",
"data": {
"base64": "eyJuYW="
}
}
]
},
"state": "presentation-sent",
"connectionId": "653b8cdc",
"threadId": "6b5c57b3",
"presentationMessage": {
"@type": "https://didcomm.org/present-proof/1.0/presentation",
"@id": "c1089096",
"presentations~attach": [
{
"@id": "libindy-presentation-0",
"mime-type": "application/json",
"data": {
"base64": "eyJwcm9vZ"
}
}
],
"~thread": {
"thid": "6b5c57b3"
}
}
}
}
}
}
}
}
},
"400": {
"description": "Accept proof request required following attributes ( proofRecordId )",
"content": {
"application/json": {
"schema": {},
"examples": {
"Accept proof request required following attributes ( proofRecordId )": {
"value": {
"statusCode": 400,
"timestamp": "1970-01-01T00:00:00.891Z",
"message": "Accept proof request required following attributes ( proofRecordId )"
}
}
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {},
"examples": {
"Internal Server Error": {
"value": {
"statusCode": 500,
"timestamp": "1970-01-01T00:00:00.891Z",
"message": "Something went wrong: Lorem Ipsum"
}
}
}
}
}
}
},
"tags": [
"Proofs"
]
}
},
"/v1/agent-proofs": {
"get": {
"operationId": "PresentationProofsController_getAllProofRequest",
......@@ -654,6 +1005,29 @@
"Proofs"
]
}
},
"/v1/url/{id}": {
"get": {
"operationId": "PresentationProofsController_redirectToOriginalUrl",
"parameters": [
{
"name": "id",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"Proofs"
]
}
}
},
"info": {
......@@ -663,11 +1037,7 @@
"contact": {}
},
"tags": [],
"servers": [
{
"url": "localhost:3007"
}
],
"servers": [],
"components": {
"schemas": {
"SendProofRequest": {
......@@ -738,4 +1108,4 @@
}
}
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment