Skip to content

Commit

Permalink
fix: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheworris committed Sep 16, 2024
1 parent 8d5ce65 commit 1b1919e
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class DelegationControllerV1 {
@Get(':msaId')
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Get the delegation information associated with an MSA Id' })
@ApiOkResponse({ description: 'Found delegation information' })
@ApiOkResponse({ description: 'Found delegation information', type: DelegationResponse })
/**
* Retrieves the delegation for a given MSA ID.
*
Expand All @@ -54,7 +54,10 @@ export class DelegationControllerV1 {
@Get('revokeDelegation/:accountId/:providerId')
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Get a properly encoded RevokeDelegationPayload that can be signed' })
@ApiOkResponse({ description: 'Returned an encoded RevokeDelegationPayload for signing' })
@ApiOkResponse({
description: 'Returned an encoded RevokeDelegationPayload for signing',
type: RevokeDelegationPayloadResponseDto,
})
/**
* Retrieves the revoke delegation payload for a given provider ID.
* This encoded payload can be signed by the user to revoke the delegation to the given provider id.
Expand Down Expand Up @@ -83,7 +86,7 @@ export class DelegationControllerV1 {
@Post('revokeDelegation')
@HttpCode(HttpStatus.CREATED)
@ApiOperation({ summary: 'Request to revoke a delegation' })
@ApiCreatedResponse({ description: 'Created and queued request to revoke a delegation' })
@ApiCreatedResponse({ description: 'Created and queued request to revoke a delegation', type: TransactionResponse })
@ApiBody({ type: RevokeDelegationPayloadRequestDto })
async postRevokeDelegation(
@Body()
Expand Down
1 change: 0 additions & 1 deletion apps/account-api/test/setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "index.ts",
"scripts": {
"main": "tsx index.ts",
"test-revoke": "tsx test-revoke.ts",
"test-revoke-e2e": "tsx test-revoke-e2e.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
150 changes: 0 additions & 150 deletions apps/account-api/test/setup/test-revoke.ts

This file was deleted.

13 changes: 5 additions & 8 deletions docker-compose-e2e.account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@ services:
- e2e

frequency:
image: dsnp/instant-seal-node-with-deployed-schemas:latest
# We need to specify the platform because it's the only image
# built by Frequency at the moment, and auto-pull won't work otherwise
platform: linux/amd64
# SEALING_MODE set to insstant for e2e testing
environment:
- SEALING_MODE=interval
- SEALING_INTERVAL=1
profiles:
- e2e
- local-node

mock-webhook-server:
profiles:
- skip

ipfs:
profiles:
Expand Down
3 changes: 0 additions & 3 deletions libs/account-lib/src/blockchain/blockchain-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export namespace BlockchainConstants {

export const SECONDS_PER_BLOCK = 12;

// Default expiration time for a block, same as SIWF
export const BLOCK_EXPIRATION_SECS = 10 * 60; // 10 minutes

/**
* The number of blocks to crawl for a given job
* @type {number}
Expand Down
80 changes: 77 additions & 3 deletions openapi-specs/account.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@
],
"responses": {
"200": {
"description": "Found delegation information"
"description": "Found delegation information",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DelegationResponse"
}
}
}
}
},
"tags": [
Expand Down Expand Up @@ -163,7 +170,14 @@
],
"responses": {
"200": {
"description": "Returned an encoded RevokeDelegationPayload for signing"
"description": "Returned an encoded RevokeDelegationPayload for signing",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RevokeDelegationPayloadResponseDto"
}
}
}
}
},
"tags": [
Expand All @@ -188,7 +202,14 @@
},
"responses": {
"201": {
"description": "Created and queued request to revoke a delegation"
"description": "Created and queued request to revoke a delegation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TransactionResponse"
}
}
}
}
},
"tags": [
Expand Down Expand Up @@ -622,6 +643,48 @@
"referenceId"
]
},
"DelegationResponse": {
"type": "object",
"properties": {
"providerId": {
"type": "string"
},
"schemaPermissions": {
"type": "object"
},
"revokedAt": {
"type": "object"
}
},
"required": [
"providerId",
"schemaPermissions",
"revokedAt"
]
},
"RevokeDelegationPayloadResponseDto": {
"type": "object",
"properties": {
"accountId": {
"type": "string"
},
"providerId": {
"type": "string"
},
"encodedExtrinsic": {
"type": "object"
},
"payloadToSign": {
"type": "object"
}
},
"required": [
"accountId",
"providerId",
"encodedExtrinsic",
"payloadToSign"
]
},
"RevokeDelegationPayloadRequestDto": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -649,6 +712,17 @@
"signature"
]
},
"TransactionResponse": {
"type": "object",
"properties": {
"referenceId": {
"type": "string"
}
},
"required": [
"referenceId"
]
},
"HandlePayloadDto": {
"type": "object",
"properties": {
Expand Down

0 comments on commit 1b1919e

Please sign in to comment.