diff --git a/src/app-auth/app-auth.module.ts b/src/app-auth/app-auth.module.ts deleted file mode 100644 index d598aac4..00000000 --- a/src/app-auth/app-auth.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { JwtModule } from '@nestjs/jwt'; -import { JwtStrategy } from './strategy/jwt.strategy'; -@Module({ - imports: [JwtModule.register({})], - providers: [JwtStrategy], - controllers: [], - - exports: [AppAuthModule], -}) -export class AppAuthModule {} diff --git a/src/credential/credential.module.ts b/src/credential/credential.module.ts index fe2c5044..5cc59bfc 100644 --- a/src/credential/credential.module.ts +++ b/src/credential/credential.module.ts @@ -6,8 +6,6 @@ import { } from '@nestjs/common'; import { CredentialService } from './services/credential.service'; import { CredentialController } from './controllers/credential.controller'; -import { MongooseModule } from '@nestjs/mongoose'; -import { Credential, CredentialSchema } from './schemas/credntial.schema'; import { CredentialSSIService } from './services/credential.ssi.service'; import { EdvModule } from 'src/edv/edv.module'; import { HidWalletModule } from 'src/hid-wallet/hid-wallet.module'; @@ -18,10 +16,9 @@ import { WhitelistSSICorsMiddleware } from 'src/utils/middleware/cors.middleware import { TrimMiddleware } from 'src/utils/middleware/trim.middleware'; import { credentialProviders } from './providers/credential.provider'; import { databaseProviders } from '../mongoose/tenant-mongoose-connections'; -import { AppAuthModule } from 'src/app-auth/app-auth.module'; @Module({ - imports: [EdvModule, HidWalletModule, DidModule, AppAuthModule], + imports: [EdvModule, HidWalletModule, DidModule], controllers: [CredentialController], providers: [ CredentialService, diff --git a/src/credential/dto/create-credential.dto.ts b/src/credential/dto/create-credential.dto.ts index b32f76dc..6e8a82dc 100644 --- a/src/credential/dto/create-credential.dto.ts +++ b/src/credential/dto/create-credential.dto.ts @@ -16,6 +16,7 @@ import { ValidateVerificationMethodId } from 'src/utils/customDecorator/vmId.dec import { IsDid } from 'src/utils/customDecorator/did.decorator'; import { IsSchemaId } from 'src/utils/customDecorator/schemaId.deceorator'; import { IsVcId } from 'src/utils/customDecorator/vc.decorator'; +import { subjectDID } from 'src/utils/customDecorator/SubjectDid.decorator'; export enum Namespace { testnet = 'testnet', @@ -36,7 +37,7 @@ export class CreateCredentialDto { }) @IsString() @IsNotEmpty() - @IsDid() + @subjectDID() subjectDid: string; @ApiProperty({ name: 'issuerDid', diff --git a/src/credential/services/credential.service.ts b/src/credential/services/credential.service.ts index 0f6dd27c..2cc0abc1 100644 --- a/src/credential/services/credential.service.ts +++ b/src/credential/services/credential.service.ts @@ -14,10 +14,7 @@ import { DidRepository } from 'src/did/repository/did.repository'; import { HypersignDID, HypersignVerifiableCredential } from 'hs-ssi-sdk'; import { VerifyCredentialDto } from '../dto/verify-credential.dto'; import { RegisterCredentialStatusDto } from '../dto/register-credential.dto'; -import { - getAppVault, - getAppMenemonic, -} from 'src/app-auth/services/app-vault.service'; +import { getAppVault, getAppMenemonic } from '../../utils/app-vault-service'; @Injectable() export class CredentialService { diff --git a/src/did/controllers/did.controller.ts b/src/did/controllers/did.controller.ts index 859ddd93..01778391 100644 --- a/src/did/controllers/did.controller.ts +++ b/src/did/controllers/did.controller.ts @@ -50,7 +50,6 @@ import { RegisterDidDto } from '../dto/register-did.dto'; import { IKeyType } from 'hs-ssi-sdk'; import { AtLeastOneParamPipe } from 'src/utils/Pipes/atleastOneParam.pipe'; import { AddVMResponse, AddVerificationMethodDto } from '../dto/addVm.dto'; - @UseFilters(AllExceptionsFilter) @ApiTags('Did') @Controller('did') diff --git a/src/did/did.module.ts b/src/did/did.module.ts index cc047b19..f029853b 100644 --- a/src/did/did.module.ts +++ b/src/did/did.module.ts @@ -22,11 +22,12 @@ import { WhitelistSSICorsMiddleware } from 'src/utils/middleware/cors.middleware import { TrimMiddleware } from 'src/utils/middleware/trim.middleware'; import { databaseProviders } from '../mongoose/tenant-mongoose-connections'; import { didProviders } from './providers/did.provider'; -import { AppAuthModule } from 'src/app-auth/app-auth.module'; +import { JwtStrategy } from '../utils/jwt.strategy'; @Module({ - imports: [EdvModule, HidWalletModule, AppAuthModule], + imports: [EdvModule, HidWalletModule], controllers: [DidController], providers: [ + JwtStrategy, DidService, DidRepository, DidMetaDataRepo, diff --git a/src/did/dto/register-did.dto.ts b/src/did/dto/register-did.dto.ts index 02281847..d5eae342 100644 --- a/src/did/dto/register-did.dto.ts +++ b/src/did/dto/register-did.dto.ts @@ -95,26 +95,26 @@ export class RegisterDidDto { }) // this is to validate if did is generated using empty namespace verificationMethodId?: string; - // @ApiProperty({ - // description: "IClientSpec 'eth-personalSign' or 'cosmos-ADR036'", - // example: 'eth-personalSign', - // name: 'clientSpec', - // required: false, - // }) - // @IsOptional() - // @IsEnum(IClientSpec) - // clientSpec?: IClientSpec; + @ApiProperty({ + description: "IClientSpec 'eth-personalSign' or 'cosmos-ADR036'", + example: 'eth-personalSign', + name: 'clientSpec', + required: false, + }) + @IsOptional() + @IsEnum(IClientSpec) + clientSpec?: IClientSpec | undefined; - // @ApiProperty({ - // description: 'Signature for clientSpec', - // example: 'afafljagahgp9agjagknaglkj/kagka=', - // name: 'signature', - // required: false, - // }) - // @ValidateIf((o, value) => o.clientSpec !== undefined) - // @IsNotEmpty() - // @IsString() - // signature?: string; + @ApiProperty({ + description: 'Signature for clientSpec', + example: 'afafljagahgp9agjagknaglkj/kagka=', + name: 'signature', + required: false, + }) + @ValidateIf((o, value) => o.clientSpec !== undefined) + @IsNotEmpty() + @IsString() + signature?: string; @ApiProperty({ description: 'Sign Info', diff --git a/src/did/services/did.service.ts b/src/did/services/did.service.ts index 3d66531e..550c9330 100644 --- a/src/did/services/did.service.ts +++ b/src/did/services/did.service.ts @@ -28,10 +28,7 @@ import { RegistrationStatus } from '../schemas/did.schema'; import { RegisterDidDto } from '../dto/register-did.dto'; import { Did as IDidDto } from '../schemas/did.schema'; import { AddVerificationMethodDto } from '../dto/addVm.dto'; -import { - getAppVault, - getAppMenemonic, -} from 'src/app-auth/services/app-vault.service'; +import { getAppVault, getAppMenemonic } from '../../utils/app-vault-service'; import { ConfigService } from '@nestjs/config'; @Injectable({ scope: Scope.REQUEST }) @@ -47,7 +44,6 @@ export class DidService { // TODO: need to fix this once ed25519 is finished. async createByClientSpec(createDidDto: CreateDidDto, appDetail) { Logger.log('createByClientSpec() method: starts....', 'DidService'); - let methodSpecificId = createDidDto.methodSpecificId; const publicKey = createDidDto.options?.publicKey; const chainId = createDidDto.options.chainId; @@ -159,7 +155,7 @@ export class DidService { createDidDto: CreateDidDto, appDetail, ): Promise { - Logger.log('createByClientSpec() method: starts....', 'DidService'); + Logger.log('create() method: starts....', 'DidService'); try { const methodSpecificId = createDidDto.methodSpecificId; @@ -297,7 +293,6 @@ export class DidService { const didData = await this.didRepositiory.findOne({ did: didDocument['id'], }); - if (!didData) { throw new NotFoundException([didDocument['id'] + ' not found']); } diff --git a/src/main.ts b/src/main.ts index 9056d488..605e019a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -8,7 +8,7 @@ import * as path from 'path'; import * as express from 'express'; // eslint-disable-next-line const hidWallet = require('hid-hd-wallet'); -import { Bip39, EnglishMnemonic } from '@cosmjs/crypto'; +import { EnglishMnemonic } from '@cosmjs/crypto'; import { Logger } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { EdvClientKeysManager } from './edv/services/edv.singleton'; diff --git a/src/presentation/presentation.module.ts b/src/presentation/presentation.module.ts index 4b965f79..0c9b52f1 100644 --- a/src/presentation/presentation.module.ts +++ b/src/presentation/presentation.module.ts @@ -20,14 +20,13 @@ import { MongooseModule } from '@nestjs/mongoose'; import { PresentationTemplateRepository } from './repository/presentation-template.repository'; import { HidWalletService } from 'src/hid-wallet/services/hid-wallet.service'; import { DidModule } from 'src/did/did.module'; -import { AppAuthModule } from 'src/app-auth/app-auth.module'; import { WhitelistSSICorsMiddleware } from 'src/utils/middleware/cors.middleware'; import { TrimMiddleware } from 'src/utils/middleware/trim.middleware'; import { presentationTemplateProviders } from './providers/presentation.provider'; import { databaseProviders } from '../mongoose/tenant-mongoose-connections'; @Module({ - imports: [DidModule, AppAuthModule], + imports: [DidModule], controllers: [PresentationTempleteController, PresentationController], providers: [ PresentationService, diff --git a/src/presentation/services/presentation.service.ts b/src/presentation/services/presentation.service.ts index 32531b26..eb785a9a 100644 --- a/src/presentation/services/presentation.service.ts +++ b/src/presentation/services/presentation.service.ts @@ -22,7 +22,7 @@ import { ConfigService } from '@nestjs/config'; import { HidWalletService } from 'src/hid-wallet/services/hid-wallet.service'; import { DidRepository } from 'src/did/repository/did.repository'; import { VerifyPresentationDto } from '../dto/verify-presentation.dto'; -import { getAppVault } from 'src/app-auth/services/app-vault.service'; +import { getAppVault } from '../../utils/app-vault-service'; import { generateAppId } from 'src/utils/utils'; @Injectable() export class PresentationService { diff --git a/src/schema/schema.module.ts b/src/schema/schema.module.ts index 9ee9c88e..abaecc11 100644 --- a/src/schema/schema.module.ts +++ b/src/schema/schema.module.ts @@ -12,13 +12,12 @@ import { DidService } from 'src/did/services/did.service'; import { DidModule } from 'src/did/did.module'; import { SchemaRepository } from './repository/schema.repository'; import { WhitelistSSICorsMiddleware } from 'src/utils/middleware/cors.middleware'; -import { AppAuthModule } from 'src/app-auth/app-auth.module'; import { TrimMiddleware } from 'src/utils/middleware/trim.middleware'; import { schemaProviders } from './providers/schema.provider'; import { databaseProviders } from '../mongoose/tenant-mongoose-connections'; @Module({ - imports: [DidModule, AppAuthModule], + imports: [DidModule], controllers: [SchemaController], providers: [ SchemaService, diff --git a/src/schema/services/schema.service.ts b/src/schema/services/schema.service.ts index 4eac0dbd..dddb138d 100644 --- a/src/schema/services/schema.service.ts +++ b/src/schema/services/schema.service.ts @@ -19,10 +19,7 @@ import { SchemaRepository } from '../repository/schema.repository'; import { Schemas } from '../schemas/schemas.schema'; import { RegisterSchemaDto } from '../dto/register-schema.dto'; import { Namespace } from 'src/did/dto/create-did.dto'; -import { - getAppVault, - getAppMenemonic, -} from 'src/app-auth/services/app-vault.service'; +import { getAppVault, getAppMenemonic } from '../../utils/app-vault-service'; @Injectable({ scope: Scope.REQUEST }) export class SchemaService { diff --git a/src/app-auth/services/app-vault.service.ts b/src/utils/app-vault-service.ts similarity index 79% rename from src/app-auth/services/app-vault.service.ts rename to src/utils/app-vault-service.ts index 8c25658e..bae8d127 100644 --- a/src/app-auth/services/app-vault.service.ts +++ b/src/utils/app-vault-service.ts @@ -1,6 +1,6 @@ import { Logger } from '@nestjs/common'; -import { VaultWalletManager } from '../../edv/services/vaultWalletManager'; -import { EdvClientManagerFactoryService } from '../../edv/services/edv.clientFactory'; +import { VaultWalletManager } from '../edv/services/vaultWalletManager'; +import { EdvClientManagerFactoryService } from '../edv/services/edv.clientFactory'; export async function getAppVault(kmsId, edvId) { Logger.log('Inside getAppVault()', 'getAppVault'); diff --git a/src/utils/customDecorator/SubjectDid.decorator.ts b/src/utils/customDecorator/SubjectDid.decorator.ts new file mode 100644 index 00000000..bd143ff3 --- /dev/null +++ b/src/utils/customDecorator/SubjectDid.decorator.ts @@ -0,0 +1,38 @@ +import { + applyDecorators, + SetMetadata, + BadRequestException, +} from '@nestjs/common'; + +export const subjectDID = (): PropertyDecorator => { + return applyDecorators( + SetMetadata('isDid', true), + (target: object, propertyKey: string | symbol) => { + let original = target[propertyKey]; + const descriptor: PropertyDescriptor = { + get: () => original, + set: (val: any) => { + if (val.trim() === '') { + throw new BadRequestException([ + `${propertyKey.toString()} cannot be empty`, + ]); + } + + const did = val; + if (!did.includes('did:')) { + throw new BadRequestException([ + `Invalid ${propertyKey.toString()}`, + ]); + } + if (did.includes('.')) { + throw new BadRequestException([ + `Invalid ${propertyKey.toString()}`, + ]); + } + original = val; + }, + }; + Object.defineProperty(target, propertyKey, descriptor); + }, + ); +}; diff --git a/src/app-auth/strategy/jwt.strategy.ts b/src/utils/jwt.strategy.ts similarity index 100% rename from src/app-auth/strategy/jwt.strategy.ts rename to src/utils/jwt.strategy.ts diff --git a/src/utils/middleware/cors.middleware.ts b/src/utils/middleware/cors.middleware.ts index 61c18920..0b64b4d6 100644 --- a/src/utils/middleware/cors.middleware.ts +++ b/src/utils/middleware/cors.middleware.ts @@ -15,7 +15,14 @@ export class WhitelistSSICorsMiddleware implements NestMiddleware { 'WhitelistSSICorsMiddleware: checking if call is form whitelisted domain starts', 'Middleware', ); - const origin = req.header('Origin') || req.header('Referer'); + let referer = req.header('Referer'); + + // Extract the origin + if (referer) { + const referalUrl = new URL(referer); + referer = `${referalUrl.protocol}//${referalUrl.host}`; + } + const origin = req.header('Origin') || referer; Logger.debug( `WhitelistSSICorsMiddleware: request is comming from ${origin}`, @@ -44,7 +51,14 @@ export class WhitelistSSICorsMiddleware implements NestMiddleware { ]); } else if (req.header('authorization')) { const token = req.header('authorization').split(' ')[1]; - const decoded = jwt.verify(token, process.env.JWT_SECRET); + let decoded; + try { + decoded = jwt.verify(token, process.env.JWT_SECRET); + } catch (e) { + Logger.error(`WhitelistSSICorsMiddleware: Error ${e}`, 'Middleware'); + + throw new UnauthorizedException([e]); + } type App = { appId?: string; @@ -83,7 +97,6 @@ export class WhitelistSSICorsMiddleware implements NestMiddleware { if (appInfo.subdomain != subdomain) { throw new UnauthorizedException(['Invalid subdomain']); } - if (!appInfo.whitelistedCors.includes('*')) { if (!appInfo['whitelistedCors'].includes(origin)) { throw new UnauthorizedException(['Origin mismatch']); diff --git a/src/utils/session/session.serializer.ts b/src/utils/session/session.serializer.ts deleted file mode 100644 index 2d3bc6c2..00000000 --- a/src/utils/session/session.serializer.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { PassportSerializer } from '@nestjs/passport'; - -export class SessionSerializer extends PassportSerializer { - // Not doing much here - serializeUser(user: any, done: (a, b) => void) { - done(null, user); - } - - // Not doing much here - deserializeUser(payload: any, done: (a, b) => void) { - done(null, payload); - } -} diff --git a/studio-api.postman_collection.json b/studio-api.postman_collection.json index 944807d9..df0c62ef 100644 --- a/studio-api.postman_collection.json +++ b/studio-api.postman_collection.json @@ -1,37462 +1,38775 @@ { - "info": { - "_postman_id": "a5e2ac68-5f89-48ee-b443-387b211ecad0", - "name": "new-studio-api", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "13310082" - }, - "item": [ - { - "name": "auth", - "item": [ - { - "name": "register an app", - "item": [ - { - "name": "empty appName", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as appName passed in request body is empty or less than 5 characters\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"appName must be longer than or equal to 5 characters\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\" \",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"http://localhost:3001/\",\"*\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "response": [ - { - "name": "empty appName", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"t\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"http://localhost:3001\",\"*\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "107" - }, - { - "key": "ETag", - "value": "W/\"6b-l3cp1ELZZGZeH+lVSaV8ci9aStE\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 19:09:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"appName must be longer than or equal to 5 characters\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "wrong url", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as whitelistedCors passed in request body has invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Whitelisted cors must be a valid url or *\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"demo test5\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"cbbnn\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "response": [ - { - "name": "wrong url", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"demo test5\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"cbbnn\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "96" - }, - { - "key": "ETag", - "value": "W/\"60-RIqEfmO9wLXmpLC3xLB66TKCj7s\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 19:12:56 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Whitelisted cors must be a valid url or *\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "wrong logoUrl", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as logoUrl passed in request body is invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"logoUrl is not a valid URL\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"Demo test app\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"http://localhost:3001\",\"*\"],\n \"logoUrl\": \"xklvc\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "response": [ - { - "name": "empty appName", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"t\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"http://localhost:3001\",\"*\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "107" - }, - { - "key": "ETag", - "value": "W/\"6b-l3cp1ELZZGZeH+lVSaV8ci9aStE\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 19:09:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"appName must be longer than or equal to 5 characters\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "register app", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and have list of response body parameters\", function () {", - " pm.expect(\"appId\" in responseBody).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"appName\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"apiKeySecret\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"edvId\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"walletAddress\")).to.be.true;", - " console.log(responseBody.walletAddress)", - " pm.expect(responseBody.hasOwnProperty(\"description\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"whitelistedCors\")).to.be.true;", - " pm.expect(responseBody.whitelistedCors).to.be.an(\"array\");", - " pm.expect(\"logoUrl\" in responseBody).to.be.true", - " pm.environment.set(\"appId\", responseBody.appId)", - " pm.environment.set(\"X-Api-Secret-Key\", responseBody.apiKeySecret)", - " pm.environment.set(\"methodSpecificId\",responseBody.walletAddress)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"Demo test app\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"http://localhost:3001\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "response": [ - { - "name": "register app", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"Demo test app\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"http://localhost:3001\",\"*\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "465" - }, - { - "key": "ETag", - "value": "W/\"1d1-fwhc6zsAmONTd9g9sDm4okUmuRc\"" - }, - { - "key": "Date", - "value": "Mon, 13 Feb 2023 16:04:55 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appName\": \"Demo test app\",\n \"appId\": \"1680f6987fedcbdaec67274d0d5644eb20d9\",\n \"apiKeySecret\": \"3b603dec1d6d7831c0ab104ef987a.75d79d22216bf13ca38cddf7bd05672dfaf8aefa2d485f92f770860af34515065fbcdaf5145ba07bbf028dbb1d79688b2\",\n \"edvId\": \"hs:apiservice:edv:49538f61-aaed-43ee-be94-d2be5a1e4e8e\",\n \"walletAddress\": \"hid18tzg64ur6t60denq4p0vyzvwt64ghuh8ck9rxx\",\n \"description\": \"This is a test description\",\n \"whitelistedCors\": [\n \"http://localhost:3001\",\n \"*\"\n ],\n \"logoUrl\": \"http://image.png\"\n}" - } - ] - } - ] - }, - { - "name": "get AppById", - "item": [ - { - "name": "wrong appId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as appId passed in request params is wrong\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"Application Not Found\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app/xyz", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["xyz"] - } - }, - "response": [ - { - "name": "wrong appId", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app/xyz", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["xyz"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "76" - }, - { - "key": "ETag", - "value": "W/\"4c-NO7lw8kkSNMmXa9I2zOR3gKFPz8\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 19:20:43 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"message\": [\n \"Application Not Found\"\n ],\n \"statusCode\": 400,\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "fetch app by id", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and have list of response body parameters\", function () {", - " pm.expect(\"appId\" in responseBody).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"appName\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"edvId\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"walletAddress\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"description\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"whitelistedCors\")).to.be.true;", - " pm.expect(\"logoUrl\" in responseBody).to.be.true", - " var appId = pm.environment.get('appId')", - " pm.expect(responseBody.appId).to.eql(appId)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "response": [ - { - "name": "fetch app by id", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "320" - }, - { - "key": "ETag", - "value": "W/\"140-kPY/GScSqDtvzM4VTtXtriBRi18\"" - }, - { - "key": "Date", - "value": "Mon, 13 Feb 2023 16:05:14 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appName\": \"Demo test app\",\n \"appId\": \"1680f6987fedcbdaec67274d0d5644eb20d9\",\n \"edvId\": \"hs:apiservice:edv:49538f61-aaed-43ee-be94-d2be5a1e4e8e\",\n \"walletAddress\": \"hid18tzg64ur6t60denq4p0vyzvwt64ghuh8ck9rxx\",\n \"description\": \"This is a test description\",\n \"whitelistedCors\": [\n \"http://localhost:3001\",\n \"*\"\n ],\n \"logoUrl\": \"http://image.png\"\n}" - } - ] - } - ] - }, - { - "name": "app list", - "item": [ - { - "name": "negative limit", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail limit is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app?limit=-1", - "host": ["{{studio-api-baseUrl}}app"], - "query": [ - { - "key": "page", - "value": "2", - "disabled": true - }, - { - "key": "limit", - "value": "20", - "disabled": true - }, - { - "key": "limit", - "value": "-1" - } - ] - } - }, - "response": [ - { - "name": "negative limit", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}app?limit=-1", - "host": ["{{studio-api-baseUrl}}app"], - "query": [ - { - "key": "page", - "value": "2", - "disabled": true - }, - { - "key": "limit", - "value": "20", - "disabled": true - }, - { - "key": "limit", - "value": "-1" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "84" - }, - { - "key": "ETag", - "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 19:24:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "negative page value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail page is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app?page=-1", - "host": ["{{studio-api-baseUrl}}app"], - "query": [ - { - "key": "page", - "value": "2", - "disabled": true - }, - { - "key": "limit", - "value": "20", - "disabled": true - }, - { - "key": "page", - "value": "-1" - } - ] - } - }, - "response": [ - { - "name": "negative page value", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}app?page=-1", - "host": ["{{studio-api-baseUrl}}app"], - "query": [ - { - "key": "page", - "value": "2", - "disabled": true - }, - { - "key": "limit", - "value": "20", - "disabled": true - }, - { - "key": "page", - "value": "-1" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 19:27:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "fetch list of apps", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var page;", - "var limit;", - "var urlString = pm.request.url.toString();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "", - "pm.test(\"Should be able to pass and have list of apps in response body \", function () {", - " try {", - " page = urlString.match(/page=(\\d+)/)[1];", - " page = (parseInt(page))", - " } catch (e) {", - " page = 1", - " }", - " try {", - " limit = urlString.match(/limit=(\\d+)/)[1];", - " limit = parseInt(limit)", - " } catch (e) {", - " limit = 10", - " }", - " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", - " pm.expect(responseBody.totalCount).to.be.a('number')", - " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", - " pm.expect(responseBody.data).to.be.an(\"array\");", - " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app?limit=30", - "host": ["{{studio-api-baseUrl}}app"], - "query": [ - { - "key": "page", - "value": "2", - "disabled": true - }, - { - "key": "limit", - "value": "20", - "disabled": true - }, - { - "key": "limit", - "value": "30" - } - ] - } - }, - "response": [ - { - "name": "fetch list of apps", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "3097" - }, - { - "key": "ETag", - "value": "W/\"c19-I0W7vQRKezGkg8ueA6NCjsfrg1k\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 04:19:17 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"totalCount\": 42,\n \"data\": [\n {\n \"appName\": \"demo app12\",\n \"appId\": \"de32578af790ab423d3f832575fbc25d2934\",\n \"edvId\": \"hs:apiservice:edv:eb93fa60-cd2a-4b36-895e-c82b6aa3015e\",\n \"walletAddress\": \"hid1szzjun8yla2h4lsm3gqm0pxx7rh340lhwvv692\",\n \"description\": \"Example description\",\n \"whitelistedCors\": [\n \"https://example.com\",\n \"*\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"demo app\",\n \"appId\": \"3e2fde0ec62f4b12ae9954bce8b5e811d010\",\n \"edvId\": \"hs:apiservice:edv:a00388f9-ec45-4d29-b58d-0363bed230e5\",\n \"walletAddress\": \"hid1sm2n6jer5lh9pyhq97fafzfpe2vxs4csnwg0ur\",\n \"description\": \"Example description\",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"demo app\",\n \"appId\": \"d875e07511decdf939ea0f618ad4071c213d\",\n \"edvId\": \"hs:apiservice:edv:1112b351-74c2-4644-a285-ee029f95340f\",\n \"walletAddress\": \"hid1pe5mx3dqr8wfh69mmx0nfx6vzfc7vlr2ztnyz7\",\n \"description\": \"Example description\",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"demo app\",\n \"appId\": \"ecea869c7c4f3c2493c6ae41dad7cb0a3f34\",\n \"edvId\": \"hs:apiservice:edv:2d36d2b7-100b-48fe-8089-88e3e259ae0b\",\n \"walletAddress\": \"hid1hdvg3qkz45t57jezjh9zf590wxwxk9dexhlw89\",\n \"description\": \"Example description\",\n \"whitelistedCors\": [],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"trim testing\",\n \"appId\": \"f9923ece9b572f46a34a8021b258095bc886\",\n \"edvId\": \"hs:apiservice:edv:03a2d04a-0987-4340-968e-96e32771f7ee\",\n \"walletAddress\": \"hid1h6hlwjqqhc657kkucscrflmr0fd39zdgak08sa\",\n \"description\": \"Example description \",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"trim testing\",\n \"appId\": \"a8718bc9cd5263a0639742cf5a0e86436761\",\n \"edvId\": \"hs:apiservice:edv:e2bc5ad6-0eff-482a-baed-194d75b61dde\",\n \"walletAddress\": \"hid1z55wustlzqqqwradleyxmdln7vmyaw0lllh97y\",\n \"description\": \"Example description \",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"trim testing\",\n \"appId\": \"9e58fd0a6d5ae9d0babb013de9b54ae7d9e6\",\n \"edvId\": \"hs:apiservice:edv:132d4c8d-91c7-486c-b20d-fe5ded8a17e9\",\n \"walletAddress\": \"hid1s7gttg5pewylaq7r8a02nyw8ad9z6rgc5d2rkf\",\n \"description\": \"Example description \",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"trim testing\",\n \"appId\": \"ceb5258eb17ac41553dd667322b53c42d3a8\",\n \"edvId\": \"hs:apiservice:edv:7a2179c1-31e0-451d-b660-73802ec96f3c\",\n \"walletAddress\": \"hid16q55ac3pm0u39ycutmv9zzwh7pa0aqg8nnvffn\",\n \"description\": \"Example description \",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"trim testing\",\n \"appId\": \"817691d33b455d5b7e28fa37d56fec77dee2\",\n \"edvId\": \"hs:apiservice:edv:9169989e-4fe0-4e44-8c13-966bd3b676ee\",\n \"walletAddress\": \"hid13p6x29f0hnpcqx56r6qh0cduaht0r8u0hf05js\",\n \"description\": \"Example description \",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n },\n {\n \"appName\": \"trim testing 1\",\n \"appId\": \"643156c48d2a402fa3bff7966b0a48f1a804\",\n \"edvId\": \"hs:apiservice:edv:8a78949c-2d30-424d-836f-22662872f7ff\",\n \"walletAddress\": \"hid10j0fv80wrl65yhnjd6k43txfst6smnqnqwye8p\",\n \"description\": \"Example description\",\n \"whitelistedCors\": [\n \"https://example.com\"\n ],\n \"logoUrl\": \"http://image.png\"\n }\n ]\n}" - } - ] - } - ] - }, - { - "name": "edit app", - "item": [ - { - "name": "empty app name", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update app as appName passed in request body is empty or less than 5 characters\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"appName must be longer than or equal to 5 characters\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "PUT", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "response": [ - { - "name": "empty app name", - "originalRequest": { - "method": "PUT", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "137" - }, - { - "key": "ETag", - "value": "W/\"89-VRbmctkEKA1C5x/hoHoMRDWyMIA\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 04:20:26 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"appName must be longer than or equal to 5 characters\",\n \"appName should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "wrong url in whitelistedCors", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update app as whitelistedCors passed in request body has invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Whitelisted cors must be a valid url or *\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "PUT", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"demo test5\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"cbbnn\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "response": [ - { - "name": "wrong url in whitelistedCors", - "originalRequest": { - "method": "PUT", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"demo test5\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"cbbnn\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "96" - }, - { - "key": "ETag", - "value": "W/\"60-RIqEfmO9wLXmpLC3xLB66TKCj7s\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 04:24:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Whitelisted cors must be a valid url or *\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "wrong logoUrl", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update app as logoUrl passed in request body has invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"logoUrl is not a valid URL\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "PUT", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"Demo test app\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"http://localhost:3001\",\"*\"],\n \"logoUrl\": \"xklvc\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/xyb", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["xyb"] - } - }, - "response": [ - { - "name": "wrong logoUrl", - "originalRequest": { - "method": "PUT", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"demo test5\",\n \"description\":\"This is a test description\",\n \"whitelistedCors\":[\"cbbnn\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "96" - }, - { - "key": "ETag", - "value": "W/\"60-RIqEfmO9wLXmpLC3xLB66TKCj7s\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 04:27:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Whitelisted cors must be a valid url or *\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "edit app", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and have list of response body parameters\", function () {", - " pm.expect(\"appId\" in responseBody).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"appName\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"edvId\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"walletAddress\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"description\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"whitelistedCors\")).to.be.true;", - " pm.expect(\"logoUrl\" in responseBody).to.be.true", - " pm.environment.set('walletAddress',responseBody.walletAddress)", - "var appId= pm.environment.get('appId')", - "pm.expect(responseBody.appId).to.eql(appId)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "PUT", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"testing api app\",\n \"whitelistedCors\":[\"http://localhost:3001\"]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "response": [ - { - "name": "edit app", - "originalRequest": { - "method": "PUT", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"testing api app\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "322" - }, - { - "key": "ETag", - "value": "W/\"142-iVj84c2VcYZq1q8nvW/6HLH46Jw\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 06:43:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appName\": \"testing api app\",\n \"appId\": \"1680f6987fedcbdaec67274d0d5644eb20d9\",\n \"edvId\": \"hs:apiservice:edv:49538f61-aaed-43ee-be94-d2be5a1e4e8e\",\n \"walletAddress\": \"hid18tzg64ur6t60denq4p0vyzvwt64ghuh8ck9rxx\",\n \"description\": \"This is a test description\",\n \"whitelistedCors\": [\n \"http://localhost:3001\",\n \"*\"\n ],\n \"logoUrl\": \"http://image.png\"\n}" - } - ] - } - ] - }, - { - "name": "generate new api secret", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as authorization token is not passed in header\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an('array');", - " pm.expect(responseBody.message[0]).to.be.equal(\"Authorization token is missing in header\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.an(\"string\");", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}", "secret", "new"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}", "secret", "new"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "96" - }, - { - "key": "ETag", - "value": "W/\"60-D90qYeQuLLlEToGmwCAcyMsZg0o\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 07:51:10 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Authorization token is missing in header\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not passed in header\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"This is CORS-enabled for a whitelisted domain.\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}", "secret", "new"] - } - }, - "response": [ - { - "name": "origin not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}", "secret", "new"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "102" - }, - { - "key": "ETag", - "value": "W/\"66-r2YWn0gLfxohQ3ljNDO/F2iqZDE\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 05:12:11 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"This is CORS-enabled for a whitelisted domain.\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "wrong appId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as appId passed in request params is wrong\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"Application Not Found\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/xyz/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["xyz", "secret", "new"] - } - }, - "response": [ - { - "name": "wrong appId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/xyz/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["xyz", "secret", "new"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "76" - }, - { - "key": "ETag", - "value": "W/\"4c-NO7lw8kkSNMmXa9I2zOR3gKFPz8\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 04:43:33 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"message\": [\n \"Application Not Found\"\n ],\n \"statusCode\": 400,\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "generate new api secret", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and have list of parameters in response body \", function () {", - " pm.expect(\"apiSecretKey\" in responseBody).to.be.true;", - " pm.environment.set(\"X-Api-Secret-Key\", responseBody.apiSecretKey)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}", "secret", "new"] - } - }, - "response": [ - { - "name": "generate new api secret", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId}}/secret/new", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId}}", "secret", "new"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "146" - }, - { - "key": "ETag", - "value": "W/\"92-pktjZjssoz+W8rvLXdxRDgrqiq8\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 07:10:24 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"apiSecretKey\": \"9264949043918ba58a4feea73b347.0d0cffd85ca4660ea36797bcc53a879c915dd707594879437c0dbd67cf93c36c820caa811f3860045b359d243c8cec034\"\n}" - } - ] - } - ] - }, - { - "name": "get api token", - "item": [ - { - "name": "origin not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not passed in header\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Origin mismatch\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "{{X-Api-Secret-Key}}", - "type": "text" - }, - { - "key": "origin", - "value": "{{Origin}}", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "response": [ - { - "name": "origin not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "{{X-Api-Secret-Key}}", - "type": "text" - }, - { - "key": "origin", - "value": "{{Origin}}", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 07:02:43 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "X-Api-secret-key is not passed or empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not passed in header\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"x-api-secret-key header is missing\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "", - "type": "text" - }, - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "response": [ - { - "name": "X-Api-secret-key is not passed or empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "", - "type": "text" - }, - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "90" - }, - { - "key": "ETag", - "value": "W/\"5a-4+BeuBqmQeR3bGK7/VCnWWvZJvY\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 07:55:26 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"x-api-secret-key header is missing\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "wrong X-Api-secret-key", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not passed in header\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"access_denied\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "xyz", - "type": "text" - }, - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "response": [ - { - "name": "wrong X-Api-secret-key", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "xyz", - "type": "text" - }, - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "69" - }, - { - "key": "ETag", - "value": "W/\"45-WJV85FxvXpxFwnsbpAq+QaztVHc\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 07:56:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"access_denied\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "get api token", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and have list of field in response body\", function () {", - " pm.expect(\"access_token\" in responseBody).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"expiresIn\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"tokenType\")).to.be.true;", - " pm.expect(responseBody.tokenType).to.eql(\"Bearer\")", - " pm.environment.set(\"access_Token\", responseBody.access_token)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "{{X-Api-Secret-Key}}", - "type": "text" - }, - { - "key": "Origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "response": [ - { - "name": "get api token", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "X-Api-Secret-Key", - "value": "{{X-Api-Secret-Key}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app/oauth", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["oauth"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "342" - }, - { - "key": "ETag", - "value": "W/\"156-eO/8Vz/GdhYffFK5JPrep5zFECs\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 06:47:29 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjE2ODBmNjk4N2ZlZGNiZGFlYzY3Mjc0ZDBkNTY0NGViMjBkOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzYzNTcyNDksImV4cCI6MTY3NjM3MTY0OX0.wDiXnt_qDaja3ld24mxhJEmkv2eu1pJ-wnzCeARYjoo\",\n \"expiresIn\": 14400,\n \"tokenType\": \"Bearer\"\n}" - } - ] - } - ] - }, - { - "name": "delete app", - "item": [ - { - "name": "add new app to delete", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and have list of response body parameters\", function () {", - " pm.expect(\"appId\" in responseBody).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"appName\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"apiKeySecret\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"edvId\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"walletAddress\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"description\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"whitelistedCors\")).to.be.true;", - " pm.expect(responseBody.whitelistedCors).to.be.an(\"array\");", - "", - " pm.expect(\"logoUrl\" in responseBody).to.be.true", - " pm.environment.set(\"appId2\", responseBody.appId)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"Demo test app2\",\n \"description\":\"This is a test description for second app\",\n \"whitelistedCors\":[\"http://localhost:3001\",\"*\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "response": [ - { - "name": "add new app to delete", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"appName\":\"Demo test app2\",\n \"description\":\"This is a test description for second app\",\n \"whitelistedCors\":[\"http://localhost:3001\",\"*\"],\n \"logoUrl\": \"http://image.png\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}app", - "host": ["{{studio-api-baseUrl}}app"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "481" - }, - { - "key": "ETag", - "value": "W/\"1e1-8QQUxi87um1iGG0N5xNeixdiSs8\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 07:13:36 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appName\": \"Demo test app2\",\n \"appId\": \"55b1b6eec52a40a30d82e867e229a02bdcbd\",\n \"apiKeySecret\": \"afb9ee4e46433effea5f9fff781bf.46c72dc4ca0915aec2e6b112e7e3b6c8db01ca63435a341e70d2f6088c9a16e77f8e3785f8e7090e9763b2ba2910d41e4\",\n \"edvId\": \"hs:apiservice:edv:2a89a40a-ab87-4778-9b97-92ae481a17fb\",\n \"walletAddress\": \"hid15ujzdgqsvjf9hkv5kaxtee7lhucajdmhum2st7\",\n \"description\": \"This is a test description for second app\",\n \"whitelistedCors\": [\n \"http://localhost:3001\",\n \"*\"\n ],\n \"logoUrl\": \"http://image.png\"\n}" - } - ] - }, - { - "name": "wrong appid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "let pathValue= (pm.request.url.path).toString().split(',')", - "pathValue= pathValue[pathValue.length-1]", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as appId passed in request params is wrong\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(404)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(`No App found for appId ${pathValue}`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Not Found\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "DELETE", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app/xyz", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["xyz"] - } - }, - "response": [ - { - "name": "wrong appid", - "originalRequest": { - "method": "DELETE", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app/xyz", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["xyz"] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "79" - }, - { - "key": "ETag", - "value": "W/\"4f-hwej3sYGOSWDEueYS/NyDhdAXog\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 05:37:50 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 404,\n \"message\": [\n \"No App found for appId xyz\"\n ],\n \"error\": \"Not Found\"\n}" - } - ] - }, - { - "name": "delete newly created app", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and have list of response body parameters\", function () {", - " pm.expect(\"appId\" in responseBody).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"appName\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"edvId\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"walletAddress\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"description\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"whitelistedCors\")).to.be.true;", - " pm.expect(\"logoUrl\" in responseBody).to.be.true", - " var appId2 = pm.environment.get('appId2')", - " pm.expect(responseBody.appId).to.eql(appId2)", - " pm.environment.unset(\"appId2\");", - "", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "method": "DELETE", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId2}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId2}}"] - } - }, - "response": [ - { - "name": "delete newly created app", - "originalRequest": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}app/{{appId2}}", - "host": ["{{studio-api-baseUrl}}app"], - "path": ["{{appId2}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "336" - }, - { - "key": "ETag", - "value": "W/\"150-kZ4nf4SHHY8LOpsH4iroi2ODs/4\"" - }, - { - "key": "Date", - "value": "Tue, 14 Feb 2023 07:14:50 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appName\": \"Demo test app2\",\n \"appId\": \"55b1b6eec52a40a30d82e867e229a02bdcbd\",\n \"edvId\": \"hs:apiservice:edv:2a89a40a-ab87-4778-9b97-92ae481a17fb\",\n \"walletAddress\": \"hid15ujzdgqsvjf9hkv5kaxtee7lhucajdmhum2st7\",\n \"description\": \"This is a test description for second app\",\n \"whitelistedCors\": [\n \"http://localhost:3001\",\n \"*\"\n ],\n \"logoUrl\": \"http://image.png\"\n}" - } - ] - } - ] - } - ], - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{studio_API_auth}}", - "type": "string" - } - ] - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "pm.environment.set(\"studio_API_auth\", \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVmFyc2hhIGt1bWFyaSIsImVtYWlsIjoidmFyc2hha3VtYXJpMzcwQGdtYWlsLmNvbSIsImlkIjoiZGlkOmhpZDp0ZXN0bmV0Ono1bjM1YkJpTmhBRmVlZ1QyTUNUcmE0WEhSZkV1Mk5BNzlnaGFjZnRhZ3FZUyIsImlhdCI6MTY3NjQwMTM2MywiZXhwIjoxODg2NTIxMzYzfQ.zboCVCKejYdSZDHXDNYRJQWklVUi9WLx6ww6U2fCcsU\");" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [""] - } - } - ] - }, - { - "name": "Dids", - "item": [ - { - "name": "fetch did list", - "item": [ - { - "name": "fail as authtoken is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "fail as authtoken is not passed", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 14:20:57 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token passed in header is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 14:29:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "negative limit value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail limit is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did?page =1&limit=-20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "-20" - } - ] - } - }, - "response": [ - { - "name": "negative limit value", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did?page =1&limit=-20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "-20" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "84" - }, - { - "key": "ETag", - "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 15:38:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "negative page value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail page is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did?page=-1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "negative page value", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did?page=-1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 15:40:25 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "fetch did list", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var page;", - "var limit;", - "var urlString = pm.request.url.toString();", - "var did = pm.environment.get('did')", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "", - "pm.test(\"Should be able to pass and have list of dids in response body \", function () {", - " try {", - " page = urlString.match(/page=(\\d+)/)[1];", - " page = (parseInt(page))", - " } catch (e) {", - " page = 1", - " }", - " try {", - " limit = urlString.match(/limit=(\\d+)/)[1];", - " limit = parseInt(limit)", - " } catch (e) {", - " limit = 10", - " }", - " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", - " pm.expect(responseBody.totalCount).to.be.a('number')", - " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", - " pm.expect(responseBody.data).to.be.an(\"array\");", - " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did?page=1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "fetch did list", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did?page=1&limit=20", - "host": ["{{studio-api-baseUrl}}did"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1295" - }, - { - "key": "ETag", - "value": "W/\"50f-S7ukKnsX3AH0dD7UH2US7B4ZF88\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 16:04:33 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"totalCount\": 23,\n \"data\": [\n \"did:hid:testnet:0xBE96b88c318BcDc6025366Ea1D2E62eD5bB01941\",\n \"did:hid:testnet:zEgJtgWiLwsLBsbcYnr1EG7DdiepTu9BxUWtRSK2iVKCA\",\n \"did:hid:testnet:zHLQtJdv8dafCfEHmTSEqqnRQAkwMM6oZ6mxzRCwy5W5x\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:z8nhXFrAice2Dp7i1tXdesi3Nu5k28esWkiReunoffXdj\",\n \"did:hid:testnet:zDKL216y4EB54ho7tzJEXqScwP7Lz1Xne6K1kusASdSWg\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F45heuun\",\n \"did:hid:testnet:z9L3NNPa8xRZDwmMDcAeYn16eLJD7BXifBqnTQCn3TSc8\",\n \"did:hid:testnet:z9Vbimnesdv8oPnwNmuPRt9MjKf75mjbGgEQw1Jmog4H3\",\n \"did:hid:testnet:zAqVQbtMBiBDjGS7J3EBN6w4PPDPvfqA21Yj7DTs51Yt5\",\n \"did:hid:testnet:zBYKVEWX2mC24qhw9oTULt9crdihDHoFCDgofFZ7ysmtz\",\n \"did:hid:testnet:z3LpAEdpjua1PtA65acsgB2rjkbohPowSajFdDMgxSqiJ\",\n \"did:hid:testnet:z7CqtaHaApz7miH4nwjefY4wxkCGhTmvpknZGeRrkhnG7\",\n \"did:hid:testnet:z8jnKp5mgwcazmGRCof4JuSxgAJ6fQsQXdQiHGVnfYUkK\",\n \"did:hid:testnet:z2zfWCSxBjuekvFV3jmYAHrzZuTCj36VwW1FQM1FMr3Hf\",\n \"did:hid:testnet:z8qFAHRXaiQGthD9Cwxqa8Gwzz5jTRD9qA4TzPMewYdBv\",\n \"did:hid:testnet:z6DGtcea4MW4xzEGzV6mMbn1RfNnwUv2D3ejUfqTZN5h7\"\n ]\n}" - } - ] - } - ] - }, - { - "name": "create did", - "item": [ - { - "name": "no accesstoken passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "no accesstoken passed", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 15:48:37 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token passed in header is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 15:51:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin mismatch", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "origin mismatch", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 15:54:33 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet', '' \")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "111" - }, - { - "key": "ETag", - "value": "W/\"6f-3k9kUSqDolASTScgYJybcyuPnIg\"" - }, - { - "key": "Date", - "value": "Mon, 20 Feb 2023 16:01:04 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: testnet, \"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create did with empty namespace", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with empty namespace and default keyType for mainnet\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " pm.environment.set(\"didMainnet\", responseBody.did)", - " pm.environment.set(\"didDocMainNet\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [""], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did with empty namespace", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1095" - }, - { - "key": "ETag", - "value": "W/\"447-vqMIzaIeZu+H0fTRkO6SqChbi+g\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 11:17:34 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"controller\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"publicKeyMultibase\": \"z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "unsupported namespace in body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as body is empty or namespace is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet', '' \")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "unsupported namespace in body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "116" - }, - { - "key": "ETag", - "value": "W/\"74-S6l+ID2O9tBXczUSEkTX40qokrg\"" - }, - { - "key": "Date", - "value": "Thu, 23 Feb 2023 04:55:25 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet', '' \"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create did withkey default type ED25519", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` for testnet\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes('testnet'))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " //D means default case", - " pm.environment.set(\"didtestnetD\", responseBody.did)", - " pm.environment.set(\"didDoctestNetD\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did withkey default type ED25519", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1183" - }, - { - "key": "ETag", - "value": "W/\"49f-5RjNFlNuphQ0cqfYvXlf95X3tWo\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 11:18:09 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"controller\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"publicKeyMultibase\": \"zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "create did with Ed25519VerificationKey2020 with methodSpecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - " const {namespace, methodSpecificId}= JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` and namespace as `testnet`\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes(namespace))", - " pm.expect(responseBody.did.includes(methodSpecificId))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " //DM means default key type and metehod specificId", - " pm.environment.set(\"didtestnetDM\", responseBody.did)", - " pm.environment.set(\"didDoctestNetDM\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\": \"{{methodSpecificId}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did with Ed25519VerificationKey2020 with methodSpecificId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\": \"{{methodSpecificId}}10\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1172" - }, - { - "key": "ETag", - "value": "W/\"494-STuZHaWeL9q1ah0EgmkfeNNafQo\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 11:18:46 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\",\n \"controller\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\",\n \"publicKeyMultibase\": \"zGvpqVygyRVE8tNyQkZtXqb2wxCtiBbe72wFBkSi4hDZQ\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "create did with Ed25519VerificationKey2020 with pubkey", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - " const {namespace}= JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` and passed publicKey\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes(namespace))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " //DP means default key type and public key", - " pm.environment.set(\"didtestnetDP\", responseBody.did)", - " pm.environment.set(\"didDoctestNetDP\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW768hvi\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did with Ed25519VerificationKey2020 with pubkey", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW768hvip\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1183" - }, - { - "key": "ETag", - "value": "W/\"49f-GXmAU6HY+j0GmzQIfdDk2435vgg\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 11:19:20 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"controller\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"publicKeyMultibase\": \"zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "create did with Ed25519VerificationKey2020 with pubkey methodSId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - " const {namespace, methodSpecificId}= JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020`, methodSpecificId and passed publicKey\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes(namespace))", - " pm.expect(responseBody.did.includes(methodSpecificId))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " //DMP means default key type, methodSpecificId and public key", - " pm.environment.set(\"didtestnetDMP\", responseBody.did)", - " pm.environment.set(\"didDoctestNetDMP\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"{{methodSpecificId}}1\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did with Ed25519VerificationKey2020 with pubkey methodSId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"{{methodSpecificId}}16\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1171" - }, - { - "key": "ETag", - "value": "W/\"493-o9Epq5dejdHU6NalJNbZaWANQcY\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 11:19:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\",\n \"controller\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\",\n \"publicKeyMultibase\": \"zmPmvbs77izHnZ7KjEG5deMNh8jN421ztqeELqD9ZD7P\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "invalid keyType", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as passed Key type is not supported\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"options.keyType must be one of the following values: Ed25519VerificationKey2020, EcdsaSecp256k1VerificationKey2019, EcdsaSecp256k1RecoveryMethod2020, X25519KeyAgreementKey2020, X25519KeyAgreementKeyEIP5630\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\":\"xyz\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "invalid keyType", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\":\"xyz\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "203" - }, - { - "key": "ETag", - "value": "W/\"cb-8511ww4wOMrfDW6uoPC4HnSc3zw\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 05:04:10 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.keyType must be one of the following values: Ed25519VerificationKey2020, EcdsaSecp256k1VerificationKey2019, EcdsaSecp256k1RecoveryMethod2020\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "option.walletAddress not passed in case of EcdsaSecp256k1RecoveryMethod2020", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const parsedReqBody = JSON.parse(pm.request.body.raw)", - "const { keyType } = parsedReqBody.options", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but walletAddress is passed not a valid walletAddress\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"options.walletAddress is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "option.walletAddress not passed in case of EcdsaSecp256k1RecoveryMethod2020", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "146" - }, - { - "key": "ETag", - "value": "W/\"92-m+HdVH0gX3QXmBtVbk92uG35OPg\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 05:10:28 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.walletAddress is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "option.walletAddress passed is invalid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const parsedReqBody = JSON.parse(pm.request.body.raw)", - "const { walletAddress } = parsedReqBody.options", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but walletAddress passed is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"options.walletAddress must be longer than or equal to 32 characters\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "option.walletAddress passed is invalid", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "122" - }, - { - "key": "ETag", - "value": "W/\"7a-8LeDjrJ7iNCUhjP/SiKP8VNTQEc\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 11:02:17 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.walletAddress must be longer than or equal to 32 characters\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "option.chainId not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const parsedReqBody = JSON.parse(pm.request.body.raw)", - "const { walletAddress } = parsedReqBody.options", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but chainId is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"options.chainId is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyzdvfhfdvjk2847834ifhdv73843hr56vgxghgte6cf5\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "option.chainId not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "140" - }, - { - "key": "ETag", - "value": "W/\"8c-fldN0zbdvNVty/sXLtdhSOEwGa4\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 05:28:35 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.chainId is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid option.chainId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const parsedReqBody = JSON.parse(pm.request.body.raw)", - "const { chainId } = parsedReqBody.options", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but chainId passed is not supported\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(`${chainId} is unsupported`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\": \"xyzdvfhfdvjk2847834ifhdv73843hr56vgxghgte6cf5\",\n \"chainId\": \"rst\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "invalid option.chainId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\",\n \"chainId\":\"rst\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Internal Server Error", - "code": 500, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "173" - }, - { - "key": "ETag", - "value": "W/\"ad-K9SWbRAcny9cHUnfbiiUrgEa0fw\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 05:33:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 500,\n \"timestamp\": \"2023-02-21T05:33:48.911Z\",\n \"path\": \"/api/v1/did/create\",\n \"message\": [\n \"Error\",\n \"HID-SSI-SDK:: Error: unsupported chain Id\",\n \"Internal server error\"\n ]\n}" - } - ] - }, - { - "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020 and methodSId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const parsedReqBody = JSON.parse(pm.request.body.raw)", - "const { namespace, methodSpecificId } = parsedReqBody", - "const { keyType } = parsedReqBody.options", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with key type `EcdsaSecp256k1RecoveryMethod2020` and methodSpecificId\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes(namespace))", - " pm.expect(responseBody.did.includes(methodSpecificId))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal(`${keyType}`);", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).blockchainAccountId).is.not.empty", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " //didDocEcdsaM M means methodSpecificId", - " pm.environment.set(\"didtestnetEcdsaM\", responseBody.did)", - " pm.environment.set(\"didDocEcdsaM\", JSON.stringify(responseBody.metaData.didDocument))", - " // pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " // pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{methodSpecificId}}2\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020 and methodSId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{methodSpecificId}}25\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1160" - }, - { - "key": "ETag", - "value": "W/\"488-CFPTtNIqqvaPXg+Ggm6YTmlMSd8\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 11:20:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"controller\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\",\n \"type\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"controller\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"blockchainAccountId\": \"eip155:1:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn25\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ]\n }\n }\n}" - } - ] - }, - { - "name": "invalid parameter passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create did as invalid parameter `address` is passed in options field\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"options.property address should not exist\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"address\": \"0x01978e553Df0C54A63e2E063DFFe71c688d91C76\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "invalid parameter passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"address\": \"0x01978e553Df0C54A63e2E063DFFe71c688d91C76\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3001/api/v1/did/create", - "protocol": "http", - "host": ["localhost"], - "port": "3001", - "path": ["api", "v1", "did", "create"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "96" - }, - { - "key": "ETag", - "value": "W/\"60-jxUbuOJqFTfOH2ffosveheKe3C4\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 05:38:18 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.property address should not exist\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const parsedReqBody = JSON.parse(pm.request.body.raw)", - "const { namespace } = parsedReqBody", - "const { keyType } = parsedReqBody.options", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with key type `EcdsaSecp256k1RecoveryMethod2020`\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes(namespace))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal(`${keyType}`);", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).blockchainAccountId).is.not.empty", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.environment.set(\"didtestnetEcdsa\", responseBody.did)", - " pm.environment.set(\"didDocEcdsa\", JSON.stringify(responseBody.metaData.didDocument))", - " // pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " // pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{walletAddress}}3\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{walletAddress}}34\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1149" - }, - { - "key": "ETag", - "value": "W/\"47d-61nLLDBXdXUxNQGCztATzJvonjw\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 11:21:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\",\n \"controller\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\",\n \"type\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"controller\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\",\n \"blockchainAccountId\": \"eip155:1:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ]\n }\n }\n}" - } - ] - } - ] - }, - { - "name": "register did", - "item": [ - { - "name": "no accesstoken passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "no accesstoken passed Copy", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:02:51 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token passed in header is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:03:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin mismatch", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "origin mismatch", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:03:49 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", - " // pm.expect(responseBody.message[1]).to.be.eql(\"Did's namespace should be testnet\")", - " // pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "169" - }, - { - "key": "ETag", - "value": "W/\"a9-r0Du8pOer2khk6jBElZyelkSMBI\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:07:20 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"Did's namespace should be testnet\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid didDocument type", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as didDocument passed in body is of type string it should be object\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"each value in nested property didDocument must be either object or array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"Did's namespace should be testnet\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "invalid didDocument type", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "244" - }, - { - "key": "ETag", - "value": "W/\"f4-WE0Av30xk6U+M5kdtv0+TOR9dEc\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:08:43 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"each value in nested property didDocument must be either object or array\",\n \"Did's namespace should be testnet\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty didDocument", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as didDocument passed in body is of type string it should be object\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"didDocument.id must be a string\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"didDocument.controller must be an array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.alsoKnownAs must be an array\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"didDocument.authentication must be an array\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"didDocument.assertionMethod must be an array\")", - " pm.expect(responseBody.message[5]).to.be.equal( \"didDocument.keyAgreement must be an array\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"didDocument.capabilityInvocation must be an array\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"didDocument.capabilityDelegation must be an array\")", - " pm.expect(responseBody.message[9]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "empty didDocument", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "488" - }, - { - "key": "ETag", - "value": "W/\"1e8-lrCxvNuZ8ZNGeofWQotWBy2/yAs\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:10:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument.id must be a string\",\n \"didDocument.controller must be an array\",\n \"didDocument.alsoKnownAs must be an array\",\n \"didDocument.authentication must be an array\",\n \"didDocument.assertionMethod must be an array\",\n \"didDocument.keyAgreement must be an array\",\n \"didDocument.capabilityInvocation must be an array\",\n \"didDocument.capabilityDelegation must be an array\",\n \"Did's namespace should be testnet\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[2]).to.be.equal(\"HID-SSI-SDK:: Error: params.verificationMethodId is required to register a did\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocMainNet}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "verificationMethodId not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocMainNet}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "92" - }, - { - "key": "ETag", - "value": "W/\"5c-ii60+QasIfPIWaDzGUPaCa22xIU\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:21:50 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid verificationMethodId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId passed is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocMainNet}},\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "invalid verificationMethodId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:05:29 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "register did that don't have namespace", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be not able register didDoc as we did don't have namespace testnet and mainnet is yet not live\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Did's namespace should be testnet\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocMainNet}},\n \"verificationMethodId\":\"{{didMainnet}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "register did that don't have namespace", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocMainNet}},\n \"verificationMethodId\":\"{{didMainnet}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "88" - }, - { - "key": "ETag", - "value": "W/\"58-E0eglHWRdZYuy+bzuJapvRWBdIU\"" - }, - { - "key": "Date", - "value": "Tue, 28 Feb 2023 07:14:33 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Did's namespace should be testnet\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "register did with default key", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` for testnet\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes('testnet'))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", - " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", - " pm.expect(responseBody.transactionHash).not.be.empty", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " const did = pm.environment.get('didtestnetD')", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " pm.environment.set(\"didDoctestNetD\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "setTimeout(function() {", - " console.log(\"Waited for 60 seconds\");", - "}, 60000);" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\": {{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "register did with default key", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1266" - }, - { - "key": "ETag", - "value": "W/\"4f2-oHmgx/mrYWqo1ChlCMT0IVVVAsI\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:45:29 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"CCA2D08D0B79BD8453A2C5971E80E313D612ABC6E929AF7D3D2E168BC082AD14\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"controller\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"publicKeyMultibase\": \"zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "did already registered", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const did= pm.environment.get(\"didtestnetD\")", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should throw error as did is already registered\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(`${did} already registered`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "did already registered", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "135" - }, - { - "key": "ETag", - "value": "W/\"87-I3oAXkD9P+zzWcr9LK8lgzMQIV4\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 04:36:43 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"did:hid:testnet:z91twLPENwCNAqfPsYpfci7RRJvCb9Uhv7vocYdJYgP73 already registered\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "register did with default keytype and MethodSpId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` for testnet and methodSpecificId\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes('testnet'))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", - " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", - " pm.expect(responseBody.transactionHash).not.be.empty", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " const did = pm.environment.get('didtestnetDM')", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " pm.environment.set(\"didDoctestNetDM\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\":\"{{didtestnetDM}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "register did with default keytype and MethodSpId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\":\"{{didtestnetDM}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1266" - }, - { - "key": "ETag", - "value": "W/\"4f2-DarYm1FhvgWRX18d+a05SqxixXo\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:48:57 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"69B056F9E83BE99D90EE3C9A8747C695742DCB768B6E919E2954D4381B8B7D23\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"controller\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"publicKeyMultibase\": \"zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "register did with default keytype and publickey", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` and custom publickey\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes('testnet'))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", - " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", - " pm.expect(responseBody.transactionHash).not.be.empty", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " const did = pm.environment.get('didtestnetDP')", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " pm.environment.set(\"didDoctestNetDP\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\":\"{{didtestnetDP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "register did with default keytype and publickey", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\":\"{{didtestnetDP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1266" - }, - { - "key": "ETag", - "value": "W/\"4f2-a9WjFMJHk+zSuS+R9FqqcGD7nK0\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 07:52:37 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"F5CC35AB0315DE5518D95102E41DB30B3CB4A28A5C31187E193AC99B74B673BB\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"controller\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"publicKeyMultibase\": \"z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "register did with default keytype , publickey and MSId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020`, custom publickey and methodSpecficId\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes('testnet'))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", - " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", - " pm.expect(responseBody.transactionHash).not.be.empty", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " const did = pm.environment.get('didtestnetDMP')", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " pm.environment.set(\"didDoctestNetDMP\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\":\"{{didtestnetDMP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "register did with default keytype , publickey and MSId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\":\"{{didtestnetDMP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1233" - }, - { - "key": "ETag", - "value": "W/\"4d1-lb+eAFjn/D8dOGuUJIQAasKwc4Q\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 08:03:33 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"8EF9EFE5449ACA363807CF03932F23828276556E94FA6D994808D40C8F946366\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\",\n \"controller\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\",\n \"publicKeyMultibase\": \"z5uYhvEGCAUbXirrAWDPfqKrG98gcjRthoH7rLqo63EJF\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "clientSpec is not passed in Ecdsa type", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and clientSpec is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"clientSpec is required\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "clientSpec is not passed in Ecdsa type", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "121" - }, - { - "key": "ETag", - "value": "W/\"79-1cXmobjylBe6qSVdjD/yGqH+nGs\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 08:35:05 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 404,\n \"message\": [\n \"did:hid:testnet:0x01978e553Df0C54A63e2E063DFFe71c688d91C76 not found\"\n ],\n \"error\": \"Not Found\"\n}" - } - ] - }, - { - "name": "invalid cleintSpec", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and clientSpec passed is invalid or empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"clientSpec must be one of the following values: eth-personalSign, cosmos-ADR036\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"signature must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"signature should not be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "invalid cleintSpec", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "195" - }, - { - "key": "ETag", - "value": "W/\"c3-6tDI8wYUnOwDfdNeT743euznRug\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:18:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"clientSpec must be one of the following values: eth-personalSign, cosmos-ADR036\",\n \"signature must be a string\",\n \"signature should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "signature not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to register did as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and signature field is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"signature must be a string\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"signature should not be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "signature not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "113" - }, - { - "key": "ETag", - "value": "W/\"71-UMe0vBLZrMI8oYvPwBwyegiAYDw\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 09:27:16 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"signature must be a string\",\n \"signature should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty signature field", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to register did as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and signature field has empty string\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"signature should not be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "empty signature field", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "84" - }, - { - "key": "ETag", - "value": "W/\"54-pIJmNYXQzIU2s/swEO98ntiQd3Q\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:20:21 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"signature should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid signature", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to register did as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and invalid signature is passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid signature detected\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"zhkhgfk\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "invalid signature", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"zhkhgfk\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Internal Server Error", - "code": 500, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "437" - }, - { - "key": "ETag", - "value": "W/\"1b5-TrzClBFHWNa0tV00YARZgjXHoYo\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:22:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 500,\n \"timestamp\": \"2023-03-01T09:22:52.288Z\",\n \"path\": \"/api/v1/did/register\",\n \"message\": [\n \"Error\",\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: hex string without 0x prefix: invalid signature detected [/home/arnab/code/research/hid-node/x/ssi/verification/signature_verification.go:59] With gas wanted: '0' and gas used: '52877' : unknown request\",\n \"Internal server error\"\n ]\n}" - } - ] - } - ] - }, - { - "name": "resolve did", - "item": [ - { - "name": "fail as authtoken is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to resolve did as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "response": [ - { - "name": "fail as authtoken is not passed", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 05:12:02 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to resolve did as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 05:14:12 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin mismatch", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "response": [ - { - "name": "origin mismatch", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Mon, 27 Feb 2023 05:11:39 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "invalid did", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve and get empty didDocument and didDocumentMetadata as did is invalid or not exists on chain\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.equal(null)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/xyz", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "xyz"] - } - }, - "response": [ - { - "name": "invalid did", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/xyz", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "xyz"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "45" - }, - { - "key": "ETag", - "value": "W/\"2d-pTpHw0B+V4W4NxYR16fn+iNbD6s\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:29:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {},\n \"didDocumentMetadata\": null\n}" - } - ] - }, - { - "name": "resolve did with default keyType", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve did generated using default key type\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - "", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "response": [ - { - "name": "resolve did generated with default keyType", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["{{didtestnetD}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1254" - }, - { - "key": "ETag", - "value": "W/\"4e6-VF8bSlY4m70Z6xUpJi80pO4dBjQ\"" - }, - { - "key": "Date", - "value": "Tue, 21 Feb 2023 12:29:49 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"controller\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"publicKeyMultibase\": \"zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:45:21Z\",\n \"updated\": \"2023-02-21T07:45:21Z\",\n \"deactivated\": false,\n \"versionId\": \"CCA2D08D0B79BD8453A2C5971E80E313D612ABC6E929AF7D3D2E168BC082AD14\"\n }\n}" - } - ] - }, - { - "name": "resolve did with default keyType and methodspecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - "", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve did generated using methodSpecificId and default key type\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDM}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDM}}"] - } - }, - "response": [ - { - "name": "resolve did with default keyType and methodspecificId", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDM}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDM}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1159" - }, - { - "key": "ETag", - "value": "W/\"487-2i5n7i2zpTQ/v9tc2G2rqsSwONg\"" - }, - { - "key": "Date", - "value": "Thu, 23 Feb 2023 04:22:37 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\",\n \"controller\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\",\n \"publicKeyMultibase\": \"zDpYhLS9HQwThm43gux7s9hVBcuTTWWiJvZJvjFqUzM7\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {}\n}" - } - ] - }, - { - "name": "resolve did with default keyType and publickey", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - "", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve did generated using publicKey and default key type\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDP}}"] - } - }, - "response": [ - { - "name": "resolve did with default keyType and publickey", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDP}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1090" - }, - { - "key": "ETag", - "value": "W/\"442-Nx8MeXYmTuD+i6KfyxWK4RpD+Js\"" - }, - { - "key": "Date", - "value": "Thu, 23 Feb 2023 04:24:41 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\",\n \"controller\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\",\n \"publicKeyMultibase\": \"z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {}\n}" - } - ] - }, - { - "name": "resolve did generated with default keyType publickey and methodSpecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - "", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve did generated using publicKey, default key type and publicKey\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDMP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDMP}}"] - } - }, - "response": [ - { - "name": "resolve did generated with default keyType publickey and methodSpecificId", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDMP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDMP}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1120" - }, - { - "key": "ETag", - "value": "W/\"460-mVg4eeTbqJM2cQEVTwUlWuPGO74\"" - }, - { - "key": "Date", - "value": "Thu, 23 Feb 2023 04:25:24 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\",\n \"controller\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\",\n \"publicKeyMultibase\": \"z6tmrYo9BuGAsJRg1hBMQkCuqTd2h9bpMaRt3biq6UKf6\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {}\n}" - } - ] - }, - { - "name": "resolve did generated with ecdsaRecoveryMethod", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to resolve and get empty didDocument and didDocumentMetadata as did is generated using ecdsa but not resgistered\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.equal(null)", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetEcdsa}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetEcdsa}}"] - } - }, - "response": [ - { - "name": "resolve did generated with ecdsaRecoveryMethod", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetEcdsa}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetEcdsa}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "45" - }, - { - "key": "ETag", - "value": "W/\"2d-pTpHw0B+V4W4NxYR16fn+iNbD6s\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:34:20 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {},\n \"didDocumentMetadata\": null\n}" - } - ] - } - ] - }, - { - "name": "update did", - "item": [ - { - "name": "fail as authtoken is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "fail as authtoken is not passed", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:22:09 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token passed in header is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:23:12 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin mismatch", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "origin mismatch", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:25:07 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update didDocument as body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", - " // pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "133" - }, - { - "key": "ETag", - "value": "W/\"85-1DKdxkFDlpCjD38tqVB9u3DSWoc\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:27:32 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "type issue for didDocument", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail to update did as didDocument passed in body is of type string it should be object\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"nested property didDocument must be either object or array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "type issue for didDocument", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "194" - }, - { - "key": "ETag", - "value": "W/\"c2-y4DeYGzVgFQLfsZ63lyFWQu/61I\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:31:29 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"nested property didDocument must be either object or array\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty didDocument", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail to update did as didDocument passed in body is empty object\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"didDocument.id must be a string\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"didDocument.controller must be an array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.alsoKnownAs must be an array\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"didDocument.authentication must be an array\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"didDocument.assertionMethod must be an array\")", - " pm.expect(responseBody.message[5]).to.be.equal( \"didDocument.keyAgreement must be an array\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"didDocument.capabilityInvocation must be an array\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"didDocument.capabilityDelegation must be an array\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "empty didDocument", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "452" - }, - { - "key": "ETag", - "value": "W/\"1c4-1Z6qrEOnfNEPUyqDwPYc+6wJPfo\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:29:14 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument.id must be a string\",\n \"didDocument.controller must be an array\",\n \"didDocument.alsoKnownAs must be an array\",\n \"didDocument.authentication must be an array\",\n \"didDocument.assertionMethod must be an array\",\n \"didDocument.keyAgreement must be an array\",\n \"didDocument.capabilityInvocation must be an array\",\n \"didDocument.capabilityDelegation must be an array\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should noot be able to update did as verificationMethodId is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "verificationMethodId not passed", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "92" - }, - { - "key": "ETag", - "value": "W/\"5c-ii60+QasIfPIWaDzGUPaCa22xIU\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:34:58 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId is invalid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Shouldnot able to update did as verificationMethodId passed is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "verificationMethodId is invalid", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:38:18 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "update did generated using default keyType", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to update did generated using default keyType\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\",\n \"deactivate\":false\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "update did generated using default keyType", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-XhzqBki7zDstfcivBrfD/UqR4+4\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:43:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"500EAEE28F2292FB5B63659140F1AC9582611E089EFDC110DC924BD617ECE5F2\"\n}" - } - ] - }, - { - "name": "update did generated using default keyType and methodSPecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to update did generated using default keyType and methodSpecificId\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "update did generated using default keyType and methodSPecificId", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-goVrcm/ft6woeRlMf6Hok5AFD+k\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:45:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"FF0AE65710AAC32E546B0A97C1E17EC09548BAD17FFA425F1145225745EB3E6A\"\n}" - } - ] - }, - { - "name": "update did generated using default keyType and publicKey", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to update did generated using default keyType and publicKey\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "update did generated using default keyType and publicKey", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-qGQKGq8cS86APVTzJ7sMZRWyM/g\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:46:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"B218A3BE298571F5275FAA6FF1002AA1A3765B8118B379A1F854EC36B3E36726\"\n}" - } - ] - }, - { - "name": "update did generated using default keyType and publicKey and methodSpecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to update did generated using default keyType, publicKey and methodSpecificId\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "update did generated using default keyType and publicKey and methodSpecificId", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-Xi+fRHWhLbKF/KmFrzsiS0Pq+CE\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:49:36 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"2F042289665D77E06C448D6D2CC36FDD28EA7366BEA283AB1295DD97CC0095ED\"\n}" - } - ] - } - ] - }, - { - "name": "deactivate dids", - "item": [ - { - "name": "fail as authtoken is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to deactivate did as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "fail as authtoken is not passed", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:22:09 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to deactivate as access token passed in header is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:23:12 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin mismatch", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to deactivate did as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "origin mismatch", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:25:07 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to deactivate did as body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", - " // pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "133" - }, - { - "key": "ETag", - "value": "W/\"85-1DKdxkFDlpCjD38tqVB9u3DSWoc\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:27:32 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "type issue for didDocument", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail to update did as didDocument passed in body is of type string it should be object\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"nested property didDocument must be either object or array\")", - " // pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "type issue for didDocument", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "194" - }, - { - "key": "ETag", - "value": "W/\"c2-y4DeYGzVgFQLfsZ63lyFWQu/61I\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:31:29 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"nested property didDocument must be either object or array\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty didDocument", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail to update did as didDocument passed in body is empty object\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument.controller must be an array\")", - " // pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.alsoKnownAs must be an array\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"didDocument.authentication must be an array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.assertionMethod must be an array\")", - " // pm.expect(responseBody.message[5]).to.be.equal( \"didDocument.keyAgreement must be an array\")", - " // pm.expect(responseBody.message[6]).to.be.equal(\"didDocument.capabilityInvocation must be an array\")", - " // pm.expect(responseBody.message[7]).to.be.equal(\"didDocument.capabilityDelegation must be an array\")", - " // pm.expect(responseBody.message[8]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "empty didDocument", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "452" - }, - { - "key": "ETag", - "value": "W/\"1c4-1Z6qrEOnfNEPUyqDwPYc+6wJPfo\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:29:14 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument.id must be a string\",\n \"didDocument.controller must be an array\",\n \"didDocument.alsoKnownAs must be an array\",\n \"didDocument.authentication must be an array\",\n \"didDocument.assertionMethod must be an array\",\n \"didDocument.keyAgreement must be an array\",\n \"didDocument.capabilityInvocation must be an array\",\n \"didDocument.capabilityDelegation must be an array\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to deactivate did as verificationMethodId is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "verificationMethodId not passed", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "92" - }, - { - "key": "ETag", - "value": "W/\"5c-ii60+QasIfPIWaDzGUPaCa22xIU\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:34:58 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId is invalid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to deactivate did as verificationMethodId passed is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "verificationMethodId is invalid", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:38:18 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "deactivate did generated using default keyType", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to update did generated using default keyType\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\",\n \"deactivate\":true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "update did generated using default keyType", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-XhzqBki7zDstfcivBrfD/UqR4+4\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:43:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"500EAEE28F2292FB5B63659140F1AC9582611E089EFDC110DC924BD617ECE5F2\"\n}" - } - ] - }, - { - "name": "resolve deactivated did", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - "", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using default key type\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetD}}"] - } - }, - "response": [ - { - "name": "resolve deactivated did", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/{{didtestnetD}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["{{didtestnetD}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1253" - }, - { - "key": "ETag", - "value": "W/\"4e5-e8P0aImiMnG8hA4LiEcmWtL/OuE\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 05:05:22 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\",\n \"controller\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\",\n \"publicKeyMultibase\": \"z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-22T05:03:17Z\",\n \"updated\": \"2023-02-22T05:03:46Z\",\n \"deactivated\": true,\n \"versionId\": \"25646CAA58B4F576E3201F3CADEA748C1CCA9DA7E37628F740AD0ADFD596F759\"\n }\n}" - } - ] - }, - { - "name": "deactivate did generated using default keyType and methodSPecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to update did generated using default keyType and methodSpecificId\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "update did generated using default keyType and methodSPecificId", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-goVrcm/ft6woeRlMf6Hok5AFD+k\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 00:45:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"FF0AE65710AAC32E546B0A97C1E17EC09548BAD17FFA425F1145225745EB3E6A\"\n}" - } - ] - }, - { - "name": "resolve deactivated did generated with MSId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - "", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using methodSpecificId and default key type\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDM}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDM}}"] - } - }, - "response": [ - { - "name": "resolve deactivated did", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/{{didtestnetDM}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["{{didtestnetDM}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1253" - }, - { - "key": "ETag", - "value": "W/\"4e5-xECHNBvuAqZbleoAF6nh9TtGAhs\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 04:47:41 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"controller\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"publicKeyMultibase\": \"zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:48:50Z\",\n \"updated\": \"2023-02-22T04:46:08Z\",\n \"deactivated\": true,\n \"versionId\": \"2B32C7F8D51F95DF3479CDDA970F1A12F6EC5E51CEDB8C5729F9FD6E641CF3B6\"\n }\n}" - } - ] - }, - { - "name": "did already deactivaetd", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var did = pm.environment.get('did2')", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Shouldnot able to deactivate as already deactivated\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(`${did} already deactivated`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "did already deactivaetd", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "398" - }, - { - "key": "ETag", - "value": "W/\"18e-HYpf1vLJThp0IFnpvMR4WD8lh1g\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 04:51:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: DidDoc ID: did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx: DID Document is deactivated [/home/arnab/code/research/hid-node/x/ssi/verification/did_verification.go:109] With gas wanted: '0' and gas used: '51053' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "deactivate did generated using default keyType and publicKey", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to deactivate did generated using default keyType and publicKey\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\",\n \"deactivate\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "deactivate did generated using default keyType and publicKey", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\",\n \"deactivate\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-GxNPVoSjX2K0xE7TRl1NOAwR8QQ\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 04:55:30 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"373F1278536F2E58C279F399BDDD28B1E9B08CC4B806240DE1706A728BA4E499\"\n}" - } - ] - }, - { - "name": "resolve deactivated did generated with pubKey", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - "", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using methodSpecificId and default key type\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDP}}"] - } - }, - "response": [ - { - "name": "resolve deactivated did generated with pubKey", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/{{didtestnetDP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["{{didtestnetDP}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1253" - }, - { - "key": "ETag", - "value": "W/\"4e5-+n2uw9n6AuIJZKPlJKLkJazGCEw\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 04:55:53 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"controller\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"publicKeyMultibase\": \"z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:52:32Z\",\n \"updated\": \"2023-02-22T04:55:24Z\",\n \"deactivated\": true,\n \"versionId\": \"373F1278536F2E58C279F399BDDD28B1E9B08CC4B806240DE1706A728BA4E499\"\n }\n}" - } - ] - }, - { - "name": "deactivate did generated using default keyType and publicKey and methodSpecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to deactivate did generated using default keyType, publicKey and methodSpecificId\", function () {", - " pm.expect(\"transactionHash\" in responseBody).to.be.true;", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\",\n \"deactivate\":true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "response": [ - { - "name": "deactivate did generated using default keyType and publicKey and methodSpecificId", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\",\n \"deactivate\":true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did", - "host": ["{{studio-api-baseUrl}}did"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "86" - }, - { - "key": "ETag", - "value": "W/\"56-uQMdgFFCiYqoahEPj++8CpQmgvI\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 04:56:47 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"transactionHash\": \"390C39E6182E2AA9C184FC426FBD48E9A4C71B742E02E0488578DF0817F04022\"\n}" - } - ] - }, - { - "name": "resolve did generated using default keyType and publicKey and methodSpecificId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - "", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using methodSpecificId and default key type\", function () {", - " pm.expect(\"didDocument\" in responseBody).to.be.true;", - " pm.expect(responseBody.didDocument).to.be.an(\"object\")", - " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", - " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", - " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", - " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", - " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDMP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["resolve", "{{didtestnetDMP}}"] - } - }, - "response": [ - { - "name": "resolve deactivated did Copy", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}did/{{didtestnetDP}}", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["{{didtestnetDP}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1253" - }, - { - "key": "ETag", - "value": "W/\"4e5-+n2uw9n6AuIJZKPlJKLkJazGCEw\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 04:55:53 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"controller\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"publicKeyMultibase\": \"z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:52:32Z\",\n \"updated\": \"2023-02-22T04:55:24Z\",\n \"deactivated\": true,\n \"versionId\": \"373F1278536F2E58C279F399BDDD28B1E9B08CC4B806240DE1706A728BA4E499\"\n }\n}" - } - ] - } - ] - }, - { - "name": "create reuse did", - "item": [ - { - "name": "create did withkey default type ED25519 Copy", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` for testnet\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes('testnet'))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " //D means default case", - " pm.environment.set(\"did\", responseBody.did)", - " pm.environment.set(\"didDoc\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "response": [ - { - "name": "create did withkey default type ED25519 Copy", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/create", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["create"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1183" - }, - { - "key": "ETag", - "value": "W/\"49f-ylwgNIQ7fzG6kb/BhUM+ahf56vc\"" - }, - { - "key": "Date", - "value": "Tue, 28 Feb 2023 06:36:57 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"controller\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"publicKeyMultibase\": \"z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - }, - { - "name": "register did with default key", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` for testnet\", function () {", - " pm.expect(\"did\" in responseBody).to.be.true;", - " pm.expect(responseBody.did.includes('testnet'))", - " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", - " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", - " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", - " pm.expect(responseBody.transactionHash).not.be.empty", - " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", - " pm.expect(responseBody.metaData).to.be.an(\"object\")", - " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", - " const did = pm.environment.get('did')", - " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", - " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - "", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", - " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", - " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", - " pm.environment.set(\"didDoc\", JSON.stringify(responseBody.metaData.didDocument))", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoc}},\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "response": [ - { - "name": "register did with default key Copy", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"didDocument\":{{didDoc}},\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}did/register", - "host": ["{{studio-api-baseUrl}}did"], - "path": ["register"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1266" - }, - { - "key": "ETag", - "value": "W/\"4f2-euoLxBwuhfUyBhkP4e9W52DGAy8\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 05:12:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"did\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"6BD61EE6BE578C9A0FB22F77A70A21966CA95083CF951DA1962511F2DCBFC083\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"controller\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"publicKeyMultibase\": \"z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"service\": []\n }\n }\n}" - } - ] - } - ] - } - ] - }, - { - "name": "Schemas", - "item": [ - { - "name": "create schema", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 07:55:54 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "origin not passed", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 08:03:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body in schema", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as request body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema must be a non-empty object\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "empty body in schema", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "189" - }, - { - "key": "ETag", - "value": "W/\"bd-4k7ej2J3Ur64phdmP/JbGXuS298\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 08:32:22 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema must be a non-empty object\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty schema field", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema is passed in request body and it is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema.name should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"schema.name must be a string\")", - "", - " pm.expect(responseBody.message[2]).to.be.equal(\"schema.author should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"schema.author must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"schema.fields must contain at least 1 elements\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"namespace must be a string\")", - "", - " pm.expect(responseBody.message[8]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "empty schema field", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "390" - }, - { - "key": "ETag", - "value": "W/\"186-K+kfBSGJWSVK2K97X2qjs2kf/2k\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 11:29:54 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.name should not be empty\",\n \"schema.name must be a string\",\n \"schema.author should not be empty\",\n \"schema.author must be a string\",\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty schema.name field", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema is passed in request body and it is has empty name fiekd\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema.name should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"schema.author should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"schema.author must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"schema.fields must contain at least 1 elements\")", - "", - " pm.expect(responseBody.message[5]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"namespace must be a string\")", - "", - " pm.expect(responseBody.message[7]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "empty schema.name field", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "359" - }, - { - "key": "ETag", - "value": "W/\"167-bigYpWyz3bsMtSZqun+WP3FAArI\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 11:32:33 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.name should not be empty\",\n \"schema.author should not be empty\",\n \"schema.author must be a string\",\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "schema.author field not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema.name is passed in request body\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema.author should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"schema.author must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"schema.fields must contain at least 1 elements\")", - "", - " pm.expect(responseBody.message[4]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"namespace must be a string\")", - "", - " pm.expect(responseBody.message[6]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "schema.author field not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "325" - }, - { - "key": "ETag", - "value": "W/\"145-C7D5KTk6HfM7m3dxlCZmOpyb9lI\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 11:46:40 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.author should not be empty\",\n \"schema.author must be a string\",\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty schema.author", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema.name is passed in request body\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"author cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "empty schema.author", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "77" - }, - { - "key": "ETag", - "value": "W/\"4d-8l1NN7nhrwKzrS0BgtwgkQL4CGU\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 09:04:44 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"author cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid schema.author", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema.name is passed in request body\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid author\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"xyz\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "invalid schema.author", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"xyz\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "69" - }, - { - "key": "ETag", - "value": "W/\"45-WbQcyl/Ldgkf8KUPadIyDjBkZ0Q\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 09:07:55 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid author\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "schema.additionalProperties not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema.additionalProperties is not passed.\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"schema.fields must contain at least 1 elements\")", - "", - " pm.expect(responseBody.message[2]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "schema.additionalProperties not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "256" - }, - { - "key": "ETag", - "value": "W/\"100-A3t13plygImNsyRlfLCQkHpOQf0\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 11:36:10 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid schema.additionalProperties", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema.additionalProperties is not passed.\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"schema.fields must contain at least 1 elements\")", - "", - " pm.expect(responseBody.message[2]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":\"\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "invalid schema.additionalProperties", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":\"\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "256" - }, - { - "key": "ETag", - "value": "W/\"100-A3t13plygImNsyRlfLCQkHpOQf0\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 11:37:29 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "schema.fields not passed or empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field schema.fields is not passed or it is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema.fields must contain at least 1 elements\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":true\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "schema.fields not passed or empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":true\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "162" - }, - { - "key": "ETag", - "value": "W/\"a2-gxYhrSwvE4QewhIQs1mHTE6EO1c\"" - }, - { - "key": "Date", - "value": "Fri, 17 Feb 2023 08:12:49 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "type mismatch for schema.fields", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as schema.field passed is of invalid type\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schema.fields must contain at least 1 elements\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"schema.each value in nested property fields must be either object or array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":\"\"\n\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "invalid type for schema.field", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":\"\"\n\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "279" - }, - { - "key": "ETag", - "value": "W/\"117-eqV5Cdm0hrSouJi7hk4VqMLZzUg\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 09:45:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.fields must contain at least 1 elements\",\n \"schema.each value in nested property fields must be either object or array\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "namespace is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as only field namespace is not passed.\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "namespace is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "153" - }, - { - "key": "ETag", - "value": "W/\"99-1NFEqxPQsq35ZT6YmUCh7vIqsBc\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 09:48:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty namespace", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as namespace is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "empty namespace", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "124" - }, - { - "key": "ETag", - "value": "W/\"7c-CZah9l0mddolWA2sOGGMFOtD/wI\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 09:50:22 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId field is not passed in request body\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId must be a string\")", - "", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "verificationMethodId not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "92" - }, - { - "key": "ETag", - "value": "W/\"5c-ii60+QasIfPIWaDzGUPaCa22xIU\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 09:30:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty verificationMethodId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId passed in request body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "empty verificationMethodId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "91" - }, - { - "key": "ETag", - "value": "W/\"5b-zP9LI+Oe9F8CDquWcPNgIxi8yfo\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 09:34:18 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid verificationMethodId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId passed in request body is not of type verificationMethodId\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "invalid verificationMethodId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 09:34:57 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid namespace", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var namespace=JSON.parse( pm.request.body.raw).namespace", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as namespace passed in request body is not valid.It should be testnet but got some other\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(`${namespace} is invalid nameSpace`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"fyre\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "invalid namespace", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"fyre\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "350" - }, - { - "key": "ETag", - "value": "W/\"15e-M08Ywm3S0kox3D5P2aOv+JU6mM8\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 09:44:16 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: expected did namespace testnet, got fyre: Invalid schema Id [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_schema.go:36] With gas wanted: '0' and gas used: '52197' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create schema", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to pass and create new schema\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"schemaId\")).to.be.true;", - " pm.expect(responseBody.schemaId).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", - " pm.expect(responseBody.transactionHash).to.be.an(\"string\");", - " pm.environment.set(\"schemaId\", responseBody.schemaId)", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"description\": \"Ticket schema\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "create schema", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "165" - }, - { - "key": "ETag", - "value": "W/\"a5-j+sPjcbt3i4httdNgTWKTAMcReU\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 09:56:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"schemaId\": \"sch:hid:testnet:z3GrkvxjwNHc72y9YZ7sV8AZqhDo9eJJaYbuj1KTY8bBq:1.0\",\n \"transactionHash\": \"1E90D0835C81EF6D016C2A38086ABF2EA01EC15EBA4C5468D1E0B61AD6D23A6E\"\n}" - } - ] - } - ] - }, - { - "name": "get schema list", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to fetch schema list as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 07:55:54 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to fetch schema list as origin passed in header not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "origin not passed", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 08:03:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "negative limit value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to fetch schema list as limit is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema?page =2&limit=-10", - "host": ["{{studio-api-baseUrl}}schema"], - "query": [ - { - "key": "page ", - "value": "2" - }, - { - "key": "limit", - "value": "-10" - } - ] - } - }, - "response": [ - { - "name": "negative limit value", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema?page =2&limit=-10", - "host": ["{{studio-api-baseUrl}}schema"], - "query": [ - { - "key": "page ", - "value": "2" - }, - { - "key": "limit", - "value": "-10" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "84" - }, - { - "key": "ETag", - "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 11:11:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "negative page value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to feetch schema list as page is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema?page=-1&limit=1", - "host": ["{{studio-api-baseUrl}}schema"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "1" - } - ] - } - }, - "response": [ - { - "name": "negative page value", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema?page=-1&limit=1", - "host": ["{{studio-api-baseUrl}}schema"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "1" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 11:12:53 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "get schema list", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var page;", - "var limit;", - "var urlString = pm.request.url.toString();", - "var did = pm.environment.get('did')", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "", - "pm.test(\"Should be able to pass and have list of schemaIds in response body \", function () {", - " try {", - " page = urlString.match(/page=(\\d+)/)[1];", - " page = (parseInt(page))", - " } catch (e) {", - " page = 1", - " }", - " try {", - " limit = urlString.match(/limit=(\\d+)/)[1];", - " limit = parseInt(limit)", - " } catch (e) {", - " limit = 10", - " }", - " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", - " pm.expect(responseBody.totalCount).to.be.a('number')", - " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", - " pm.expect(responseBody.data).to.be.an(\"array\");", - " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema?page=1&limit=20", - "host": ["{{studio-api-baseUrl}}schema"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "get schema list", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema?page=1&limit=20", - "host": ["{{studio-api-baseUrl}}schema"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "229" - }, - { - "key": "ETag", - "value": "W/\"e5-UL6nLKgS9iA449LQtWw4NblFPMY\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 11:15:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"totalCount\": 3,\n \"data\": [\n \"sch:hid:testnet:z2qzw2qTqP68vrZTe5tCBpC3E88ARxvGruVmLtZxsu5Mz:1.0\",\n \"sch:hid:testnet:z3GrkvxjwNHc72y9YZ7sV8AZqhDo9eJJaYbuj1KTY8bBq:1.0\",\n \"sch:hid:testnet:z77YDLPSyXRSLwgKrbVTP2RbFTRNrzUn3sqDiStu9RWcG:1.0\"\n ]\n}" - } - ] - } - ] - }, - { - "name": "resolve schema", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 07:55:54 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "response": [ - { - "name": "origin not passed", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}schema", - "host": ["{{studio-api-baseUrl}}schema"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 08:03:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "wrong schemaId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "let schemaId= (pm.request.url.path).toString().split(',')", - "schemaId= schemaId[schemaId.length-1]", - "var appId= pm.environment.get('appId')", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as schemaId passed in request params is wrong\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(404)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( `${schemaId} is not chain`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Not Found\")", - "});", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema/xyz", - "host": ["{{studio-api-baseUrl}}schema"], - "path": ["xyz"] - } - }, - "response": [ - { - "name": "wrong schemaId", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema/xyz", - "host": ["{{studio-api-baseUrl}}schema"], - "path": ["xyz"] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "69" - }, - { - "key": "ETag", - "value": "W/\"45-sj4wHslkYoBzaATB8IFLHBGJfGE\"" - }, - { - "key": "Date", - "value": "Wed, 01 Mar 2023 09:49:31 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 404,\n \"message\": [\n \"xyz is not chain\"\n ],\n \"error\": \"Not Found\"\n}" - } - ] - }, - { - "name": "resolve schema", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.responseBody", - "var responseBody = pm.response.json()", - "var schemaId = pm.environment.get('schemaId')", - "var author = pm.environment.get('did')", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve newly created schema and hve list of properties in it\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.type).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"modelVersion\")).to.be.true;", - " pm.expect(responseBody.modelVersion).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.id).to.be.a('string')", - " pm.expect(responseBody.id).to.be.equal(schemaId)", - " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"author\")).to.be.true;", - " pm.expect(responseBody.author).to.be.a('string')", - " pm.expect(responseBody.author).to.be.eql(author)", - " pm.expect(responseBody.hasOwnProperty(\"authored\")).to.be.true;", - " pm.expect(responseBody.authored).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"schema\")).to.be.true;", - " pm.expect(responseBody.schema).to.be.a('object')", - " pm.expect(responseBody.schema.hasOwnProperty(\"schema\")).to.be.true;", - " pm.expect(responseBody.schema.schema).to.be.a('string')", - " pm.expect(responseBody.schema.hasOwnProperty(\"description\")).to.be.true;", - " pm.expect(responseBody.schema.description).to.be.a('string')", - " pm.expect(responseBody.schema.hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.schema.type).to.be.a('string')", - " pm.expect(responseBody.schema.type).to.be.equal('object')", - " pm.expect(responseBody.schema.hasOwnProperty(\"properties\")).to.be.true;", - " pm.expect(responseBody.schema.properties).to.be.a('string')", - " pm.expect(responseBody.schema.hasOwnProperty(\"required\")).to.be.true;", - " pm.expect(responseBody.schema.required).to.be.a('array')", - " pm.expect(responseBody.schema.hasOwnProperty(\"additionalProperties\")).to.be.true;", - " pm.expect(responseBody.schema.additionalProperties).to.be.a('boolean')", - " pm.expect(responseBody.hasOwnProperty(\"proof\")).to.be.true;", - " pm.expect(responseBody.proof).to.be.a('object')", - " pm.expect(responseBody.proof.hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.proof.type).to.be.a('string')", - " pm.expect(responseBody.proof.hasOwnProperty(\"created\")).to.be.true;", - " pm.expect(responseBody.proof.created).to.be.a('string')", - " pm.expect(responseBody.proof.hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.proof.verificationMethod).to.be.a('string')", - " pm.expect(responseBody.proof.verificationMethod).to.be.eql(`${author}` + '#key-1')", - " pm.expect(responseBody.proof.hasOwnProperty(\"proofPurpose\")).to.be.true;", - " pm.expect(responseBody.proof.proofPurpose).to.be.a('string')", - " pm.expect(responseBody.proof.proofPurpose).to.be.eql('assertion')", - " pm.expect(responseBody.proof.hasOwnProperty(\"proofValue\")).to.be.true;", - " pm.expect(responseBody.proof.proofValue).to.be.a('string')", - "", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema/{{schemaId}}", - "host": ["{{studio-api-baseUrl}}schema"], - "path": ["{{schemaId}}"] - } - }, - "response": [ - { - "name": "resolve schema", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}schema/{{schemaId}}", - "host": ["{{studio-api-baseUrl}}schema"], - "path": ["{{schemaId}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "749" - }, - { - "key": "ETag", - "value": "W/\"2ed-Lr5Zazfqtiz3XkrxUpiJ/2nRcMc\"" - }, - { - "key": "Date", - "value": "Wed, 15 Feb 2023 10:39:16 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"type\": \"https://w3c-ccg.github.io/vc-json-schemas/v1/schema/1.0/schema.json\",\n \"modelVersion\": \"1.0\",\n \"id\": \"sch:hid:testnet:z3GrkvxjwNHc72y9YZ7sV8AZqhDo9eJJaYbuj1KTY8bBq:1.0\",\n \"name\": \"TicketSchema\",\n \"author\": \"did:hid:testnet:z12cYPtkuzG33qNwP6ZL7LcSaNeTrkLX1eLtkTwCb42ES\",\n \"authored\": \"2023-02-15T09:54:56Z\",\n \"schema\": {\n \"schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"\",\n \"type\": \"object\",\n \"properties\": \"\",\n \"required\": [],\n \"additionalProperties\": false\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-15T09:54:56Z\",\n \"verificationMethod\": \"did:hid:testnet:z12cYPtkuzG33qNwP6ZL7LcSaNeTrkLX1eLtkTwCb42ES#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"6t0B1PuD/E80Lr0zpwTC0zWeSe/+0oTT7TsfTLJTmTvYqwMw4CICEETKTL+754PcTZ8zumzbnV1+l9f7KzLUAQ==\"\n }\n}" - } - ] - } - ] - } - ] - }, - { - "name": "Credentials", - "item": [ - { - "name": "create credential", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:33:19 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token is not passed in header is expired \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "token expired error", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:32:24 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:50:08 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as no request body is passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"subjectDid should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"subjectDid must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"schemaContext should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"schemaContext must be an array\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"type should not be empty\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"type must be an array\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[9]).to.be.equal(\"expirationDate must be a string\")", - " pm.expect(responseBody.message[10]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[11]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[12]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[13]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[14]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[15]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "608" - }, - { - "key": "ETag", - "value": "W/\"260-8SwFbYRP13kTruQxOP1Bhb4mTJ0\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:33:24 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"subjectDid should not be empty\",\n \"subjectDid must be a string\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"schemaContext should not be empty\",\n \"schemaContext must be an array\",\n \"type should not be empty\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty subject", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as subjectDid is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"subjectDid cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "empty subject", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "81" - }, - { - "key": "ETag", - "value": "W/\"51-arJk0VsmxvAAUl2Y1txQ9k0pjh4\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:51:28 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"subjectDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid subjectDid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as subjectDid passed is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subjectDid\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "invalid subjectDid", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "73" - }, - { - "key": "ETag", - "value": "W/\"49-GJ80+Jsh1+mPrHqunWrc1ErGH5k\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:51:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subjectDid\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "issuerDid not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to failas issuerDid field is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"schemaContext should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal( \"schemaContext must be an array\")", - " pm.expect(responseBody.message[4]).to.be.equal( \"type should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"type must be an array\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"expirationDate must be a string\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[9]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[10]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[11]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[12]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[13]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "issuerDid not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "545" - }, - { - "key": "ETag", - "value": "W/\"221-5+NzMJCE03d76ZUBBkf3GJf3c2Q\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:30:49 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"schemaContext should not be empty\",\n \"schemaContext must be an array\",\n \"type should not be empty\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty issuerDid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as issuerDid is empty string\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"issuerDid cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "empty issuerDid", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "80" - }, - { - "key": "ETag", - "value": "W/\"50-Q6AfT/Gjegi9N8P/x8NjP3sBUsI\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:52:35 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"issuerDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid issuerDid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as issuerDid passed is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuerDid\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "invalid issuerDid", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "72" - }, - { - "key": "ETag", - "value": "W/\"48-V0YBWtrysi41hJWGfM2AhXxFVSo\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:52:57 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuerDid\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "neither schemaId nor schemaContext is passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var namespace = JSON.parse(pm.request.body.raw).namespace", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as neither schemaId nor schemaCOntext is passed in request body\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schemaContext should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"schemaContext must be an array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"type should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"type must be an array\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"expirationDate must be a string\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[9]).to.be.equal( \"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[10]).to.be.equal( \"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[11]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "neither schemaId nor schemaContext is passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "484" - }, - { - "key": "ETag", - "value": "W/\"1e4-N8dKT710K7tVde90lGPPFjVRWu4\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:29:17 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schemaContext should not be empty\",\n \"schemaContext must be an array\",\n \"type should not be empty\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "schemaContext is not arrray", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as schemaContext passed in request body is empty array\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"schemaContext should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"type should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"type must be an array\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"expirationDate must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[8]).to.be.equal( \"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[9]).to.be.equal( \"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[10]).to.be.equal(\"persist must be a boolean value\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": []\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "schemaContext is not arrray", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": []\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "451" - }, - { - "key": "ETag", - "value": "W/\"1c3-K8yQLvZl3FhA1fNG36dJEy/UZCM\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:28:54 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schemaContext should not be empty\",\n \"type should not be empty\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "type field must be array", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as type field passed with schemaContext is not an array\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"type should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"type must be an array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"expirationDate must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[9]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": \"RandomCredential\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "type field must be array", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": \"RandomCredential\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "415" - }, - { - "key": "ETag", - "value": "W/\"19f-AAcblC1wmUFu/Om42p0X+BJJm7g\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:28:26 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"type should not be empty\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "type field is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as type field passed with type is empty array\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"type should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"expirationDate must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[6]).to.be.equal( \"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[7]).to.be.equal( \"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\":[],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "type field is empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\":[],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "391" - }, - { - "key": "ETag", - "value": "W/\"187-rAxdU/srrlrQvD4p767lQlTs/jA\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:28:11 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"type should not be empty\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "expirationDate not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as expirationDate field is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"expirationDate must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"persist must be a boolean value\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "expirationDate not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "337" - }, - { - "key": "ETag", - "value": "W/\"151-Jx+ey4bwNo6uUdrcVoGhEV1bDjU\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:09:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "expirationDate is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as expirationDate is empty \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"expirationDate should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[2]).to.be.equal( \"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"persist must be a boolean value\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "expirationDate is empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "330" - }, - { - "key": "ETag", - "value": "W/\"14a-kOPv7APGQAQoaxVJAruuCvbmCOI\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:27:11 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expirationDate should not be empty\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "field is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as field parameter is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[1]).to.be.equal( \"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "field is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "293" - }, - { - "key": "ETag", - "value": "W/\"125-oiPSfMVnJfW1lwMk4PYN3z86JGs\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:26:38 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "field parameter is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as fields parameter passed is empty object\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"fields must be a non-empty object\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "field parameter is empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "293" - }, - { - "key": "ETag", - "value": "W/\"125-oiPSfMVnJfW1lwMk4PYN3z86JGs\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:26:08 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "namespace is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as namespace parameter is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"namespace must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "namespace is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "257" - }, - { - "key": "ETag", - "value": "W/\"101-k3XdJMDX6V8nbm0BYVt621rD37Q\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:25:33 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "namespace is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as namespace is empty string\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "namespace is empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "228" - }, - { - "key": "ETag", - "value": "W/\"e4-SqFi4AAmJm7N5DQ5WDCp7VuM78w\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:25:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"persist must be a boolean value\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "verificationMethodId is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "169" - }, - { - "key": "ETag", - "value": "W/\"a9-bO2WicPIpdcCiUVjKxPf2w1F2kM\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:56:37 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty verificationMethodId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "empty verificationMethodId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "91" - }, - { - "key": "ETag", - "value": "W/\"5b-zP9LI+Oe9F8CDquWcPNgIxi8yfo\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:56:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid verificationMethodId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as verificationMethodId passed is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "invalid verificationMethodId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:57:09 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "persist is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as persist field is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"persist must be a boolean value\")", - "", - " ", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "persist is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-w3jIdwUoG5xhVVSxm2gp4/WqAjk\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:35:34 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "sending wrong parameter in fields", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create a new credential as schemaId passed has only name property and additional property is made false but sending other property than name\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "sending wrong parameter in fields", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "139" - }, - { - "key": "ETag", - "value": "W/\"8b-f4KYwD4RaJSrcoUxl8YMe3KNhQE\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:57:42 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "sending extra property in field", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create a new credential as schemaId passed has only name property and additional property is made false but sending other property with name\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\",\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "sending extra property in field", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\",\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "139" - }, - { - "key": "ETag", - "value": "W/\"8b-f4KYwD4RaJSrcoUxl8YMe3KNhQE\"" - }, - { - "key": "Date", - "value": "Thu, 16 Feb 2023 12:58:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid namespace", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var namespace=JSON.parse( pm.request.body.raw).namespace", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as namespace passed in request body is not valid.It should be testnet but got some other\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "invalid namespace", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "111" - }, - { - "key": "ETag", - "value": "W/\"6f-GHTX8xTtTfuBk7ego9v2Ay35vEE\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:22:13 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create credential without schemaId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const { persist, issuerDid, subjectDid, expirationDate, type, verificationMethodId } = JSON.parse(pm.request.body.raw)", - "const credentialType = type[0]", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create credential without schemaId\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", - " pm.expect(responseBody.credentialDocument).to.be.a('object')", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", - " pm.expect(responseBody.credentialDocument[\"type\"].includes(credentialType))", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.issuer).to.be.eql(issuerDid)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.eql(expirationDate)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(verificationMethodId);", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", - "", - " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", - " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", - "", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.issuer).to.be.eql(issuerDid)", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.eql(expirationDate)", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", - " pm.expect(responseBody.persist).to.be.an(\"boolean\");", - " pm.expect(responseBody.persist).to.be.eql(persist)", - " //vcIdWOS means vcId generated without schemaId", - " pm.environment.set(\"vcIdWOS\", responseBody.credentialDocument.id)", - " pm.environment.set(\"vcDocWOS\",JSON.stringify(responseBody.credentialDocument))", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": [\"RandomCredential\"],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "create credential without schemaId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": [\"RandomCredential\"],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1436" - }, - { - "key": "ETag", - "value": "W/\"59c-2KgRQkWK/gOk0fm8eZ0d3g7UFoE\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 11:36:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://schema.org\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:z7Mz39M9TEpoesPFttubRVjjAHCKNq9Z6naPxHASHxYnB\",\n \"type\": [\n \"VerifiableCredential\",\n \"RandomCredential\"\n ],\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:35:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:z7Mz39M9TEpoesPFttubRVjjAHCKNq9Z6naPxHASHxYnB\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-22T11:36:53Z\",\n \"verificationMethod\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z61gwTaC4tc9RxobKQs1H7bRtAMs8pr6x43RNRWMicS1gSXwm44CyrdnkigziXBN35fVAPDgtS78MyvVE5hXkRJww\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:z7Mz39M9TEpoesPFttubRVjjAHCKNq9Z6naPxHASHxYnB\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:35:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"d072f9428ee6a176d5355ceaac64db067a770cb87fa56cebd36c2f1d920c3636\"\n },\n \"persist\": true\n}" - } - ] - }, - { - "name": "create credential with schemaId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const { persist, issuerDid, subjectDid, expirationDate, verificationMethodId } = JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create credential with schemaId generated at hypersign and persist true\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", - " pm.expect(responseBody.credentialDocument).to.be.a('object')", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.issuer).to.be.eql(issuerDid)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.eql(expirationDate)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(verificationMethodId);", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", - "", - " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", - " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", - "", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.issuer).to.be.eql(issuerDid)", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.eql(expirationDate)", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", - " pm.expect(responseBody.persist).to.be.an(\"boolean\");", - " pm.expect(responseBody.persist).to.be.eql(persist)", - " pm.expect(responseBody.persist).to.be.equal(true)", - " //vcIdPT means vcId generated using schemaId with persist flag true", - " pm.environment.set(\"vcIdPT\", responseBody.credentialDocument.id)", - " pm.environment.set(\"vcDocPT\",JSON.stringify(responseBody.credentialDocument))", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "create credential with schemaId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1703" - }, - { - "key": "ETag", - "value": "W/\"6a7-fYpjoT0/Ri0gRn/pzuflFJBOPbE\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 11:37:39 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:z2a2v3WLRUc9XQfQTc7eSVNtztwQ8Vk2Pw7YVJW2zgmqv\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-22T11:35:53Z\",\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:z2a2v3WLRUc9XQfQTc7eSVNtztwQ8Vk2Pw7YVJW2zgmqv\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-22T11:37:34Z\",\n \"verificationMethod\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z2WRuEUipNnLiDf95c2qxQ3CLkYjZrNCEUZGugRkczWMUscf1mk49TSMt18vQLpa9p8au7ySyyqHkTExyAP2etkTv\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:z2a2v3WLRUc9XQfQTc7eSVNtztwQ8Vk2Pw7YVJW2zgmqv\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:35:53Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"1087a4c4972783078c709720c1684d85c9593b2cfab402416ad2b0ac0811842b\"\n },\n \"persist\": true\n}" - } - ] - }, - { - "name": "create credential with schemaId with persists False", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const { persist, issuerDid, subjectDid, expirationDate, verificationMethodId } = JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to issue credential with schemaId generated at hypersign with persist false\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", - " pm.expect(responseBody.credentialDocument).to.be.a('object')", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.issuer).to.be.eql(issuerDid)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.eql(expirationDate)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(verificationMethodId);", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", - "", - " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", - " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", - "", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.issuer).to.be.eql(issuerDid)", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.eql(expirationDate)", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", - " pm.expect(responseBody.persist).to.be.an(\"boolean\");", - " pm.expect(responseBody.persist).to.be.eql(persist)", - " //vcIdPT means vcId generated using schemaId with persist flag false", - " pm.environment.set(\"vcIdPF\", responseBody.credentialDocument.id)", - " pm.environment.set(\"vcDocPF\",JSON.stringify(responseBody.credentialDocument))", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": false\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "response": [ - { - "name": "credential with PF", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": false\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/issue", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["issue"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1704" - }, - { - "key": "ETag", - "value": "W/\"6a8-oObALeBEdjPMwN0otyI32+s7zPM\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 11:38:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:z8LivzqPMoNe8WCYEAHks2WSmvnUvYUAGPojYQJCNvCZc\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-22T11:36:33Z\",\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:z8LivzqPMoNe8WCYEAHks2WSmvnUvYUAGPojYQJCNvCZc\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-22T11:38:14Z\",\n \"verificationMethod\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z3LJXS4576gfagcAKYKjwaS6TWweM5vwv5mZz53DdkjeEXdm3gpwCrTWPVQRjjvPCaVZJUCUajVvn8GWmQRCMHnjN\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:z8LivzqPMoNe8WCYEAHks2WSmvnUvYUAGPojYQJCNvCZc\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:36:33Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"75a7195ade8ad4e05f83ca4b0920d0f617c0f227999ced3374234deec73a23e6\"\n },\n \"persist\": false\n}" - } - ] - } - ] - }, - { - "name": "credential list", - "item": [ - { - "name": "fail as authtoken is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to get credentail list as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "fail as authtoken is not passed", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Wed, 22 Feb 2023 11:43:20 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to get credentail list as access token passed in header is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 04:48:37 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "negative limit value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to get credentail list as limit is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page =1&limit=-20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "-20" - } - ] - } - }, - "response": [ - { - "name": "negative limit value", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page =1&limit=-20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "-20" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "84" - }, - { - "key": "ETag", - "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 04:49:02 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "negative page value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to get credentail list as page is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page=-1&limit=20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "negative page value", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page=-1&limit=20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 04:49:29 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "fetch credential list", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var page;", - "var limit;", - "var urlString = pm.request.url.toString();", - "var did = pm.environment.get('did')", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "", - "pm.test(\"Should be able to pass and have list of credentialId in response body \", function () {", - " try {", - " page = urlString.match(/page=(\\d+)/)[1];", - " page = (parseInt(page))", - " } catch (e) {", - " page = 1", - " }", - " try {", - " limit = urlString.match(/limit=(\\d+)/)[1];", - " limit = parseInt(limit)", - " } catch (e) {", - " limit = 10", - " }", - " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", - " pm.expect(responseBody.totalCount).to.be.a('number')", - " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", - " pm.expect(responseBody.data).to.be.an(\"array\");", - " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page=1&limit=30", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "30" - } - ] - } - }, - "response": [ - { - "name": "fetch credentail list", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential?page=1&limit=20", - "host": ["{{studio-api-baseUrl}}credential"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "338" - }, - { - "key": "ETag", - "value": "W/\"152-9k2l7IIB0D5Rbvs5+gAsyka+Jus\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 04:49:55 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"totalCount\": 5,\n \"data\": [\n \"vc:hid:testnet:z87DVwi1JHVpgr3Nvvg1eQwakoG5Aq3wUdKJQ5ai3TvZA\",\n \"vc:hid:testnet:zCQA7XnPd5CJa2qsC8b5o1HG3i3eFN134oSGHVHUqmFKE\",\n \"vc:hid:testnet:zHQJahKEnQNFSWgF1aJSZZD3H7Prp1BxzfoortncZ4cUb\",\n \"vc:hid:testnet:zKeT8Re2ZJuVtEQpJaBkofGbMekwqmWzZ6RH37xRcr13\",\n \"vc:hid:testnet:zVj1xGBUMdGEnx7gjQyRWfxLjMs9YdNrXNU1dA34uufQ\"\n ]\n}" - } - ] - } - ] - }, - { - "name": "resolve credential", - "item": [ - { - "name": "fail as authtoken is not passedf", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to resolve credentail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "fail as authtoken is not passed", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 05:59:08 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as access token passed in header is expired \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 06:01:03 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 06:01:41 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "resolve credential created without schemaId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var urlString = pm.request.url.toString()", - "let retrieveCredential;", - "try {", - " retrieveCredential = urlString.match(/retrieveCredential=(\\d+)/)[1];", - "} catch (e) {", - " retrieveCredential = false", - "}", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve credential and get CredentialStatus only as retrieveCredential set to false\", function () {", - "", - " const vcId = pm.environment.get('vcIdWOS')", - " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", - " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", - "", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", - "", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", - "", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", - " const did = pm.environment.get('did')", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", - " pm.expect(responseBody.persist).to.be.an(\"boolean\");", - " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", - " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", - " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "resolve credential created without schemaId", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "764" - }, - { - "key": "ETag", - "value": "W/\"2fc-sBLzICRd4Md6pL3w4q86AI3nUH0\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 06:31:04 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\",\n \"issuanceDate\": \"2023-02-24T05:40:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"7e4415ce3a4ca86db549938254dc950a8642398b89f4abe451fccf957aacb77e\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T05:40:54Z\",\n \"updated\": \"2023-02-24T05:40:54Z\",\n \"verificationMethod\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"jod36ApBFk8T0c07FuwCYh6sloeUw++IEEca29KLVAm6V03hMTIVMjfDuTTlzhhNuBtgh38EUdexhicE1hwyAQ==\"\n }\n },\n \"persist\": true,\n \"retrieveCredential\": false\n}" - } - ] - }, - { - "name": "resolve credential created without schemaId and fetch credDoc", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "let queryRetrieveCredential = pm.request.url.query.toObject()", - "let retrieveCredential = false", - "if (queryRetrieveCredential != {}) {", - " retrieveCredential = JSON.parse(queryRetrieveCredential['retrieveCredential'])", - "}", - "console.log(retrieveCredential)", - "const vcId = pm.environment.get('vcIdWOS')", - "const did = pm.environment.get('did')", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve credential and get CredentialStatus as well credential document as retrieveCredential set to true and persist is set to true at the time of creating credential\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", - " pm.expect(responseBody.credentialDocument).to.be.a('object')", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", - " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.equal(vcId)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", - "", - " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", - " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", - " pm.expect(responseBody.persist).to.be.an(\"boolean\");", - " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", - " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", - " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}?retrieveCredential=true", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"], - "query": [ - { - "key": "retrieveCredential", - "value": "true" - } - ] - } - }, - "response": [ - { - "name": "resolve credential created without schemaId and fetch credDoc", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}?retrieveCredential=true", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdWOS}}"], - "query": [ - { - "key": "retrieveCredential", - "value": "true" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1785" - }, - { - "key": "ETag", - "value": "W/\"6f9-2p9VwgbWgQ604sBQgBlDIBez3UY\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 07:11:41 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://schema.org\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"type\": [\n \"VerifiableCredential\",\n \"RandomCredential\"\n ],\n \"issuer\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\",\n \"issuanceDate\": \"2023-02-24T05:40:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T05:42:34Z\",\n \"verificationMethod\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z4HSzbtw7Znup2MGWTFj6UFoFpcCJoZ32gcniBQffaq8BVZ3vsGNq49smtAfiq1ama5EgRjgnwA96aZb7sJn7qjq2\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\",\n \"issuanceDate\": \"2023-02-24T05:40:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"7e4415ce3a4ca86db549938254dc950a8642398b89f4abe451fccf957aacb77e\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T05:40:54Z\",\n \"updated\": \"2023-02-24T05:40:54Z\",\n \"verificationMethod\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"jod36ApBFk8T0c07FuwCYh6sloeUw++IEEca29KLVAm6V03hMTIVMjfDuTTlzhhNuBtgh38EUdexhicE1hwyAQ==\"\n }\n },\n \"persist\": true,\n \"retrieveCredential\": true\n}" - } - ] - }, - { - "name": "resolve credential created schemaId and persist true", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "let queryRetrieveCredential = pm.request.url.query.toObject()", - "let retrieveCredential = false", - "if (queryRetrieveCredential != {}) {", - " retrieveCredential = JSON.parse(queryRetrieveCredential['retrieveCredential'])", - "}", - "const vcId = pm.environment.get('vcIdPT')", - "const did = pm.environment.get('did')", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve credential and get CredentialStatus and credential document as retrieveCredential set to true and persist is set to true at the time of creating credential\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", - " pm.expect(responseBody.credentialDocument).to.be.a('object')", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", - " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.equal(vcId)", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", - "", - " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", - "", - " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", - "", - " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", - " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", - " pm.expect(responseBody.persist).to.be.an(\"boolean\");", - " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", - " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", - " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdPT}}?retrieveCredential=true", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdPT}}"], - "query": [ - { - "key": "retrieveCredential", - "value": "true" - } - ] - } - }, - "response": [ - { - "name": "resolve credential created schemaId and persist true", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdPT}}?retrieveCredential=true", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdPT}}"], - "query": [ - { - "key": "retrieveCredential", - "value": "true" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "2057" - }, - { - "key": "ETag", - "value": "W/\"809-nC6w99xlbTs88mI9jI7ok5PyjQs\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 08:06:55 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:zDDwvfe8xSdUbyVs9AhYGRLwSwqe6UUKeTXYasJhrczf9\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-24T08:04:36Z\",\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:zDDwvfe8xSdUbyVs9AhYGRLwSwqe6UUKeTXYasJhrczf9\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T08:06:16Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z4JnGK9StrYcoepoeRJjvtCaJs8b99ZMTiEiA6bfNpeRGSWxTmWRVv31QKNd2c2rzan5Zkqe11GPntxH81mNtZB6r\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zDDwvfe8xSdUbyVs9AhYGRLwSwqe6UUKeTXYasJhrczf9\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T08:04:36Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"b78ddf223d4ae50a3ce9eeeaba1b160a86da467cb4ac53bcd9343cf76bdfcbce\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T08:04:36Z\",\n \"updated\": \"2023-02-24T08:04:36Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"AJOZG5UaxNelDUaRv/GYx7Akm6PlnvsulZiczxSPYlfHZGPOMCHDlLdlDirwLxZ+A6F3RbqlV0RgoFzOV3FdCw==\"\n }\n },\n \"persist\": true,\n \"retrieveCredential\": true\n}" - } - ] - }, - { - "name": "resolve credential created schemaId and persist false", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "let queryRetrieveCredential = pm.request.url.query.toObject()", - "let retrieveCredential = false", - "if (queryRetrieveCredential != {}) {", - " retrieveCredential = JSON.parse(queryRetrieveCredential['retrieveCredential'])", - "}", - "const vcId = pm.environment.get('vcIdPF')", - "const did = pm.environment.get('did')", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to resolve credential and get only credentialStaus not credDoc even if retrieveCredential is set true as credential is creted with persist flag false\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", - " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", - " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", - " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", - " pm.expect(responseBody.persist).to.be.eql(false);", - "", - " pm.expect(responseBody.persist).to.be.an(\"boolean\");", - " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", - " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", - " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdPF}}?retrieveCredential=true", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdPF}}"], - "query": [ - { - "key": "retrieveCredential", - "value": "true" - } - ] - } - }, - "response": [ - { - "name": "resolve credential created schemaId and persist false", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential/{{vcIdPF}}?retrieveCredential=true", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["{{vcIdPF}}"], - "query": [ - { - "key": "retrieveCredential", - "value": "true" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "766" - }, - { - "key": "ETag", - "value": "W/\"2fe-WdI7AJyRd5c03qwMw/5lO8UmwQM\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 08:32:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zG5xQoW87kWtcXS7xsGaFYQ5jc41T9CbhRPbKxyMpKCFL\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T08:04:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"277bd2320240363fd6b5a78e6a53072b7a102c918d773be99d0bb54faf2bf25d\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T08:04:55Z\",\n \"updated\": \"2023-02-24T08:04:55Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"jyDeF+wnN7NsLuxhHiuklgvFxWZlEZiZ9b/vjy/Siqq0jeHOLahnSGaTGCu38KtPcxa+4C8uwp7jT8E0uAFODA==\"\n }\n },\n \"persist\": false,\n \"retrieveCredential\": true\n}" - } - ] - } - ] - }, - { - "name": "update credential", - "item": [ - { - "name": "fail as access token not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update credentail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "fail as access token not passed", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 08:37:04 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential status as token passed is expired \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 08:51:38 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 08:54:40 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as no request body is passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"namespace must be a string\")", - " ", - " pm.expect(responseBody.message[2]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "352" - }, - { - "key": "ETag", - "value": "W/\"160-7TCMGX7LywAnjIT8BP+CBhQKT6g\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:18:17 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty namespace", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as namespace is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\") ", - " pm.expect(responseBody.message[1]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "empty namespace", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "323" - }, - { - "key": "ETag", - "value": "W/\"143-L7Dq+2/Y4aVC1KA7e3kbCO+xCX8\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:20:43 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid namespace passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as namespace is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\") ", - " pm.expect(responseBody.message[1]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "invalid namespace passed", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "323" - }, - { - "key": "ETag", - "value": "W/\"143-L7Dq+2/Y4aVC1KA7e3kbCO+xCX8\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:21:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "status is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as status is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - "", - " pm.expect(responseBody.message[0]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "status is not passed", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "264" - }, - { - "key": "ETag", - "value": "W/\"108-KiGuE6Tmrb2houF4Cn1fU2zl3vg\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:23:13 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty status field", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as issuerDid field is empty or invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - "", - " pm.expect(responseBody.message[0]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "empty status field", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "264" - }, - { - "key": "ETag", - "value": "W/\"108-KiGuE6Tmrb2houF4Cn1fU2zl3vg\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:25:04 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "issuerDid not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as issuerDid is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"issuerDid should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"issuerDid must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId must be a string\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "issuerDid not passed", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "196" - }, - { - "key": "ETag", - "value": "W/\"c4-tYSg0PfdScPMshtasZNNqCGb/LY\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:26:58 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "issuerDid is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as issuerDid is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"issuerDid cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "issuerDid is empty", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "80" - }, - { - "key": "ETag", - "value": "W/\"50-Q6AfT/Gjegi9N8P/x8NjP3sBUsI\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:30:12 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"issuerDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid issuerDid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as invalid issuerDid is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuerDid\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"abc\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "invalid issuerDid", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"abc\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "72" - }, - { - "key": "ETag", - "value": "W/\"48-V0YBWtrysi41hJWGfM2AhXxFVSo\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:31:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuerDid\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as verificationMethodId not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "verificationMethodId not passed", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "135" - }, - { - "key": "ETag", - "value": "W/\"87-1I6WNb76erNPjLJ7LVf3pHrA/dI\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:33:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verificationMethodId is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as verificationMethodId is empty \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "verificationMethodId is empty", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "91" - }, - { - "key": "ETag", - "value": "W/\"5b-zP9LI+Oe9F8CDquWcPNgIxi8yfo\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:36:18 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid verificationMethodId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as verificationMethodId is empty \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"abc\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "invalid verificationMethodId", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"abc\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 09:38:03 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "updated credential status", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const vcId = pm.environment.get('vcIdWOS')", - "const did = pm.environment.get('did')", - "const {status}= JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"should be able to suspend the credential status\", function () {", - " ", - " pm.expect(responseBody.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.claim).to.be.an(\"object\");", - " pm.expect(responseBody.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.claim.id).to.be.an(\"string\");", - " pm.expect(responseBody.claim.id).to.be.eql(vcId)", - " pm.expect(responseBody.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.claim.currentStatus).to.be.eql(\"Suspended\");", - " pm.expect(responseBody.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.claim.statusReason).to.be.eql(`Credential is suspended`);", - " pm.expect(responseBody.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.proof.type).to.be.equal(\"Ed25519Signature2020\");", - " pm.expect(responseBody.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.proof.created).to.be.a(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.proof.proofPurpose).to.be.equal(\"assertion\");", - " pm.expect(responseBody.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.proof.proofValue).to.be.a(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty(\"updated\")).to.be.true;", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "updated credential status", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "711" - }, - { - "key": "ETag", - "value": "W/\"2c7-hRLXtU5gwD7UkR6aidTh4oMGRhI\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:13:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"claim\": {\n \"id\": \"vc:hid:testnet:zBwMKce1fa38gsbiE8nw5mxJBdQahGx7pHewUMqPt2xYM\",\n \"currentStatus\": \"Suspended\",\n \"statusReason\": \"Credential is suspended\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T10:11:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"eeacda44b2b6ee92d161ff49df75cbf7b4d069aa6cc63b110c9f0993f811dc88\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T10:11:12Z\",\n \"updated\": \"2023-02-24T10:11:42Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"RNuNqik/PcF0GYGQyin1IWNVAEBodNRuHBbU5uhCbIm7FDF8cqBl1G3VaS8yvVaRbXLdrGHEkt0u4Davt+AbDg==\"\n }\n}" - } - ] - }, - { - "name": "credential already suspended", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const vcId= pm.environment.get(\"vcIdWOS\")", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential as credential is already suspended\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(`${vcId} is already suspended`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "credential already suspended", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "367" - }, - { - "key": "ETag", - "value": "W/\"16f-JSnJYb+POtlXVpCTnKX+8cR0BEE\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:20:03 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: credential claim status is already Suspended: Invalid Credential Status [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_credential.go:288] With gas wanted: '0' and gas used: '57146' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "updated credential status to live from suspended", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const vcId = pm.environment.get('vcIdWOS')", - "const did = pm.environment.get('did')", - "const {status}= JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"should be able to able to LIVE the suspended credential\", function () {", - " ", - " pm.expect(responseBody.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.claim).to.be.an(\"object\");", - " pm.expect(responseBody.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.claim.id).to.be.an(\"string\");", - " pm.expect(responseBody.claim.id).to.be.eql(vcId)", - " pm.expect(responseBody.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.claim.currentStatus).to.be.eql(\"Live\");", - " pm.expect(responseBody.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.claim.statusReason).to.be.eql(`Credential is live`);", - " pm.expect(responseBody.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.proof.type).to.be.equal(\"Ed25519Signature2020\");", - " pm.expect(responseBody.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.proof.created).to.be.a(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.proof.proofPurpose).to.be.equal(\"assertion\");", - " pm.expect(responseBody.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.proof.proofValue).to.be.a(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty(\"updated\")).to.be.true;", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "updated credential status to live", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "701" - }, - { - "key": "ETag", - "value": "W/\"2bd-zIVLEa5WhvJDJJgDSzuP10USyZc\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:23:40 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"claim\": {\n \"id\": \"vc:hid:testnet:zBwMKce1fa38gsbiE8nw5mxJBdQahGx7pHewUMqPt2xYM\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is live\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T10:11:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"eeacda44b2b6ee92d161ff49df75cbf7b4d069aa6cc63b110c9f0993f811dc88\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T10:11:12Z\",\n \"updated\": \"2023-02-24T10:21:52Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"GgSmDJe4ReheoaGwNM8K8EIApsHHgZUXCNZaN7NTy6eqV6x7DiJbNyYEQWNB9uZaSyoky13mtDNlw4shHlZrDQ==\"\n }\n}" - } - ] - }, - { - "name": "credential already live", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const vcId= pm.environment.get(\"vcIdWOS\")", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential status to live as credential status is already live\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(`${vcId} is already live`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "credential already live", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "362" - }, - { - "key": "ETag", - "value": "W/\"16a-crgLOEtstOUHWUvGTXELfxe4Az8\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:26:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: credential claim status is already Live: Invalid Credential Status [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_credential.go:264] With gas wanted: '0' and gas used: '57016' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "revoke the credential status", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const vcId = pm.environment.get('vcIdWOS')", - "const did = pm.environment.get('did')", - "const {status}= JSON.parse(pm.request.body.raw)", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"should be able to able to revoke the credential\", function () {", - " ", - " pm.expect(responseBody.hasOwnProperty('claim')).to.be.true;", - " pm.expect(responseBody.claim).to.be.an(\"object\");", - " pm.expect(responseBody.claim.hasOwnProperty('id')).to.be.true;", - " pm.expect(responseBody.claim.id).to.be.an(\"string\");", - " pm.expect(responseBody.claim.id).to.be.eql(vcId)", - " pm.expect(responseBody.claim.hasOwnProperty('currentStatus')).to.be.true;", - " pm.expect(responseBody.claim.currentStatus).to.be.an(\"string\");", - " pm.expect(responseBody.claim.currentStatus).to.be.eql(\"Revoked\");", - " pm.expect(responseBody.claim.hasOwnProperty('statusReason')).to.be.true;", - " pm.expect(responseBody.claim.statusReason).to.be.an(\"string\");", - " pm.expect(responseBody.claim.statusReason).to.be.eql(`Credential is revoked`);", - " pm.expect(responseBody.hasOwnProperty('issuer')).to.be.true;", - " pm.expect(responseBody.issuer).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('issuanceDate')).to.be.true;", - " pm.expect(responseBody.issuanceDate).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('expirationDate')).to.be.true;", - " pm.expect(responseBody.expirationDate).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty('credentialHash')).to.be.true;", - " pm.expect(responseBody.credentialHash).to.be.an(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty('type')).to.be.true;", - " pm.expect(responseBody.proof.type).to.be.a(\"string\");", - " pm.expect(responseBody.proof.type).to.be.equal(\"Ed25519Signature2020\");", - " pm.expect(responseBody.proof.hasOwnProperty('created')).to.be.true;", - " pm.expect(responseBody.proof.created).to.be.a(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty('verificationMethod')).to.be.true;", - " pm.expect(responseBody.proof.verificationMethod).to.be.a(\"string\");", - " pm.expect(responseBody.proof.verificationMethod).to.be.equal(`${did}#key-1`);", - "", - " pm.expect(responseBody.proof.hasOwnProperty('proofPurpose')).to.be.true;", - " pm.expect(responseBody.proof.proofPurpose).to.be.a(\"string\");", - " pm.expect(responseBody.proof.proofPurpose).to.be.equal(\"assertion\");", - " pm.expect(responseBody.proof.hasOwnProperty('proofValue')).to.be.true;", - " pm.expect(responseBody.proof.proofValue).to.be.a(\"string\");", - " pm.expect(responseBody.proof.hasOwnProperty(\"updated\")).to.be.true;", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"REVOKE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "revoke the credential status", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"REVOKE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "707" - }, - { - "key": "ETag", - "value": "W/\"2c3-isQLkRYd5AKAxbRUbIH+OsUkkmY\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:29:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"claim\": {\n \"id\": \"vc:hid:testnet:zBwMKce1fa38gsbiE8nw5mxJBdQahGx7pHewUMqPt2xYM\",\n \"currentStatus\": \"Revoked\",\n \"statusReason\": \"Credential is revoked\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T10:11:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"eeacda44b2b6ee92d161ff49df75cbf7b4d069aa6cc63b110c9f0993f811dc88\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T10:11:12Z\",\n \"updated\": \"2023-02-24T10:27:31Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"M8P0bb0rwsm/9oO7B+8+aERbaCe3wMsXmbFNbHV/aJCkT1Zm281+BEZ0TsJPM/Gnpm8IBVOFeyDfFaka7SFNBw==\"\n }\n}" - } - ] - }, - { - "name": "revoke to live", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const vcId= pm.environment.get(\"vcIdWOS\")", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update credential to live as its status is revoked\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"status cannot be updated from Revoked to Live\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "response": [ - { - "name": "revoke to live", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["status", "{{vcIdWOS}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "385" - }, - { - "key": "ETag", - "value": "W/\"181-D5uRGK/wCov0WsEZVnpI1K9Y/EA\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:32:44 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: credential claim status cannot be updated from Revoked to Live: Invalid Credential Status [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_credential.go:301] With gas wanted: '0' and gas used: '57034' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - } - ] - }, - { - "name": "verify credential", - "item": [ - { - "name": "fail as access token not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to verify credentail as access token is not passed in header \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "fail as access token not passed", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:40:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to fail token passed in header is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:48:25 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to verify credential as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 10:57:14 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to verify credential requestBody is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocument must be a non-empty object\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "100" - }, - { - "key": "ETag", - "value": "W/\"64-Ez6M0JYyWKY+n0FFHhgvpL1ld9Q\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 11:04:32 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocument must be a non-empty object\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "credentialDocument is empty object", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to verify credential requestBody is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocument.@context should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"credentialDocument.@context must be an array\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"credentialDocument.id must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"credentialDocument.type should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"credentialDocument.type must be an array\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"credentialDocument.expirationDate must be a string\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"credentialDocument.expirationDate should not be empty\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"credentialDocument.issuanceDate must be a string\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"credentialDocument.issuanceDate should not be empty\")", - " pm.expect(responseBody.message[9]).to.be.equal(\"credentialDocument.issuer must be a string\")", - " pm.expect(responseBody.message[10]).to.be.equal(\"credentialDocument.credentialSubject must be a non-empty object\")", - " pm.expect(responseBody.message[11]).to.be.equal(\"credentialDocument.credentialStatus must be a non-empty object\")", - " pm.expect(responseBody.message[12]).to.be.equal(\"credentialDocument.proof must be a non-empty object\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocument\" :{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "credentialDocument is empty object", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocument\" :{}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "723" - }, - { - "key": "ETag", - "value": "W/\"2d3-LIrRYrM0p1lMzMwAxZkDSfp+A8o\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 11:48:34 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocument.@context should not be empty\",\n \"credentialDocument.@context must be an array\",\n \"credentialDocument.id must be a string\",\n \"credentialDocument.type should not be empty\",\n \"credentialDocument.type must be an array\",\n \"credentialDocument.expirationDate must be a string\",\n \"credentialDocument.expirationDate should not be empty\",\n \"credentialDocument.issuanceDate must be a string\",\n \"credentialDocument.issuanceDate should not be empty\",\n \"credentialDocument.issuer must be a string\",\n \"credentialDocument.credentialSubject must be a non-empty object\",\n \"credentialDocument.credentialStatus must be a non-empty object\",\n \"credentialDocument.proof must be a non-empty object\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verifying revoked credetial", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to verify and its result is false as credential is revoked\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"verified\")).to.be.true;", - " pm.expect(responseBody.verified).to.be.a('boolean')", - " pm.expect(responseBody.verified).to.be.equal(false)", - "", - " pm.expect(responseBody.hasOwnProperty(\"results\")).to.be.true;", - " pm.expect(responseBody.results).to.be.an(\"array\");", - " pm.expect(responseBody.results[0].hasOwnProperty(\"proof\")).to.be.true;", - " pm.expect(responseBody.results[0].proof).to.be.an(\"object\");", - "", - " pm.expect(responseBody.results[0].hasOwnProperty(\"verified\")).to.be.true;", - " pm.expect(responseBody.results[0].verified).to.be.an(\"boolean\");", - " pm.expect(responseBody.results[0].verified).to.be.equal(true);", - " pm.expect(responseBody.results[0].hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod).to.be.an(\"object\");", - "", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod.id).to.be.a('string');", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod.type).to.be.a('string');", - " pm.expect(responseBody.results[0].verificationMethod.type).to.be.eql(\"Ed25519VerificationKey2020\");", - "", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty('controller')).to.be.true", - " pm.expect(responseBody.results[0].verificationMethod.controller).to.be.a('string');", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod.publicKeyMultibase).to.be.a('string');", - "", - " pm.expect(responseBody.results[0].purposeResult).to.be.an(\"object\");", - " pm.expect(responseBody.results[0].purposeResult.hasOwnProperty(\"valid\")).to.be.true;", - " pm.expect(responseBody.results[0].purposeResult.valid).to.be.a('boolean');", - "", - " pm.expect(responseBody.results[0].purposeResult.valid).to.be.eql(true);", - "", - " pm.expect(responseBody.hasOwnProperty(\"statusResult\")).to.be.true;", - " pm.expect(responseBody.statusResult).to.be.a('object')", - " pm.expect(responseBody.statusResult.hasOwnProperty(\"verified\")).to.be.true;", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocument\":{{vcDocWOS}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "verifying revoked credetial", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocument\":{{vcDocWOS}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "824" - }, - { - "key": "ETag", - "value": "W/\"338-hPd/o0FPzTav7b4UephEvIoEOPA\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 12:14:18 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"verified\": false,\n \"results\": [\n {\n \"proof\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://schema.org\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T11:41:03Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z5CEJmRnsyzWER5Z2EsDUKEZAFfDejNnE3FCmet75WUAiXUprUWbeHPibCeXjEZpHxZVgs6WNeEe1vUvN6ZCtw62P\"\n },\n \"verified\": true,\n \"verificationMethod\": {\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"publicKeyMultibase\": \"z6Mkw7aRvWZTBt8PHLEa9oN9JcoCv1ZS7YwnZmicLMpwdi8W\"\n },\n \"purposeResult\": {\n \"valid\": true\n }\n }\n ],\n \"statusResult\": {\n \"verified\": false\n }\n}" - } - ] - }, - { - "name": "verifying live credential", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to verify and its result will be true as credential is live\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"verified\")).to.be.true;", - " pm.expect(responseBody.verified).to.be.a('boolean')", - " pm.expect(responseBody.verified).to.be.equal(true)", - "", - " pm.expect(responseBody.hasOwnProperty(\"results\")).to.be.true;", - " pm.expect(responseBody.results).to.be.an(\"array\");", - " pm.expect(responseBody.results[0].hasOwnProperty(\"proof\")).to.be.true;", - " pm.expect(responseBody.results[0].proof).to.be.an(\"object\");", - "", - " pm.expect(responseBody.results[0].hasOwnProperty(\"verified\")).to.be.true;", - " pm.expect(responseBody.results[0].verified).to.be.an(\"boolean\");", - " pm.expect(responseBody.results[0].verified).to.be.equal(true);", - " pm.expect(responseBody.results[0].hasOwnProperty(\"verificationMethod\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod).to.be.an(\"object\");", - "", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod.id).to.be.a('string');", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod.type).to.be.a('string');", - " pm.expect(responseBody.results[0].verificationMethod.type).to.be.eql(\"Ed25519VerificationKey2020\");", - "", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty('controller')).to.be.true", - " pm.expect(responseBody.results[0].verificationMethod.controller).to.be.a('string');", - " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", - " pm.expect(responseBody.results[0].verificationMethod.publicKeyMultibase).to.be.a('string');", - "", - " pm.expect(responseBody.results[0].purposeResult).to.be.an(\"object\");", - " pm.expect(responseBody.results[0].purposeResult.hasOwnProperty(\"valid\")).to.be.true;", - " pm.expect(responseBody.results[0].purposeResult.valid).to.be.a('boolean');", - "", - " pm.expect(responseBody.results[0].purposeResult.valid).to.be.eql(true);", - "", - " pm.expect(responseBody.hasOwnProperty(\"statusResult\")).to.be.true;", - " pm.expect(responseBody.statusResult).to.be.a('object')", - " pm.expect(responseBody.statusResult.hasOwnProperty(\"verified\")).to.be.true;", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocument\":{{vcDocPF}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "verifying live credential", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocument\":{{vcDocPF}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}credential/verify", - "host": ["{{studio-api-baseUrl}}credential"], - "path": ["verify"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "966" - }, - { - "key": "ETag", - "value": "W/\"3c6-RN3kcEkZ67HaRzZyzexUlz0yDG8\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 12:18:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"verified\": true,\n \"results\": [\n {\n \"proof\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T11:41:43Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z3dZH8ScvAk5XoGY8rofiKhpmtBo4qX54Q4RJuz2b4GgHmko6fo8VjVGYjifYigVFNRn49zmuGAxJ5AHkzyVbnaw3\"\n },\n \"verified\": true,\n \"verificationMethod\": {\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"publicKeyMultibase\": \"z6Mkw7aRvWZTBt8PHLEa9oN9JcoCv1ZS7YwnZmicLMpwdi8W\"\n },\n \"purposeResult\": {\n \"valid\": true\n }\n }\n ],\n \"statusResult\": {\n \"verified\": true\n }\n}" - } - ] - } - ] - } - ] - }, - { - "name": "Presentation template", - "item": [ - { - "name": "create template", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create presentation template as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 13:01:38 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create presentation template as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 13:16:22 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 13:22:45 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template as request body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"domain must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"name should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"name must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"query must be an array\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "214" - }, - { - "key": "ETag", - "value": "W/\"d6-9nDeY03zh8l/v2Gmb+HXjNd1I7E\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 13:32:24 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\",\n \"domain must be a string\",\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty domain", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template domain is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"name should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"name must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"query must be an array\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "empty domain", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "188" - }, - { - "key": "ETag", - "value": "W/\"bc-/DMmeCxBykL5TZYHBOxNMbUDbcE\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 13:45:36 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\",\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid domain", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template domain is invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"name should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"name must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"query must be an array\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "invalid domain", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "159" - }, - { - "key": "ETag", - "value": "W/\"9f-c97jiEp4C2R6LIUF//9F+cgbot8\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 13:47:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "name is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template domain is invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"name should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"name must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"query must be an array\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "name is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "128" - }, - { - "key": "ETag", - "value": "W/\"80-fY2gU735uH3d16LA5wA+ivOyE/o\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 14:07:24 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "name is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template name is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"name cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "name is empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "75" - }, - { - "key": "ETag", - "value": "W/\"4b-cO/E+dioAAgfZYBhLTgd5w5H5OM\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 14:15:42 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"name cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "query field is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template query field is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"query must be an array\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "query is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "77" - }, - { - "key": "ETag", - "value": "W/\"4d-i3QBiui3/f+whjQIYTcHmDvafs4\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 14:17:16 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "query is not array", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template query field is not of type array\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"query must be an array\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"nested property query must be either object or array\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "query is not array", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "132" - }, - { - "key": "ETag", - "value": "W/\"84-7h9y70jfWpj1KBW8twoq066Q0hA\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 14:19:50 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query must be an array\",\n \"nested property query must be either object or array\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create template with empty query", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create presentation template\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", - " pm.expect(responseBody.appId).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", - " pm.expect(responseBody.domain).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", - " pm.expect(responseBody.query).to.be.a(\"array\")", - " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " pm.environment.set(\"templateId\", responseBody._id)", - " pm.environment.set(\"templateName\", responseBody.name)", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "create template with empty query", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "146" - }, - { - "key": "ETag", - "value": "W/\"92-SWsGRKlotuO1i+z54aDlwfv5zFc\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 14:27:21 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate\",\n \"_id\": \"63f8c949a713f85a8ea2a13d\",\n \"__v\": 0\n}" - } - ] - }, - { - "name": "duplicate name error", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const templateName= pm.environment.get('templateName')", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template as template name already exist.It should be unique for particular app\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Template name must be unique\")", - " pm.expect(responseBody.message[1]).to.be.equal(`${templateName} already exists`)", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName}}\",\n \"query\":[]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "duplicate name", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName}}\",\n \"query\":[[]]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "113" - }, - { - "key": "ETag", - "value": "W/\"71-kD1WIrOkn/WE0wwqsojZM7wtC2k\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 14:30:09 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Template name must be unique\",\n \"DemoTemplate already exists\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid id in query", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template id passed in query field under credentialSubjecct is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid id\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"did:hid:testnet:.............................\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "invalid id in query", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"did:hid:testnet:.............................\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "65" - }, - { - "key": "ETag", - "value": "W/\"41-na6SRevQGHjq8mnH/gMyPqUL9ZQ\"" - }, - { - "key": "Date", - "value": "Sat, 25 Feb 2023 23:46:25 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid id\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid issuer in query", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template as issuer passed in query field under credentialSchema is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuer\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "invalid issuer in query", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "69" - }, - { - "key": "ETag", - "value": "W/\"45-5/Fb0s8Sxcu+q3beCr/VdFe/jXI\"" - }, - { - "key": "Date", - "value": "Sat, 25 Feb 2023 23:48:05 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuer\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid trusted issuer in query", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template as invalid trustedIssuer is passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuer\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "invalid trusted issuer in query", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "69" - }, - { - "key": "ETag", - "value": "W/\"45-5/Fb0s8Sxcu+q3beCr/VdFe/jXI\"" - }, - { - "key": "Date", - "value": "Sat, 25 Feb 2023 23:50:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuer\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid trusted issuer in query Copy", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template as invalid type is passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuer\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "invalid trusted issuer in query", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "69" - }, - { - "key": "ETag", - "value": "W/\"45-5/Fb0s8Sxcu+q3beCr/VdFe/jXI\"" - }, - { - "key": "Date", - "value": "Sat, 25 Feb 2023 23:50:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuer\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid type in query", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation template as query type passed is invalid passed in query field under credentialSubjecct is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"query.0.type must be one of the following values: QueryByExample, QueryByFrame, DIDAuthentication\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template57h\",\n \"query\":[\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "invalid type in query", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template57h\",\n \"query\":[\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "152" - }, - { - "key": "ETag", - "value": "W/\"98-45B7Qnrlrx83KhXSN0y8NT23UUE\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 00:49:26 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query.0.type must be one of the following values: QueryByExample, QueryByFrame, DIDAuthentication\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create template with all query fields", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create presentation template\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", - " pm.expect(responseBody.appId).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", - " pm.expect(responseBody.domain).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", - " pm.expect(responseBody.query).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.query[0].type).to.be.a(\"string\")", - " pm.expect(responseBody.query[0].hasOwnProperty(\"credentialQuery\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"required\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].required).to.be.a(\"boolean\")", - " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"reason\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].reason).to.be.a(\"string\")", - " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"example\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example).to.be.a(\"object\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['@context']).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['type']).to.be.a(\"string\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSubject\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSubject']).to.be.a(\"object\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSchema\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSchema']).to.be.a(\"object\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"trustedIssuer\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer']).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.trustedIssuer[0].hasOwnProperty(\"required\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer'][0].required).to.be.a(\"boolean\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " pm.environment.set(\"templateId2\", responseBody._id)", - " pm.environment.set(\"templateName2\", responseBody.name)", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "create template with all query fields", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template45\",\n \"query\":[\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "494" - }, - { - "key": "ETag", - "value": "W/\"1ee-n+HFKE1aQ40FkfTpDj8h+DKEPBs\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:18:54 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"DemoTemplate45\",\n \"_id\": \"63fab37ea0b683c8f2d96203\",\n \"__v\": 0\n}" - } - ] - } - ] - }, - { - "name": "template list", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to fetch presentation template list as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:22:51 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to get presentation template list as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:23:26 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to get presentation template list as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:24:03 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "negative limit value", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to fetch template list as limit is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template?page =1&limit=-20", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "-20" - } - ] - } - }, - "response": [ - { - "name": "negative limit value", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template?page =1&limit=-20", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"], - "query": [ - { - "key": "page ", - "value": "1" - }, - { - "key": "limit", - "value": "-20" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "84" - }, - { - "key": "ETag", - "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:26:48 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "negative page value Copy", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Shouldnot be able to get template list as page is negative or 0\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template?page=-1&limit=20", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "response": [ - { - "name": "negative page value Copy", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template?page=-1&limit=20", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"], - "query": [ - { - "key": "page", - "value": "-1" - }, - { - "key": "limit", - "value": "20" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:27:13 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "fetch template list", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "var page;", - "var limit;", - "var urlString = pm.request.url.toString();", - "var did = pm.environment.get('did')", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "", - "pm.test(\"Should be able to and have list of dids in response body \", function () {", - " try {", - " page = urlString.match(/page=(\\d+)/)[1];", - " page = (parseInt(page))", - " } catch (e) {", - " page = 1", - " }", - " try {", - " limit = urlString.match(/limit=(\\d+)/)[1];", - " limit = parseInt(limit)", - " } catch (e) {", - " limit = 10", - " }", - " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", - " pm.expect(responseBody.totalCount).to.be.a('number')", - " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", - " pm.expect(responseBody.data).to.be.an(\"array\");", - " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template?page=1&limit=10", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "10" - } - ] - } - }, - "response": [ - { - "name": "fetch template list", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template?page=1&limit=10", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"], - "query": [ - { - "key": "page", - "value": "1" - }, - { - "key": "limit", - "value": "10" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "3541" - }, - { - "key": "ETag", - "value": "W/\"dd5-96twqPPu7G2XdkWvxPu2YzNF5Nk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:37:28 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"totalCount\": 22,\n \"data\": [\n {\n \"_id\": \"63f8c7cda713f85a8ea2a133\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"testtemplate\",\n \"__v\": 0\n },\n {\n \"_id\": \"63f8c902a713f85a8ea2a137\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"testTemplate\",\n \"__v\": 0\n },\n {\n \"_id\": \"63f8c949a713f85a8ea2a13d\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faa9a4f54ca023fbb5f43e\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"DemoTemplate3\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faaa31f83c9c5dc6d4b6ea\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate5\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faaa96f83c9c5dc6d4b6f0\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate567\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faaab7f83c9c5dc6d4b6f4\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate57\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faab0bf83c9c5dc6d4b6f8\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate57h\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faabfea0b683c8f2d961c1\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate67\",\n \"__v\": 0\n },\n {\n \"_id\": \"63fab197a0b683c8f2d961cd\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"DemoTemplate5\",\n \"__v\": 0\n }\n ]\n}" - } - ] - } - ] - }, - { - "name": "template by id", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to fetch presentation template as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:31:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to get presentation template as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:32:54 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to get presentation template as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "GET", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:33:34 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "fetch template by templateId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to get presentation template by its id\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", - " pm.expect(responseBody.appId).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", - " pm.expect(responseBody.domain).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", - " pm.expect(responseBody.query).to.be.a(\"array\")", - " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " const name= pm.environment.get('templateName')", - " pm.expect(responseBody.name).to.be.eql(name)", - " const templateId= pm.environment.get(\"templateId\")", - " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", - " pm.expect(responseBody._id).to.be.a(\"string\")", - " pm.expect(responseBody._id).to.be.eql(templateId)", - "", - " ", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "fetch template by templateId", - "originalRequest": { - "method": "GET", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "140" - }, - { - "key": "ETag", - "value": "W/\"8c-xzW8y0hXCTpIXyWZoP4R9BI/goc\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:41:39 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"_id\": \"63faabfea0b683c8f2d961c1\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate67\"\n}" - } - ] - } - ] - }, - { - "name": "update presention template", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update presentation template as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:43:15 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to update presentation template as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:43:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update presentation template as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}}}"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "PATCH", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 01:44:26 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "update with empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to update presentation template even if it is empty body as it is part of partial create class\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", - " pm.expect(responseBody.appId).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", - " pm.expect(responseBody.domain).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", - " pm.expect(responseBody.query).to.be.a(\"array\")", - " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "update with empty body", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "148" - }, - { - "key": "ETag", - "value": "W/\"94-6n5qGOyH+N5xhISEyr0FS68jZoc\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:07:02 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"_id\": \"63faabfea0b683c8f2d961c1\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate67\",\n \"__v\": 0\n}" - } - ] - }, - { - "name": "empty domain", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update as presentation template domain is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "empty domain", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "112" - }, - { - "key": "ETag", - "value": "W/\"70-zvTj1ZYUPw9H/YH+AMzVG8vumIk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:11:56 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid domain", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update presentation template as domain is invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "invalid domain", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-KSWf62Sscsg0DbNMcWyzdZVC6Ek\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:12:44 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "name is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update presentation template name is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"name cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "name is empty", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "75" - }, - { - "key": "ETag", - "value": "W/\"4b-cO/E+dioAAgfZYBhLTgd5w5H5OM\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:14:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"name cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "duplicate name is passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "const {name}=JSON.parse(pm.request.body.raw)", - "console.log(name)", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update presentation template name passed is duplicate value\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Template name must be unique\")", - " pm.expect(responseBody.message[1]).to.be.equal(`${name} already exists`)", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName2}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "duplicate name", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName2}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "115" - }, - { - "key": "ETag", - "value": "W/\"73-LUcRuDJ+g0lSnXRbzz7lHLV9Wyo\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:18:30 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Template name must be unique\",\n \"DemoTemplate45 already exists\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "query field is not array", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to update presentation template query field passed is not array\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"query must be an array\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"nested property query must be either object or array\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "query field is not array", - "originalRequest": { - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{temlateId}}"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "132" - }, - { - "key": "ETag", - "value": "W/\"84-7h9y70jfWpj1KBW8twoq066Q0hA\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:21:25 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query must be an array\",\n \"nested property query must be either object or array\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "update template", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create presentation template\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", - " pm.expect(responseBody.appId).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", - " pm.expect(responseBody.domain).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", - " pm.expect(responseBody.query).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.query[0].type).to.be.a(\"string\")", - " pm.expect(responseBody.query[0].hasOwnProperty(\"credentialQuery\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"required\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].required).to.be.a(\"boolean\")", - " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"reason\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].reason).to.be.a(\"string\")", - " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"example\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example).to.be.a(\"object\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"@context\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['@context']).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"type\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['type']).to.be.a(\"string\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSubject\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSubject']).to.be.a(\"object\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSchema\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSchema']).to.be.a(\"object\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"trustedIssuer\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer']).to.be.a(\"array\")", - " pm.expect(responseBody.query[0].credentialQuery[0].example.trustedIssuer[0].hasOwnProperty(\"required\")).to.be.true;", - " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer'][0].required).to.be.a(\"boolean\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "PATCH", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "create template with empty query", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "146" - }, - { - "key": "ETag", - "value": "W/\"92-SWsGRKlotuO1i+z54aDlwfv5zFc\"" - }, - { - "key": "Date", - "value": "Fri, 24 Feb 2023 14:27:21 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate\",\n \"_id\": \"63f8c949a713f85a8ea2a13d\",\n \"__v\": 0\n}" - } - ] - } - ] - }, - { - "name": "delete template", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to delete presentation template as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:36:18 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to delete presentation template as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "DELETE", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:37:14 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to get presentation template as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "DELETE", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:37:36 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "delete template", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to delete presentation template by its id\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", - " pm.expect(responseBody.appId).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", - " pm.expect(responseBody.domain).to.be.an(\"string\");", - " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", - " pm.expect(responseBody.query).to.be.a(\"array\")", - " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.name).to.be.a(\"string\")", - " const templateId= pm.environment.get(\"templateId\")", - " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", - " pm.expect(responseBody._id).to.be.a(\"string\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "DELETE", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "delete template", - "originalRequest": { - "method": "DELETE", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "708" - }, - { - "key": "ETag", - "value": "W/\"2c4-XTMSP71CPW06MAQ4w7v4ks9Pocg\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:38:31 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"_id\": \"63fac3af702a991edd3e034f\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"Demo Template\",\n \"__v\": 0\n}" - } - ] - }, - { - "name": "template already deleted", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const templateId= pm.environment.get('templateId')", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to delete presentation template as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(404)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('string')", - " pm.expect(responseBody.message[0]).to.be.eql( `No resource found for templateId ${templateId}`) ", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Not Found\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "DELETE", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "response": [ - { - "name": "template already deleted", - "originalRequest": { - "method": "DELETE", - "header": [ - { - "key": "origin", - "value": "http://localhost:3001", - "type": "text" - } - ], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["template", "{{templateId}}"] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "110" - }, - { - "key": "ETag", - "value": "W/\"6e-11nuxcxleMnDXUB29hcjMdigZsw\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 02:46:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 404,\n \"message\": [\n \"No resource found for templateId 63fac3af702a991edd3e034f\"\n ],\n \"error\": \"Not Found\"\n}" - } - ] - } - ] - } - ] - }, - { - "name": "presentation", - "item": [ - { - "name": "create presentation", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create presentation as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 07:44:00 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create presentation as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 07:43:27 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 07:41:37 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as request body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocuments should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"holderDid should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"holderDid must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"challenge should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"challenge must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"domain should not be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "276" - }, - { - "key": "ETag", - "value": "W/\"114-dqMifWeks/HChCFZCOFo0T2NsHw\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:56:57 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocuments should not be empty\",\n \"holderDid should not be empty\",\n \"holderDid must be a string\",\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty credentialDocument", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as credentialDocuments passed is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocuments should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"holderDid should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"holderDid must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"challenge should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"challenge must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"domain should not be empty\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "empty credentialDocument", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "276" - }, - { - "key": "ETag", - "value": "W/\"114-dqMifWeks/HChCFZCOFo0T2NsHw\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:57:55 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocuments should not be empty\",\n \"holderDid should not be empty\",\n \"holderDid must be a string\",\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty holderDid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "// var request= JSON.parse(pm.request.body.raw)", - "// console.log(request)", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as holder did is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"holderDid cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "empty holderDid", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"holderDid\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "80" - }, - { - "key": "ETag", - "value": "W/\"50-Ukg35dG8vyzO1/ozDJwg/1gbQ+8\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:02:41 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"holderDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid holderDid", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as holdefr did is invalid\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid holderDid\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "invalid holderDid", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"holderDid\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "72" - }, - { - "key": "ETag", - "value": "W/\"48-sDXx2DcWcY2ENdwfW0LEXq+msvQ\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:03:49 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid holderDid\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "challenge is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as challenge is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"challenge must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"domain should not be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "challenge is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"holderDid\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "173" - }, - { - "key": "ETag", - "value": "W/\"ad-c7ThoUlRlMnqDs223nuJdzPGHLo\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:31:06 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "challenge is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as challenge is empty string\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"domain should not be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "challenge is empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "144" - }, - { - "key": "ETag", - "value": "W/\"90-vx1B74wdC7c6SlKa9p7oEEgd8Nk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:33:04 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "domain is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as domain is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "domain is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "112" - }, - { - "key": "ETag", - "value": "W/\"70-zvTj1ZYUPw9H/YH+AMzVG8vumIk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:33:56 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid domain", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation as domain is invalid url\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "invalid domain", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "83" - }, - { - "key": "ETag", - "value": "W/\"53-KSWf62Sscsg0DbNMcWyzdZVC6Ek\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 08:34:32 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "create presentation", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const vcId = pm.environment.get('vcIdPF')", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create presentation\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"presentation\")).to.be.true;", - " pm.expect(responseBody.presentation).to.be.a('object')", - " pm.expect(responseBody.presentation.hasOwnProperty(\"@context\")).to.be.true", - " pm.expect(responseBody.presentation['@context']).to.be.a('array')", - " pm.expect(responseBody.presentation.hasOwnProperty(\"type\")).to.be.true", - " pm.expect(responseBody.presentation['type']).to.be.a('array')", - " pm.expect(responseBody.presentation.hasOwnProperty(\"verifiableCredential\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential']).to.be.a('array')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"@context\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['@context']).to.be.a('array')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"id\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['id']).to.be.a('string')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['id']).to.be.eql(vcId)", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"type\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['type']).to.be.a('array')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"expirationDate\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['expirationDate']).to.be.a('string')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"issuanceDate\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['issuanceDate']).to.be.a('string')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"issuer\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['issuer']).to.be.a('string')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"credentialSubject\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['credentialSubject']).to.be.a('object')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"credentialSchema\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['credentialSchema']).to.be.a('object')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"credentialStatus\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['credentialStatus']).to.be.a('object')", - " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"proof\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof']).to.be.a('object')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"type\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].type).to.be.a('string')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].type).to.be.eql('Ed25519Signature2020')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"created\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].created).to.be.a('string')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"verificationMethod\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].verificationMethod).to.be.a('string')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofPurpose\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].proofPurpose).to.be.a('string')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].proofPurpose).to.be.eql('assertionMethod')", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofValue\")).to.be.true", - " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].proofValue).to.be.a('string')", - " pm.expect(responseBody.presentation.hasOwnProperty(\"id\")).to.be.true", - " pm.expect(responseBody.presentation['id']).to.be.a('string')", - " pm.expect(responseBody.presentation.hasOwnProperty(\"holder\")).to.be.true", - " pm.expect(responseBody.presentation['holder']).to.be.a('string')", - " pm.expect(responseBody.presentation.hasOwnProperty(\"proof\")).to.be.true", - " pm.expect(responseBody.presentation['proof']).to.be.a('object')", - " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"type\")).to.be.true", - " pm.expect(responseBody.presentation['proof'].type).to.be.a('string')", - " pm.expect(responseBody.presentation['proof'].type).to.be.eql('Ed25519Signature2020')", - " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"created\")).to.be.true", - " pm.expect(responseBody.presentation['proof'].created).to.be.a('string')", - " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"verificationMethod\")).to.be.true", - " pm.expect(responseBody.presentation['proof'].verificationMethod).to.be.a('string')", - " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"proofPurpose\")).to.be.true", - " pm.expect(responseBody.presentation['proof'].proofPurpose).to.be.a('string')", - " pm.expect(responseBody.presentation['proof'].proofPurpose).to.be.eql('authentication')", - " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"challenge\")).to.be.true", - " pm.expect(responseBody.presentation['proof'].challenge).to.be.a('string')", - " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"proofValue\")).to.be.true", - " pm.expect(responseBody.presentation['proof'].proofValue).to.be.a('string')", - " pm.environment.set('presentation', JSON.stringify(responseBody.presentation))", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"fire.id\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "response": [ - { - "name": "create presentation", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"fire.id\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation", - "host": ["{{studio-api-baseUrl}}presentation"] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "1930" - }, - { - "key": "ETag", - "value": "W/\"78a-tdOOJu1hZdJEHgosVUEHNX48geE\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 09:50:01 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"presentation\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"type\": [\n \"VerifiablePresentation\"\n ],\n \"verifiableCredential\": [\n {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:zDqkTd5Drfc7bXnWxk2LAk1nzPzwnqx1TH5d1Cm5FYNB\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-24T12:24:03Z\",\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:zDqkTd5Drfc7bXnWxk2LAk1nzPzwnqx1TH5d1Cm5FYNB\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T12:25:44Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z2A9uGxzWg2G4P2gB2GKUSKD7y5Ff6wu4dA6djoZj4xY5Qvz5SrsG9Ctk38DTKn55dkb9VVanBwLzKyQZABgAtjnB\"\n }\n }\n ],\n \"id\": \"vp:hid:testnet:zBTkHgSEdQknQoEZPDoM3Bai8aC9sPS3hWbgFmoVHmsxD\",\n \"holder\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-26T09:50:01Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"authentication\",\n \"challenge\": \"h27ss3458vnbuqu2822yre\",\n \"proofValue\": \"z5rZs3tGK3o9koJgzvcL5MPwEQbT4w1KMtyN7NaHYf3p34ncNNVFTFDG9hHTushvE7RcrGCa6VGYVEHUEdwLHziE6\"\n }\n }\n}" - } - ] - } - ] - }, - { - "name": "presentation request", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create presentation request as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 09:53:23 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to create presentation request as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 09:54:01 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 09:54:57 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as request body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"challenge must be a string\",)", - " pm.expect(responseBody.message[2]).to.be.equal(\"did should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal( \"did must be a string\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"templateId should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"templateId must be a string\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"expiresTime should not be empty\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", - " pm.expect(responseBody.message[9]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[10]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "450" - }, - { - "key": "ETag", - "value": "W/\"1c2-zzQp2MjqqRoNw3ka9jvsp+wd/O0\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 09:59:01 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"did should not be empty\",\n \"did must be a string\",\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "challenge is empty", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as challenge passed in request body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"did should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal( \"did must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"templateId should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"templateId must be a string\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"expiresTime should not be empty\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[9]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "challenge is empty", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "421" - }, - { - "key": "ETag", - "value": "W/\"1a5-QgiUlWFm/IZpQad2/qbcRRj6ukA\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:01:24 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"did should not be empty\",\n \"did must be a string\",\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "did is not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as did is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"did should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal( \"did must be a string\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"templateId should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"templateId must be a string\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"expiresTime should not be empty\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", - " pm.expect(responseBody.message[7]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[8]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "did is not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "389" - }, - { - "key": "ETag", - "value": "W/\"185-z81BxtPSxoHBKQXWjp8tevvuQi4\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:04:05 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"did should not be empty\",\n \"did must be a string\",\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "did is empty string", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as did passed is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"did cannot be empty\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "did is empty string", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "74" - }, - { - "key": "ETag", - "value": "W/\"4a-fCicVlx7Avyc3KpBaOarxMFVHT4\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:05:11 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"did cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "invalid did", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as did passed is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid did\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "invalid did", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"xyz\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "66" - }, - { - "key": "ETag", - "value": "W/\"42-8Ba8Duu1E+QUY94luENhYozf6Ao\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:06:34 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid did\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "templateId not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as templateId is not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"templateId must be a string\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"expiresTime should not be empty\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[6]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "templateId not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "340" - }, - { - "key": "ETag", - "value": "W/\"154-z+fOrhiCfjfBx4HOX+Ym/pk/Kbw\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:08:40 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "empty templateId", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as templateId passed is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"expiresTime should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "empty templateId", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "310" - }, - { - "key": "ETag", - "value": "W/\"136-yz5JMSJ75k9/i/l+dBjzG8t7B1g\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:10:16 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"templateId should not be empty\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "expiresTime not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as expiresTime not passed\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"expiresTime should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", - " pm.expect(responseBody.message[4]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[5]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "expiresTime not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "277" - }, - { - "key": "ETag", - "value": "W/\"115-6a6Wib0wCp0e1DS1gl/403C4/3k\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:15:52 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "expiresTime passed is less than expected", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as expiresTime passed less than current time\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.includes(\"templateId should not be empty\")", - "", - " pm.expect(responseBody.message[1]).to.be.includes(\"expiresTime must not be less than\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401472477\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "expiresTime passed is less than expected", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401472477\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "172" - }, - { - "key": "ETag", - "value": "W/\"ac-AO3sqze7/h5EdM+gGvR52XnsGCg\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:21:47 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expiresTime must not be less than 1677401772477\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "callbackUrl not passed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to create presentation request as callbackUrl not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", - " pm.expect(responseBody.message[2]).to.be.equal(\"callbackUrl should not be empty\")", - " pm.expect(responseBody.message[3]).to.be.equal(\"callbackUrl must be a URL address\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401872477\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "callbackUrl not passed", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401872477\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "122" - }, - { - "key": "ETag", - "value": "W/\"7a-OGuez2tWp4W0y3uFOvgCWUnI3eo\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:23:25 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "created presentation request", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const expiresTime = pm.environment.get('expiresTime')", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to create presentation request\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"id\")).to.be.true;", - " pm.expect(responseBody.id).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"from\")).to.be.true", - " pm.expect(responseBody['from']).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"created_time\")).to.be.true", - " pm.expect(responseBody['created_time']).to.be.a('number')", - " pm.expect(responseBody.hasOwnProperty(\"expires_time\")).to.be.true", - " pm.expect(responseBody['expires_time']).to.be.a('number')", - " pm.expect(responseBody['expires_time']).to.be.equal(expiresTime)", - " pm.expect(responseBody.hasOwnProperty(\"reply_url\")).to.be.true", - " pm.expect(responseBody['reply_url']).to.be.a('string')", - " pm.expect(responseBody.hasOwnProperty(\"reply_to\")).to.be.true", - " pm.expect(responseBody['reply_to']).to.be.a('array')", - " pm.expect(responseBody.hasOwnProperty(\"body\")).to.be.true", - " pm.expect(responseBody['body']).to.be.a('object')", - " const templateId = pm.environment.get(\"templateId2\")", - " pm.expect(responseBody.body.hasOwnProperty(\"_id\")).to.be.true", - " pm.expect(responseBody.body._id).to.be.a('string')", - " pm.expect(responseBody.body._id).to.be.equal(templateId)", - " const appId = pm.environment.get(\"appId\")", - " pm.expect(responseBody.body.hasOwnProperty(\"appId\")).to.be.true", - " pm.expect(responseBody.body.appId).to.be.a('string')", - " pm.expect(responseBody.body.appId).to.be.equal(appId)", - " pm.expect(responseBody.body.hasOwnProperty(\"domain\")).to.be.true", - " pm.expect(responseBody.body['domain']).to.be.a('string')", - " pm.expect(responseBody.body.hasOwnProperty(\"query\")).to.be.true", - " pm.expect(responseBody.body['query']).to.be.a('array')", - " pm.expect(responseBody.body.hasOwnProperty(\"name\")).to.be.true", - " pm.expect(responseBody.body['name']).to.be.a('string')", - " pm.expect(responseBody.body.hasOwnProperty(\"challenge\")).to.be.true", - " pm.expect(responseBody.body['challenge']).to.be.a('string')", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const oneDayInMilliseconds = 24 * 60 * 60 * 1000;", - "const expiresTime = Date.now() + oneDayInMilliseconds;", - "pm.environment.set('expiresTime',expiresTime)" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{templateId2}}\",\n \"expiresTime\":{{expiresTime}},\n \"callbackUrl\":\"https://api.hypersign.id\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "response": [ - { - "name": "created presentation request", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{templateId2}}\",\n \"expiresTime\":{{expiresTime}},\n \"callbackUrl\":\"https://api.hypersign.id\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "830" - }, - { - "key": "ETag", - "value": "W/\"33e-niOG4hcvWcJ32p8Cj2aoCIV874g\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:47:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"id\": \"ca47291f8ff2effaef8443209c7554ca7162\",\n \"from\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"created_time\": 1677408479785,\n \"expires_time\": 1677494879557,\n \"reply_url\": \"https://api.hypersign.id\",\n \"reply_to\": [\n \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n ],\n \"body\": {\n \"_id\": \"63fb0a73c398867bf047c5d5\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"TestTemplate567789701945rt\",\n \"challenge\": \"wjwwrjgtj573nbcj jt\"\n }\n}" - } - ] - } - ] - }, - { - "name": "presentation verify", - "item": [ - { - "name": "authorization issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to verify presentation request as accesstoken is not passed \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", - " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "authorization issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "95" - }, - { - "key": "ETag", - "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 11:15:17 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "token expired", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not be able to verify presentation request as access token passed is expired\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.an('object')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", - " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", - " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", - " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "token expired", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "145" - }, - { - "key": "ETag", - "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 11:16:19 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "origin issue", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to verify presentation request as origin is not matched with origin set in app \", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(401)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "origin issue", - "originalRequest": { - "method": "POST", - "header": [], - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "71" - }, - { - "key": "ETag", - "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 11:17:00 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" - } - ] - }, - { - "name": "empty body", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should not able to verify presentation request as request body is empty\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", - " pm.expect(responseBody.statusCode).to.be.a('number')", - " pm.expect(responseBody.statusCode).to.be.equal(400)", - " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", - " pm.expect(responseBody.message).to.be.an(\"array\");", - " pm.expect(responseBody.message[0]).to.be.equal(\"presentation must be a non-empty object\")", - " pm.expect(responseBody.message[1]).to.be.equal(\"presentation must be an object\")", - "", - " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", - " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "empty body", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "Origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "127" - }, - { - "key": "ETag", - "value": "W/\"7f-WcK0L8PCZVAHUhq3xmKOVO6H7f0\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 11:19:04 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"presentation must be a non-empty object\",\n \"presentation must be an object\"\n ],\n \"error\": \"Bad Request\"\n}" - } - ] - }, - { - "name": "verify presentation", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var responseBody = pm.response.json()", - "const expiresTime = pm.environment.get('expiresTime')", - "const vcId = pm.environment.get('vcIdPF')", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "pm.test('Response body should be an object', function () {", - " pm.expect(typeof responseBody).to.equal(\"object\")", - "})", - "pm.test(\"Should be able to verify presenatation\", function () {", - " pm.expect(responseBody.hasOwnProperty(\"verified\")).to.be.true;", - " pm.expect(responseBody.verified).to.be.a('boolean')", - " pm.expect(responseBody.verified).to.be.equal(true)", - " pm.expect(responseBody.hasOwnProperty(\"results\")).to.be.true", - " pm.expect(responseBody['results']).to.be.a('array')", - "", - "", - "", - "", - " pm.expect(responseBody.results[0].hasOwnProperty(\"@context\")).to.be.true", - " pm.expect(responseBody['results'][0]['@context']).to.be.a('array')", - "", - " pm.expect(responseBody.results[0].hasOwnProperty(\"type\")).to.be.true", - " pm.expect(responseBody['results'][0]['type']).to.be.a('array')", - "", - "", - "", - "", - "", - " pm.expect(responseBody.results[0].hasOwnProperty(\"verifiableCredential\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential']).to.be.a('array')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"@context\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['@context']).to.be.a('array')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"id\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['id']).to.be.a('string')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['id']).to.be.eql(vcId)", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"type\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['type']).to.be.a('array')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"expirationDate\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['expirationDate']).to.be.a('string')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"issuanceDate\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['issuanceDate']).to.be.a('string')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"issuer\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['issuer']).to.be.a('string')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"credentialSubject\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['credentialSubject']).to.be.a('object')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"credentialSchema\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['credentialSchema']).to.be.a('object')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"credentialStatus\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['credentialStatus']).to.be.a('object')", - " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"proof\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof']).to.be.a('object')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"type\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].type).to.be.a('string')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].type).to.be.eql('Ed25519Signature2020')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"created\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].created).to.be.a('string')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"verificationMethod\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].verificationMethod).to.be.a('string')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofPurpose\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].proofPurpose).to.be.a('string')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].proofPurpose).to.be.eql('assertionMethod')", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofValue\")).to.be.true", - " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].proofValue).to.be.a('string')", - "", - "pm.expect(responseBody.results[0].hasOwnProperty('id')).to.be.a.true", - "pm.expect(responseBody.results[0].id).to.be.a('string')", - "pm.expect(responseBody.results[0].hasOwnProperty('holder')).to.be.a.true", - "pm.expect(responseBody.results[0].holder).to.be.a('string')", - "pm.expect(responseBody.results[0].hasOwnProperty('proof')).to.be.a.true", - "pm.expect(responseBody.results[0].proof).to.be.a('object')", - "pm.expect(responseBody.results[0].proof.hasOwnProperty('type')).to.be.a.true", - "pm.expect(responseBody.results[0].proof.type).to.be.a('string')", - "pm.expect(responseBody.results[0].proof.type).to.be.equal('Ed25519Signature2020')", - "pm.expect(responseBody.results[0].proof.hasOwnProperty('created')).to.be.a.true", - "pm.expect(responseBody.results[0].proof.created).to.be.a('string')", - "", - "pm.expect(responseBody.results[0].proof.hasOwnProperty('verificationMethod')).to.be.a.true", - "pm.expect(responseBody.results[0].proof.verificationMethod).to.be.a('string')", - "pm.expect(responseBody.results[0].proof.hasOwnProperty('proofPurpose')).to.be.a.true", - "pm.expect(responseBody.results[0].proof.proofPurpose).to.be.a('string')", - "pm.expect(responseBody.results[0].proof.proofPurpose).to.be.equal('authentication')", - "pm.expect(responseBody.results[0].proof.hasOwnProperty('challenge')).to.be.a.true", - "pm.expect(responseBody.results[0].proof.challenge).to.be.a('string')", - "pm.expect(responseBody.results[0].proof.hasOwnProperty('proofValue')).to.be.a.true", - "pm.expect(responseBody.results[0].proof.proofValue).to.be.a('string')", - "", - "", - "", - " pm.expect(responseBody.hasOwnProperty(\"credentialResults\")).to.be.true", - " pm.expect(responseBody['credentialResults']).to.be.a('array')", - "", - "", - "", - "});", - "", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "const oneDayInMilliseconds = 24 * 60 * 60 * 1000;", - "const expiresTime = Date.now() + oneDayInMilliseconds;", - "pm.environment.set('expiresTime',expiresTime)" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{access_Token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"presentation\":{{presentation}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/verify", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["verify"] - } - }, - "response": [ - { - "name": "created presentation request", - "originalRequest": { - "method": "POST", - "header": [ - { - "key": "origin", - "value": "{{Origin}}", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{templateId2}}\",\n \"expiresTime\":{{expiresTime}},\n \"callbackUrl\":\"https://api.hypersign.id\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{studio-api-baseUrl}}presentation/request", - "host": ["{{studio-api-baseUrl}}presentation"], - "path": ["request"] - } - }, - "status": "Created", - "code": 201, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "X-Powered-By", - "value": "Express" - }, - { - "key": "Access-Control-Allow-Origin", - "value": "*" - }, - { - "key": "Content-Type", - "value": "application/json; charset=utf-8" - }, - { - "key": "Content-Length", - "value": "830" - }, - { - "key": "ETag", - "value": "W/\"33e-niOG4hcvWcJ32p8Cj2aoCIV874g\"" - }, - { - "key": "Date", - "value": "Sun, 26 Feb 2023 10:47:59 GMT" - }, - { - "key": "Connection", - "value": "keep-alive" - }, - { - "key": "Keep-Alive", - "value": "timeout=5" - } - ], - "cookie": [], - "body": "{\n \"id\": \"ca47291f8ff2effaef8443209c7554ca7162\",\n \"from\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"created_time\": 1677408479785,\n \"expires_time\": 1677494879557,\n \"reply_url\": \"https://api.hypersign.id\",\n \"reply_to\": [\n \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n ],\n \"body\": {\n \"_id\": \"63fb0a73c398867bf047c5d5\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"TestTemplate567789701945rt\",\n \"challenge\": \"wjwwrjgtj573nbcj jt\"\n }\n}" - } - ] - } - ] - } - ] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [""] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [""] - } - } - ], - "variable": [ - { - "key": "studio-api-baseUrl", - "value": "http://localhost:3001/api/v1/" - }, - { - "key": "studio_API_auth", - "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVmFyc2hhIGt1bWFyaSIsImVtYWlsIjoidmFyc2hha3VtYXJpMzcwQGdtYWlsLmNvbSIsImlkIjoiZGlkOmhpZDp0ZXN0bmV0Ono1bjM1YkJpTmhBRmVlZ1QyTUNUcmE0WEhSZkV1Mk5BNzlnaGFjZnRhZ3FZUyIsImlhdCI6MTY3NjQwMTM2MywiZXhwIjoxODg2NTIxMzYzfQ.zboCVCKejYdSZDHXDNYRJQWklVUi9WLx6ww6U2fCcsU" - }, - { - "key": "Origin", - "value": "http://localhost:3001" - } - ] -} + "info": { + "_postman_id": "9b8875e7-7376-4f1a-b1e0-99c1521fa767", + "name": "new-studio-api Copy", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "13310082" + }, + "item": [ + { + "name": "Dids", + "item": [ + { + "name": "fetch did list", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch did as api call is made from invalid domain\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"Invalid subdomain\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 11:24:00 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as authtoken is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch did as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did?page=1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "fail as authtoken is not passed", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did?page =1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 14:20:57 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch did as access token passed in header is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did?page =1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did?page =1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 14:29:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "negative limit value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail limit is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did?page =1&limit=-20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "-20" + } + ] + } + }, + "response": [ + { + "name": "negative limit value", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did?page =1&limit=-20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "-20" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "84" + }, + { + "key": "ETag", + "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 15:38:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "negative page value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail page is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did?page=-1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "negative page value", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did?page=-1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 15:40:25 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fetch did list", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var page;", + "var limit;", + "var urlString = pm.request.url.toString();", + "var did = pm.environment.get('did')", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "", + "pm.test(\"Should be able to pass and have list of dids in response body \", function () {", + " try {", + " page = urlString.match(/page=(\\d+)/)[1];", + " page = (parseInt(page))", + " } catch (e) {", + " page = 1", + " }", + " try {", + " limit = urlString.match(/limit=(\\d+)/)[1];", + " limit = parseInt(limit)", + " } catch (e) {", + " limit = 10", + " }", + " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", + " pm.expect(responseBody.totalCount).to.be.a('number')", + " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", + " pm.expect(responseBody.data).to.be.an(\"array\");", + " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did?page=1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "fetch did list", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did?page=1&limit=20", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1295" + }, + { + "key": "ETag", + "value": "W/\"50f-S7ukKnsX3AH0dD7UH2US7B4ZF88\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 16:04:33 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"totalCount\": 23,\n \"data\": [\n \"did:hid:testnet:0xBE96b88c318BcDc6025366Ea1D2E62eD5bB01941\",\n \"did:hid:testnet:zEgJtgWiLwsLBsbcYnr1EG7DdiepTu9BxUWtRSK2iVKCA\",\n \"did:hid:testnet:zHLQtJdv8dafCfEHmTSEqqnRQAkwMM6oZ6mxzRCwy5W5x\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:z8nhXFrAice2Dp7i1tXdesi3Nu5k28esWkiReunoffXdj\",\n \"did:hid:testnet:zDKL216y4EB54ho7tzJEXqScwP7Lz1Xne6K1kusASdSWg\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F\",\n \"did:hid:testnet:0x19d73aeeBcc6FEf2d0342375090401301Fe9663F45heuun\",\n \"did:hid:testnet:z9L3NNPa8xRZDwmMDcAeYn16eLJD7BXifBqnTQCn3TSc8\",\n \"did:hid:testnet:z9Vbimnesdv8oPnwNmuPRt9MjKf75mjbGgEQw1Jmog4H3\",\n \"did:hid:testnet:zAqVQbtMBiBDjGS7J3EBN6w4PPDPvfqA21Yj7DTs51Yt5\",\n \"did:hid:testnet:zBYKVEWX2mC24qhw9oTULt9crdihDHoFCDgofFZ7ysmtz\",\n \"did:hid:testnet:z3LpAEdpjua1PtA65acsgB2rjkbohPowSajFdDMgxSqiJ\",\n \"did:hid:testnet:z7CqtaHaApz7miH4nwjefY4wxkCGhTmvpknZGeRrkhnG7\",\n \"did:hid:testnet:z8jnKp5mgwcazmGRCof4JuSxgAJ6fQsQXdQiHGVnfYUkK\",\n \"did:hid:testnet:z2zfWCSxBjuekvFV3jmYAHrzZuTCj36VwW1FQM1FMr3Hf\",\n \"did:hid:testnet:z8qFAHRXaiQGthD9Cwxqa8Gwzz5jTRD9qA4TzPMewYdBv\",\n \"did:hid:testnet:z6DGtcea4MW4xzEGzV6mMbn1RfNnwUv2D3ejUfqTZN5h7\"\n ]\n}" + } + ] + } + ] + }, + { + "name": "create did", + "item": [ + { + "name": "invalid sub-domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to generate new did as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 12:05:13 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "no accesstoken passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "no accesstoken passed", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 15:48:37 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token passed in header is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 15:51:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin mismatch", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "origin mismatch", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 15:54:33 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet', '' \")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "111" + }, + { + "key": "ETag", + "value": "W/\"6f-3k9kUSqDolASTScgYJybcyuPnIg\"" + }, + { + "key": "Date", + "value": "Mon, 20 Feb 2023 16:01:04 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: testnet, \"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create did with empty namespace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with empty namespace and default keyType for mainnet\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " pm.environment.set(\"didMainnet\", responseBody.did)", + " pm.environment.set(\"didDocMainNet\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did with empty namespace", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1095" + }, + { + "key": "ETag", + "value": "W/\"447-vqMIzaIeZu+H0fTRkO6SqChbi+g\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 11:17:34 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"controller\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"publicKeyMultibase\": \"z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:z8TMpGPiWC3Y5PVvN6mxoGQ5Egbwsh9UX14rXXe7mZYpT#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "unsupported namespace in body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as body is empty or namespace is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet', '' \")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "unsupported namespace in body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "116" + }, + { + "key": "ETag", + "value": "W/\"74-S6l+ID2O9tBXczUSEkTX40qokrg\"" + }, + { + "key": "Date", + "value": "Thu, 23 Feb 2023 04:55:25 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet', '' \"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create did withkey default type ED25519", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` for testnet\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes('testnet'))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " //D means default case", + " pm.environment.set(\"didtestnetD\", responseBody.did)", + " pm.environment.set(\"didDoctestNetD\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did withkey default type ED25519", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1183" + }, + { + "key": "ETag", + "value": "W/\"49f-5RjNFlNuphQ0cqfYvXlf95X3tWo\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 11:18:09 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"controller\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"publicKeyMultibase\": \"zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zABZraLfXFLKowFk7ruU7oZYgcCNNTSSuF2hPPK3hktY8#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "create did with Ed25519VerificationKey2020 with methodSpecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + " const {namespace, methodSpecificId}= JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` and namespace as `testnet`\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes(namespace))", + " pm.expect(responseBody.did.includes(methodSpecificId))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " //DM means default key type and metehod specificId", + " pm.environment.set(\"didtestnetDM\", responseBody.did)", + " pm.environment.set(\"didDoctestNetDM\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const randomString = Array(32).fill(0).map(() => Math.random().toString(36).charAt(2)).join('');\r", + "pm.environment.set('methodSpecificId',randomString)" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\": \"{{methodSpecificId}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did with Ed25519VerificationKey2020 with methodSpecificId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\": \"{{methodSpecificId}}10\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1172" + }, + { + "key": "ETag", + "value": "W/\"494-STuZHaWeL9q1ah0EgmkfeNNafQo\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 11:18:46 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\",\n \"controller\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10\",\n \"publicKeyMultibase\": \"zGvpqVygyRVE8tNyQkZtXqb2wxCtiBbe72wFBkSi4hDZQ\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn10#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "create did with Ed25519VerificationKey2020 with pubkey", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + " const {namespace}= JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` and passed publicKey\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes(namespace))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " //DP means default key type and public key", + " pm.environment.set(\"didtestnetDP\", responseBody.did)", + " pm.environment.set(\"didDoctestNetDP\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW768hvi\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did with Ed25519VerificationKey2020 with pubkey", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW768hvip\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1183" + }, + { + "key": "ETag", + "value": "W/\"49f-GXmAU6HY+j0GmzQIfdDk2435vgg\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 11:19:20 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"controller\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"publicKeyMultibase\": \"zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zJ79AF9nDujupzfA7aHUt9JmPSbABikD9oo1uMRb8Meeo#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "create did with Ed25519VerificationKey2020 with pubkey methodSId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + " const {namespace, methodSpecificId}= JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020`, methodSpecificId and passed publicKey\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes(namespace))", + " pm.expect(responseBody.did.includes(methodSpecificId))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " //DMP means default key type, methodSpecificId and public key", + " pm.environment.set(\"didtestnetDMP\", responseBody.did)", + " pm.environment.set(\"didDoctestNetDMP\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"{{methodSpecificId}}1\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did with Ed25519VerificationKey2020 with pubkey methodSId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"{{methodSpecificId}}16\",\n \"options\": {\n \"publicKey\": \"z76tzt4XCb6FNqC3CPZvsxRfEDX5HHQc2VPux4DeZYndW\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1171" + }, + { + "key": "ETag", + "value": "W/\"493-o9Epq5dejdHU6NalJNbZaWANQcY\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 11:19:52 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\",\n \"controller\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16\",\n \"publicKeyMultibase\": \"zmPmvbs77izHnZ7KjEG5deMNh8jN421ztqeELqD9ZD7P\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn16#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "invalid keyType", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as passed Key type is not supported\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"options.keyType must be one of the following values: Ed25519VerificationKey2020, EcdsaSecp256k1VerificationKey2019, EcdsaSecp256k1RecoveryMethod2020, X25519KeyAgreementKey2020, X25519KeyAgreementKeyEIP5630\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\":\"xyz\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "invalid keyType", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\":\"xyz\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "203" + }, + { + "key": "ETag", + "value": "W/\"cb-8511ww4wOMrfDW6uoPC4HnSc3zw\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 05:04:10 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.keyType must be one of the following values: Ed25519VerificationKey2020, EcdsaSecp256k1VerificationKey2019, EcdsaSecp256k1RecoveryMethod2020\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "option.walletAddress not passed in case of EcdsaSecp256k1RecoveryMethod2020", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const parsedReqBody = JSON.parse(pm.request.body.raw)", + "const { keyType } = parsedReqBody.options", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but walletAddress is passed not a valid walletAddress\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"options.walletAddress is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "option.walletAddress not passed in case of EcdsaSecp256k1RecoveryMethod2020", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "146" + }, + { + "key": "ETag", + "value": "W/\"92-m+HdVH0gX3QXmBtVbk92uG35OPg\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 05:10:28 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.walletAddress is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "option.walletAddress passed is invalid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const parsedReqBody = JSON.parse(pm.request.body.raw)", + "const { walletAddress } = parsedReqBody.options", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but walletAddress passed is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"options.walletAddress must be longer than or equal to 32 characters\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "option.walletAddress passed is invalid", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "122" + }, + { + "key": "ETag", + "value": "W/\"7a-8LeDjrJ7iNCUhjP/SiKP8VNTQEc\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 11:02:17 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.walletAddress must be longer than or equal to 32 characters\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "option.chainId not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const parsedReqBody = JSON.parse(pm.request.body.raw)", + "const { walletAddress } = parsedReqBody.options", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but chainId is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"options.chainId is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyzdvfhfdvjk2847834ifhdv73843hr56vgxghgte6cf5\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "option.chainId not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "140" + }, + { + "key": "ETag", + "value": "W/\"8c-fldN0zbdvNVty/sXLtdhSOEwGa4\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 05:28:35 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.chainId is not passed , required for keyType EcdsaSecp256k1RecoveryMethod2020\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid option.chainId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const parsedReqBody = JSON.parse(pm.request.body.raw)", + "const { chainId } = parsedReqBody.options", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create did as keyType is `EcdsaSecp256k1RecoveryMethod2020` but chainId passed is not supported\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(`${chainId} is unsupported`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\": \"xyzdvfhfdvjk2847834ifhdv73843hr56vgxghgte6cf5\",\n \"chainId\": \"rst\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "invalid option.chainId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"walletAddress\":\"xyz\",\n \"chainId\":\"rst\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "173" + }, + { + "key": "ETag", + "value": "W/\"ad-K9SWbRAcny9cHUnfbiiUrgEa0fw\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 05:33:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 500,\n \"timestamp\": \"2023-02-21T05:33:48.911Z\",\n \"path\": \"/api/v1/did/create\",\n \"message\": [\n \"Error\",\n \"HID-SSI-SDK:: Error: unsupported chain Id\",\n \"Internal server error\"\n ]\n}" + } + ] + }, + { + "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020 and methodSId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const parsedReqBody = JSON.parse(pm.request.body.raw)", + "const { namespace, methodSpecificId } = parsedReqBody", + "const { keyType } = parsedReqBody.options", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with key type `EcdsaSecp256k1RecoveryMethod2020` and methodSpecificId\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes(namespace))", + " pm.expect(responseBody.did.includes(methodSpecificId))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal(`${keyType}`);", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).blockchainAccountId).is.not.empty", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " //didDocEcdsaM M means methodSpecificId", + " pm.environment.set(\"didtestnetEcdsaM\", responseBody.did)", + " pm.environment.set(\"didDocEcdsaM\", JSON.stringify(responseBody.metaData.didDocument))", + " // pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " // pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{methodSpecificId}}2\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020 and methodSId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"methodSpecificId\":\"0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{methodSpecificId}}25\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1160" + }, + { + "key": "ETag", + "value": "W/\"488-CFPTtNIqqvaPXg+Ggm6YTmlMSd8\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 11:20:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"controller\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\",\n \"type\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"controller\": \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r\",\n \"blockchainAccountId\": \"eip155:1:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn25\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:0x4b0673204D1a8c1Dbe95afDe6a01Eb495C9562E234r#key-1\"\n ]\n }\n }\n}" + } + ] + }, + { + "name": "invalid parameter passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create did as invalid parameter `address` is passed in options field\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"options.property address should not exist\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"address\": \"0x01978e553Df0C54A63e2E063DFFe71c688d91C76\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "invalid parameter passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"address\": \"0x01978e553Df0C54A63e2E063DFFe71c688d91C76\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/create", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "create" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "96" + }, + { + "key": "ETag", + "value": "W/\"60-jxUbuOJqFTfOH2ffosveheKe3C4\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 05:38:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"options.property address should not exist\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const parsedReqBody = JSON.parse(pm.request.body.raw)", + "const { namespace } = parsedReqBody", + "const { keyType } = parsedReqBody.options", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with key type `EcdsaSecp256k1RecoveryMethod2020`\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes(namespace))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal(`${keyType}`);", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).blockchainAccountId).is.not.empty", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.environment.set(\"didtestnetEcdsa\", responseBody.did)", + " pm.environment.set(\"didDocEcdsa\", JSON.stringify(responseBody.metaData.didDocument))", + " pm.environment.set(\"didtestnetEcdsa\", responseBody.did)", + " // pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " // pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const randomString = Array(32).fill(0).map(() => Math.random().toString(36).charAt(2)).join('');\r", + "pm.environment.set('walletAddress',randomString)" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{walletAddress}}3\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did with keytype EcdsaSecp256k1RecoveryMethod2020", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\": \"testnet\",\n \"options\": {\n \"keyType\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"chainId\": \"0x1\",\n \"walletAddress\": \"{{walletAddress}}34\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1149" + }, + { + "key": "ETag", + "value": "W/\"47d-61nLLDBXdXUxNQGCztATzJvonjw\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 11:21:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\",\n \"controller\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\",\n \"type\": \"EcdsaSecp256k1RecoveryMethod2020\",\n \"controller\": \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\",\n \"blockchainAccountId\": \"eip155:1:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid1rvzl8fzm9nfpq7p8q4xsrg30rl423rmgstgfwn34#key-1\"\n ]\n }\n }\n}" + } + ] + } + ] + }, + { + "name": "register did", + "item": [ + { + "name": "invalid sub-domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to register new did as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/register", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "register" + ] + } + }, + "response": [ + { + "name": "invalid sub-domain", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/did/register", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 12:08:38 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "no accesstoken passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "no accesstoken passed Copy", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 07:02:51 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token passed in header is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 07:03:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin mismatch", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "origin mismatch", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 07:03:49 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", + " // pm.expect(responseBody.message[1]).to.be.eql(\"Did's namespace should be testnet\")", + " // pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "169" + }, + { + "key": "ETag", + "value": "W/\"a9-r0Du8pOer2khk6jBElZyelkSMBI\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:07:20 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"Did's namespace should be testnet\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid didDocument type", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as didDocument passed in body is of type string it should be object\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"each value in nested property didDocument must be either object or array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "invalid didDocument type", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "244" + }, + { + "key": "ETag", + "value": "W/\"f4-WE0Av30xk6U+M5kdtv0+TOR9dEc\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:08:43 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"each value in nested property didDocument must be either object or array\",\n \"Did's namespace should be testnet\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty didDocument", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as didDocument passed in body is of type string it should be object\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument.controller must be an array\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"didDocument.authentication must be an array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.assertionMethod must be an array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "empty didDocument", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "488" + }, + { + "key": "ETag", + "value": "W/\"1e8-lrCxvNuZ8ZNGeofWQotWBy2/yAs\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:10:45 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument.id must be a string\",\n \"didDocument.controller must be an array\",\n \"didDocument.alsoKnownAs must be an array\",\n \"didDocument.authentication must be an array\",\n \"didDocument.assertionMethod must be an array\",\n \"didDocument.keyAgreement must be an array\",\n \"didDocument.capabilityInvocation must be an array\",\n \"didDocument.capabilityDelegation must be an array\",\n \"Did's namespace should be testnet\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 500\", function () {", + " pm.response.to.have.status(500);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(500)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[1]).to.be.equal(\"HID-SSI-SDK:: Error: params.verificationMethodId is required to register a did\")", + " ", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocMainNet}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "verificationMethodId not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocMainNet}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 12:15:37 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "212" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"d4-1/oilTZNRb6eZsP7hw5+JSBfOl4\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 500,\n \"timestamp\": \"2023-11-15T12:15:37.472Z\",\n \"path\": \"/api/v1/did/register\",\n \"message\": [\n \"Error\",\n \"HID-SSI-SDK:: Error: params.verificationMethodId is required to register a did\",\n \"Internal server error\"\n ]\n}" + } + ] + }, + { + "name": "invalid verificationMethodId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId passed is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocMainNet}},\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "invalid verificationMethodId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 07:05:29 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "register did that don't have namespace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be not able register didDoc as we did don't have namespace testnet and mainnet is yet not live\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Did's namespace should be testnet\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocMainNet}},\n \"verificationMethodId\":\"{{didMainnet}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "register did that don't have namespace", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocMainNet}},\n \"verificationMethodId\":\"{{didMainnet}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "88" + }, + { + "key": "ETag", + "value": "W/\"58-E0eglHWRdZYuy+bzuJapvRWBdIU\"" + }, + { + "key": "Date", + "value": "Tue, 28 Feb 2023 07:14:33 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Did's namespace should be testnet\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "register did with default key", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` for testnet\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes('testnet'))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", + " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", + " pm.expect(responseBody.transactionHash).not.be.empty", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " const did = pm.environment.get('didtestnetD')", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " pm.environment.set(\"didDoctestNetD\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "setTimeout(function() {", + " console.log(\"Waited for 60 seconds\");", + "}, 60000);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\": {{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "register did with default key", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1266" + }, + { + "key": "ETag", + "value": "W/\"4f2-oHmgx/mrYWqo1ChlCMT0IVVVAsI\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 07:45:29 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"CCA2D08D0B79BD8453A2C5971E80E313D612ABC6E929AF7D3D2E168BC082AD14\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"controller\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"publicKeyMultibase\": \"zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "did already registered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const did= pm.environment.get(\"didtestnetD\")", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should throw error as did is already registered\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(`${did} already registered`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "did already registered", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "135" + }, + { + "key": "ETag", + "value": "W/\"87-I3oAXkD9P+zzWcr9LK8lgzMQIV4\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 04:36:43 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"did:hid:testnet:z91twLPENwCNAqfPsYpfci7RRJvCb9Uhv7vocYdJYgP73 already registered\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "register did with default keytype and MethodSpId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` for testnet and methodSpecificId\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes('testnet'))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", + " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", + " pm.expect(responseBody.transactionHash).not.be.empty", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " const did = pm.environment.get('didtestnetDM')", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " pm.environment.set(\"didDoctestNetDM\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\":\"{{didtestnetDM}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "register did with default keytype and MethodSpId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\":\"{{didtestnetDM}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1266" + }, + { + "key": "ETag", + "value": "W/\"4f2-DarYm1FhvgWRX18d+a05SqxixXo\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 07:48:57 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"69B056F9E83BE99D90EE3C9A8747C695742DCB768B6E919E2954D4381B8B7D23\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"controller\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"publicKeyMultibase\": \"zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "register did with default keytype and publickey", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` and custom publickey\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes('testnet'))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", + " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", + " pm.expect(responseBody.transactionHash).not.be.empty", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " const did = pm.environment.get('didtestnetDP')", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " pm.environment.set(\"didDoctestNetDP\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\":\"{{didtestnetDP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "register did with default keytype and publickey", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\":\"{{didtestnetDP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1266" + }, + { + "key": "ETag", + "value": "W/\"4f2-a9WjFMJHk+zSuS+R9FqqcGD7nK0\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 07:52:37 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"F5CC35AB0315DE5518D95102E41DB30B3CB4A28A5C31187E193AC99B74B673BB\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"controller\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"publicKeyMultibase\": \"z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "register did with default keytype , publickey and MSId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020`, custom publickey and methodSpecficId\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes('testnet'))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", + " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", + " pm.expect(responseBody.transactionHash).not.be.empty", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " const did = pm.environment.get('didtestnetDMP')", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " pm.environment.set(\"didDoctestNetDMP\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\":\"{{didtestnetDMP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "register did with default keytype , publickey and MSId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\":\"{{didtestnetDMP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1233" + }, + { + "key": "ETag", + "value": "W/\"4d1-lb+eAFjn/D8dOGuUJIQAasKwc4Q\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 08:03:33 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"8EF9EFE5449ACA363807CF03932F23828276556E94FA6D994808D40C8F946366\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\",\n \"controller\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd\",\n \"publicKeyMultibase\": \"z5uYhvEGCAUbXirrAWDPfqKrG98gcjRthoH7rLqo63EJF\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:0x3731F37E1e8A8002bB68373432A313996081DEcd#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "clientSpec is not passed in Ecdsa type", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and clientSpec is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"clientSpec is required\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "clientSpec is not passed in Ecdsa type", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "121" + }, + { + "key": "ETag", + "value": "W/\"79-1cXmobjylBe6qSVdjD/yGqH+nGs\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 08:35:05 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 404,\n \"message\": [\n \"did:hid:testnet:0x01978e553Df0C54A63e2E063DFFe71c688d91C76 not found\"\n ],\n \"error\": \"Not Found\"\n}" + } + ] + }, + { + "name": "invalid cleintSpec", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and clientSpec passed is invalid or empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"clientSpec must be one of the following values: eth-personalSign, cosmos-ADR036\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "invalid cleintSpec", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "195" + }, + { + "key": "ETag", + "value": "W/\"c3-6tDI8wYUnOwDfdNeT743euznRug\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:18:45 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"clientSpec must be one of the following values: eth-personalSign, cosmos-ADR036\",\n \"signature must be a string\",\n \"signature should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "signature not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to register did as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and signature field is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"signature must be a string\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"signature should not be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "signature not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "113" + }, + { + "key": "ETag", + "value": "W/\"71-UMe0vBLZrMI8oYvPwBwyegiAYDw\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 09:27:16 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"signature must be a string\",\n \"signature should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty signature field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to register did as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and signature field has empty string\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"signature should not be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "empty signature field", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "84" + }, + { + "key": "ETag", + "value": "W/\"54-pIJmNYXQzIU2s/swEO98ntiQd3Q\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:20:21 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"signature should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid signature", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to register did as did is genrated using `EcdsaSecp256k1RecoveryMethod2020` key type and signInfo array is not passed and did does not exist in server db also\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(404)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.include(\"not found\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Not Found\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"zhkhgfk\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "invalid signature", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDocEcdsa}},\n \"verificationMethodId\":\"{{didtestnetEcdsa}}#key-1\",\n \"clientSpec\":\"eth-personalSign\",\n \"signature\":\"zhkhgfk\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Internal Server Error", + "code": 500, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "437" + }, + { + "key": "ETag", + "value": "W/\"1b5-TrzClBFHWNa0tV00YARZgjXHoYo\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:22:52 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 500,\n \"timestamp\": \"2023-03-01T09:22:52.288Z\",\n \"path\": \"/api/v1/did/register\",\n \"message\": [\n \"Error\",\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: hex string without 0x prefix: invalid signature detected [/home/arnab/code/research/hid-node/x/ssi/verification/signature_verification.go:59] With gas wanted: '0' and gas used: '52877' : unknown request\",\n \"Internal server error\"\n ]\n}" + } + ] + } + ] + }, + { + "name": "resolve did", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to resolve new did as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did/resolve/{{didtestnetD}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "resolve", + "{{didtestnetD}}" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did/resolve/{{didtestnetD}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did", + "resolve", + "{{didtestnetD}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 13:37:24 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as authtoken is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to resolve did as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "response": [ + { + "name": "fail as authtoken is not passed", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 05:12:02 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to resolve did as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 05:14:12 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin mismatch", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "response": [ + { + "name": "origin mismatch", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Mon, 27 Feb 2023 05:11:39 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "invalid did", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve and get empty didDocument and didDocumentMetadata as did is invalid or not exists on chain\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.equal(null)", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/xyz", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "xyz" + ] + } + }, + "response": [ + { + "name": "invalid did", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/xyz", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "xyz" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "45" + }, + { + "key": "ETag", + "value": "W/\"2d-pTpHw0B+V4W4NxYR16fn+iNbD6s\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:29:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {},\n \"didDocumentMetadata\": null\n}" + } + ] + }, + { + "name": "resolve did with default keyType", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve did generated using default key type\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + "", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "response": [ + { + "name": "resolve did generated with default keyType", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "{{didtestnetD}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1254" + }, + { + "key": "ETag", + "value": "W/\"4e6-VF8bSlY4m70Z6xUpJi80pO4dBjQ\"" + }, + { + "key": "Date", + "value": "Tue, 21 Feb 2023 12:29:49 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"controller\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"publicKeyMultibase\": \"zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zHPvaZ4NfRvZxaaTt2kCwCjLDpsj8aam6Ygy5bBunWbkJ#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:45:21Z\",\n \"updated\": \"2023-02-21T07:45:21Z\",\n \"deactivated\": false,\n \"versionId\": \"CCA2D08D0B79BD8453A2C5971E80E313D612ABC6E929AF7D3D2E168BC082AD14\"\n }\n}" + } + ] + }, + { + "name": "resolve did with default keyType and methodspecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + "", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve did generated using methodSpecificId and default key type\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDM}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDM}}" + ] + } + }, + "response": [ + { + "name": "resolve did with default keyType and methodspecificId", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDM}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDM}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1159" + }, + { + "key": "ETag", + "value": "W/\"487-2i5n7i2zpTQ/v9tc2G2rqsSwONg\"" + }, + { + "key": "Date", + "value": "Thu, 23 Feb 2023 04:22:37 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\",\n \"controller\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345\",\n \"publicKeyMultibase\": \"zDpYhLS9HQwThm43gux7s9hVBcuTTWWiJvZJvjFqUzM7\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr127vars345#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {}\n}" + } + ] + }, + { + "name": "resolve did with default keyType and publickey", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + "", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve did generated using publicKey and default key type\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDP}}" + ] + } + }, + "response": [ + { + "name": "resolve did with default keyType and publickey", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDP}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1090" + }, + { + "key": "ETag", + "value": "W/\"442-Nx8MeXYmTuD+i6KfyxWK4RpD+Js\"" + }, + { + "key": "Date", + "value": "Thu, 23 Feb 2023 04:24:41 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\",\n \"controller\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\",\n \"publicKeyMultibase\": \"z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z61Tsv5Ze1tV5MTNtfptke4KVbsxDYe7u7xZAnJ9w7cJw#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {}\n}" + } + ] + }, + { + "name": "resolve did generated with default keyType publickey and methodSpecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + "", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve did generated using publicKey, default key type and publicKey\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(false)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDMP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDMP}}" + ] + } + }, + "response": [ + { + "name": "resolve did generated with default keyType publickey and methodSpecificId", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDMP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDMP}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1120" + }, + { + "key": "ETag", + "value": "W/\"460-mVg4eeTbqJM2cQEVTwUlWuPGO74\"" + }, + { + "key": "Date", + "value": "Thu, 23 Feb 2023 04:25:24 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\",\n \"controller\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh\",\n \"publicKeyMultibase\": \"z6tmrYo9BuGAsJRg1hBMQkCuqTd2h9bpMaRt3biq6UKf6\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:hid14dgpasszc90whhpm0wt6g8fqxrzg4k5c4l5jhr167hgh#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {}\n}" + } + ] + }, + { + "name": "resolve did generated with ecdsaRecoveryMethod", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to resolve and get empty didDocument and didDocumentMetadata as did is generated using ecdsa but not resgistered\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.equal(null)", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetEcdsa}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetEcdsa}}" + ] + } + }, + "response": [ + { + "name": "resolve did generated with ecdsaRecoveryMethod", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetEcdsa}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetEcdsa}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "45" + }, + { + "key": "ETag", + "value": "W/\"2d-pTpHw0B+V4W4NxYR16fn+iNbD6s\"" + }, + { + "key": "Date", + "value": "Wed, 01 Mar 2023 09:34:20 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {},\n \"didDocumentMetadata\": null\n}" + } + ] + } + ] + }, + { + "name": "update did", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update did as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 13:41:30 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as authtoken is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "fail as authtoken is not passed", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:22:09 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token passed in header is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:23:12 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin mismatch", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "origin mismatch", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:25:07 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update didDocument as body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", + " // pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "133" + }, + { + "key": "ETag", + "value": "W/\"85-1DKdxkFDlpCjD38tqVB9u3DSWoc\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:27:32 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "type issue for didDocument", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail to update did as didDocument passed in body is of type string it should be object\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"nested property didDocument must be either object or array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "type issue for didDocument", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 13:49:02 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "154" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"9a-n55lEM73+VkUqXLGw8onXdMVdYM\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"nested property didDocument must be either object or array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty didDocument", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail to update did as didDocument passed in body is empty object\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument.controller must be an array\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"didDocument.authentication must be an array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.assertionMethod must be an array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "empty didDocument", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 13:51:31 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "187" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"bb-ZUkYKN5eCE9vtfUE06qRuir0h98\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument.controller must be an array\",\n \"didDocument.authentication must be an array\",\n \"didDocument.assertionMethod must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update did as neither verificationMethod nor signInfo Array is passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"HID-SSI-SDK:: Error: params.signInfos is required to register a did\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "verificationMethodId not passed", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 13:52:46 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "122" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"7a-8vEsizxwxmyaWaRAkyrb/Snf0+U\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"HID-SSI-SDK:: Error: params.signInfos is required to register a did\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId is invalid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Shouldnot able to update did as verificationMethodId passed is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "verificationMethodId is invalid", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:38:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "update did generated using default keyType", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to update did generated using default keyType\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const didDoc= JSON.parse(pm.environment.get('didDoctestNetD'))\r", + "didDoc.alsoKnownAs.push('varsha')\r", + "pm.environment.set('didDoctestNetD', JSON.stringify(didDoc))" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\",\n \"deactivate\":false\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "update did generated using default keyType", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-XhzqBki7zDstfcivBrfD/UqR4+4\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:43:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"500EAEE28F2292FB5B63659140F1AC9582611E089EFDC110DC924BD617ECE5F2\"\n}" + } + ] + }, + { + "name": "update did generated using default keyType and methodSPecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to update did generated using default keyType and methodSpecificId\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const didDoc= JSON.parse(pm.environment.get('didDoctestNetDM'))\r", + "didDoc.alsoKnownAs.push('varsha')\r", + "pm.environment.set('didDoctestNetDM', JSON.stringify(didDoc))" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "update did generated using default keyType and methodSPecificId", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-goVrcm/ft6woeRlMf6Hok5AFD+k\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:45:27 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"FF0AE65710AAC32E546B0A97C1E17EC09548BAD17FFA425F1145225745EB3E6A\"\n}" + } + ] + }, + { + "name": "update did generated using default keyType and publicKey", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to update did generated using default keyType and publicKey\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const didDoc= JSON.parse(pm.environment.get('didDoctestNetDP'))\r", + "didDoc.alsoKnownAs.push('varsha')\r", + "pm.environment.set('didDoctestNetDP', JSON.stringify(didDoc))" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "update did generated using default keyType and publicKey", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-qGQKGq8cS86APVTzJ7sMZRWyM/g\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:46:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"B218A3BE298571F5275FAA6FF1002AA1A3765B8118B379A1F854EC36B3E36726\"\n}" + } + ] + }, + { + "name": "update did generated using default keyType and publicKey and methodSpecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to update did generated using default keyType, publicKey and methodSpecificId\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const didDoc= JSON.parse(pm.environment.get('didDoctestNetDMP'))\r", + "didDoc.alsoKnownAs.push('varsha')\r", + "pm.environment.set('didDoctestNetDMP', JSON.stringify(didDoc))" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "update did generated using default keyType and publicKey and methodSpecificId", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-Xi+fRHWhLbKF/KmFrzsiS0Pq+CE\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:49:36 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"2F042289665D77E06C448D6D2CC36FDD28EA7366BEA283AB1295DD97CC0095ED\"\n}" + } + ] + } + ] + }, + { + "name": "deactivate dids", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to deactivate did as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/did", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:28:36 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as authtoken is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to deactivate did as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "fail as authtoken is not passed", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:22:09 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to deactivate as access token passed in header is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:23:12 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin mismatch", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to deactivate did as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "origin mismatch", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:25:07 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to deactivate did as body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", + " // pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "133" + }, + { + "key": "ETag", + "value": "W/\"85-1DKdxkFDlpCjD38tqVB9u3DSWoc\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:27:32 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "type issue for didDocument", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail to update did as didDocument passed in body is of type string it should be object\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument must be a non-empty object\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"nested property didDocument must be either object or array\")", + " // pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "type issue for didDocument", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "194" + }, + { + "key": "ETag", + "value": "W/\"c2-y4DeYGzVgFQLfsZ63lyFWQu/61I\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:31:29 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument must be a non-empty object\",\n \"nested property didDocument must be either object or array\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty didDocument", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail to update did as didDocument passed in body is empty object\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"didDocument.controller must be an array\")", + " // pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.alsoKnownAs must be an array\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"didDocument.authentication must be an array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"didDocument.assertionMethod must be an array\")", + " // pm.expect(responseBody.message[5]).to.be.equal( \"didDocument.keyAgreement must be an array\")", + " // pm.expect(responseBody.message[6]).to.be.equal(\"didDocument.capabilityInvocation must be an array\")", + " // pm.expect(responseBody.message[7]).to.be.equal(\"didDocument.capabilityDelegation must be an array\")", + " // pm.expect(responseBody.message[8]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "empty didDocument", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "452" + }, + { + "key": "ETag", + "value": "W/\"1c4-1Z6qrEOnfNEPUyqDwPYc+6wJPfo\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:29:14 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"didDocument.id must be a string\",\n \"didDocument.controller must be an array\",\n \"didDocument.alsoKnownAs must be an array\",\n \"didDocument.authentication must be an array\",\n \"didDocument.assertionMethod must be an array\",\n \"didDocument.keyAgreement must be an array\",\n \"didDocument.capabilityInvocation must be an array\",\n \"didDocument.capabilityDelegation must be an array\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "signInfo is required if vmId not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to deactivate did as neither verificationMethodId nor signInfo is passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"HID-SSI-SDK:: Error: params.signInfos is required to deactivate a did\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "vmId or signInfo is required", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:33:54 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "122" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"7a-8vEsizxwxmyaWaRAkyrb/Snf0+U\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"HID-SSI-SDK:: Error: params.signInfos is required to register a did\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId is invalid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to deactivate did as verificationMethodId passed is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "verificationMethodId is invalid", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:38:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "deactivate did generated using default keyType", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to update did generated using default keyType\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\",\n \"deactivate\":true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "update did generated using default keyType", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetD}},\n \"verificationMethodId\":\"{{didtestnetD}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-XhzqBki7zDstfcivBrfD/UqR4+4\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:43:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"500EAEE28F2292FB5B63659140F1AC9582611E089EFDC110DC924BD617ECE5F2\"\n}" + } + ] + }, + { + "name": "resolve deactivated did", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + "", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using default key type\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetD}}" + ] + } + }, + "response": [ + { + "name": "resolve deactivated did", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/{{didtestnetD}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "{{didtestnetD}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1253" + }, + { + "key": "ETag", + "value": "W/\"4e5-e8P0aImiMnG8hA4LiEcmWtL/OuE\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 05:05:22 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\",\n \"controller\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\",\n \"publicKeyMultibase\": \"z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z9YwS1JvDVJFHz8kd6BUDt4uMFqt5A3UQWfoQaL5Y26Sj#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-22T05:03:17Z\",\n \"updated\": \"2023-02-22T05:03:46Z\",\n \"deactivated\": true,\n \"versionId\": \"25646CAA58B4F576E3201F3CADEA748C1CCA9DA7E37628F740AD0ADFD596F759\"\n }\n}" + } + ] + }, + { + "name": "deactivate did generated using default keyType and methodSPecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to update did generated using default keyType and methodSpecificId\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "update did generated using default keyType and methodSPecificId", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-goVrcm/ft6woeRlMf6Hok5AFD+k\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 00:45:27 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"FF0AE65710AAC32E546B0A97C1E17EC09548BAD17FFA425F1145225745EB3E6A\"\n}" + } + ] + }, + { + "name": "resolve deactivated did generated with MSId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + "", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using methodSpecificId and default key type\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDM}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDM}}" + ] + } + }, + "response": [ + { + "name": "resolve deactivated did", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/{{didtestnetDM}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "{{didtestnetDM}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1253" + }, + { + "key": "ETag", + "value": "W/\"4e5-xECHNBvuAqZbleoAF6nh9TtGAhs\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 04:47:41 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"controller\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"publicKeyMultibase\": \"zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:48:50Z\",\n \"updated\": \"2023-02-22T04:46:08Z\",\n \"deactivated\": true,\n \"versionId\": \"2B32C7F8D51F95DF3479CDDA970F1A12F6EC5E51CEDB8C5729F9FD6E641CF3B6\"\n }\n}" + } + ] + }, + { + "name": "did already deactivaetd", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var did = pm.environment.get('did2')", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Shouldnot able to deactivate as already deactivated\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(`${did} already deactivated`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "did already deactivaetd", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDM}},\n \"verificationMethodId\": \"{{didtestnetDM}}#key-1\",\n \"deactivate\":true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "398" + }, + { + "key": "ETag", + "value": "W/\"18e-HYpf1vLJThp0IFnpvMR4WD8lh1g\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 04:51:27 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: DidDoc ID: did:hid:testnet:zBHYJww2nnXRbxc4WH9Nmyr3pdAqBWKtMALgZKfgFAnRx: DID Document is deactivated [/home/arnab/code/research/hid-node/x/ssi/verification/did_verification.go:109] With gas wanted: '0' and gas used: '51053' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "deactivate did generated using default keyType and publicKey", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to deactivate did generated using default keyType and publicKey\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\",\n \"deactivate\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "deactivate did generated using default keyType and publicKey", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDP}},\n \"verificationMethodId\": \"{{didtestnetDP}}#key-1\",\n \"deactivate\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-GxNPVoSjX2K0xE7TRl1NOAwR8QQ\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 04:55:30 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"373F1278536F2E58C279F399BDDD28B1E9B08CC4B806240DE1706A728BA4E499\"\n}" + } + ] + }, + { + "name": "resolve deactivated did generated with pubKey", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + "", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using methodSpecificId and default key type\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDP}}" + ] + } + }, + "response": [ + { + "name": "resolve deactivated did generated with pubKey", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/{{didtestnetDP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "{{didtestnetDP}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1253" + }, + { + "key": "ETag", + "value": "W/\"4e5-+n2uw9n6AuIJZKPlJKLkJazGCEw\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 04:55:53 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"controller\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"publicKeyMultibase\": \"z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:52:32Z\",\n \"updated\": \"2023-02-22T04:55:24Z\",\n \"deactivated\": true,\n \"versionId\": \"373F1278536F2E58C279F399BDDD28B1E9B08CC4B806240DE1706A728BA4E499\"\n }\n}" + } + ] + }, + { + "name": "deactivate did generated using default keyType and publicKey and methodSpecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to deactivate did generated using default keyType, publicKey and methodSpecificId\", function () {", + " pm.expect(\"transactionHash\" in responseBody).to.be.true;", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\",\n \"deactivate\":true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "response": [ + { + "name": "deactivate did generated using default keyType and publicKey and methodSpecificId", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoctestNetDMP}},\n \"verificationMethodId\": \"{{didtestnetDMP}}#key-1\",\n \"deactivate\":true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did", + "host": [ + "{{studio-api-baseUrl}}did" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "ETag", + "value": "W/\"56-uQMdgFFCiYqoahEPj++8CpQmgvI\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 04:56:47 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"transactionHash\": \"390C39E6182E2AA9C184FC426FBD48E9A4C71B742E02E0488578DF0817F04022\"\n}" + } + ] + }, + { + "name": "resolve did generated using default keyType and publicKey and methodSpecificId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + "", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to get didDocumentMetadata.deactivated to true for did generated using methodSpecificId and default key type\", function () {", + " pm.expect(\"didDocument\" in responseBody).to.be.true;", + " pm.expect(responseBody.didDocument).to.be.an(\"object\")", + " pm.expect(responseBody.hasOwnProperty(\"didDocumentMetadata\")).to.be.true", + " pm.expect(responseBody.didDocumentMetadata).to.be.an(\"object\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"created\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"updated\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"deactivated\")).to.be.true;", + " pm.expect(responseBody.didDocumentMetadata.deactivated).to.be.a(\"boolean\")", + " pm.expect((responseBody.didDocumentMetadata).hasOwnProperty(\"versionId\")).to.be.true;", + " pm.expect((responseBody.didDocumentMetadata.deactivated)).to.be.equal(true)", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect((responseBody.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.didDocument[\"service\"]).to.be.an('array');", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/resolve/{{didtestnetDMP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "resolve", + "{{didtestnetDMP}}" + ] + } + }, + "response": [ + { + "name": "resolve deactivated did Copy", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}did/{{didtestnetDP}}", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "{{didtestnetDP}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1253" + }, + { + "key": "ETag", + "value": "W/\"4e5-+n2uw9n6AuIJZKPlJKLkJazGCEw\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 04:55:53 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"controller\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"publicKeyMultibase\": \"z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z5ZEou8PZ559jSnLJ3oDrpRkptB3njNmCKBHgEHRhNZAS#key-1\"\n ],\n \"service\": []\n },\n \"didDocumentMetadata\": {\n \"created\": \"2023-02-21T07:52:32Z\",\n \"updated\": \"2023-02-22T04:55:24Z\",\n \"deactivated\": true,\n \"versionId\": \"373F1278536F2E58C279F399BDDD28B1E9B08CC4B806240DE1706A728BA4E499\"\n }\n}" + } + ] + } + ] + }, + { + "name": "create reuse did", + "item": [ + { + "name": "create did withkey default type ED25519 Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create did with default key type `ED25519Verificationkey2020` for testnet\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes('testnet'))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('UNREGISTRED');", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " //D means default case", + " pm.environment.set(\"did\", responseBody.did)", + " pm.environment.set(\"didDoc\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "response": [ + { + "name": "create did withkey default type ED25519 Copy", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/create", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "create" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1183" + }, + { + "key": "ETag", + "value": "W/\"49f-ylwgNIQ7fzG6kb/BhUM+ahf56vc\"" + }, + { + "key": "Date", + "value": "Tue, 28 Feb 2023 06:36:57 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"registrationStatus\": \"UNREGISTRED\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"controller\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"publicKeyMultibase\": \"z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z911r8Wv3SvdxC1yUAZpdLDrn12xuhnh41S11CbrVJh5Y#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + }, + { + "name": "register did with default key", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to register did generated with default key type `ED25519Verificationkey2020` for testnet\", function () {", + " pm.expect(\"did\" in responseBody).to.be.true;", + " pm.expect(responseBody.did.includes('testnet'))", + " pm.expect(responseBody.hasOwnProperty(\"registrationStatus\")).to.be.true;", + " pm.expect(responseBody.registrationStatus).to.be.eql('COMPLETED');", + " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", + " pm.expect(responseBody.transactionHash).not.be.empty", + " pm.expect(responseBody.hasOwnProperty(\"metaData\")).to.be.true;", + " pm.expect(responseBody.metaData).to.be.an(\"object\")", + " pm.expect((responseBody.metaData).hasOwnProperty(\"didDocument\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"@context\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.a('string');", + " const did = pm.environment.get('did')", + " pm.expect(responseBody.metaData.didDocument[\"id\"]).to.be.equal(did)", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"controller\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"alsoKnownAs\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"alsoKnownAs\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"verificationMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument[\"verificationMethod\"][0])).to.be.an('object')", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"id\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"type\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0].type)).to.be.equal('Ed25519VerificationKey2020');", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"blockchainAccountId\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"controller\")).to.be.true;", + " pm.expect((responseBody.metaData.didDocument.verificationMethod[0]).hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + "", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"authentication\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"authentication\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"assertionMethod\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"assertionMethod\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"keyAgreement\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"keyAgreement\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityInvocation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityInvocation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"capabilityDelegation\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"capabilityDelegation\"]).to.be.an('array');", + " pm.expect((responseBody.metaData.didDocument).hasOwnProperty(\"service\")).to.be.true;", + " pm.expect(responseBody.metaData.didDocument[\"service\"]).to.be.an('array');", + " pm.environment.set(\"didDoc\", JSON.stringify(responseBody.metaData.didDocument))", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoc}},\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "response": [ + { + "name": "register did with default key Copy", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"didDocument\":{{didDoc}},\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}did/register", + "host": [ + "{{studio-api-baseUrl}}did" + ], + "path": [ + "register" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1266" + }, + { + "key": "ETag", + "value": "W/\"4f2-euoLxBwuhfUyBhkP4e9W52DGAy8\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 05:12:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"did\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"registrationStatus\": \"COMPLETED\",\n \"transactionHash\": \"6BD61EE6BE578C9A0FB22F77A70A21966CA95083CF951DA1962511F2DCBFC083\",\n \"metaData\": {\n \"didDocument\": {\n \"@context\": [\n \"https://www.w3.org/ns/did/v1\"\n ],\n \"id\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"controller\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\"\n ],\n \"alsoKnownAs\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\"\n ],\n \"verificationMethod\": [\n {\n \"id\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"publicKeyMultibase\": \"z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U\",\n \"blockchainAccountId\": \"\"\n }\n ],\n \"authentication\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"assertionMethod\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"keyAgreement\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"capabilityInvocation\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"capabilityDelegation\": [\n \"did:hid:testnet:z7xDb21X6Y3q7MF9TiQN6hupJiNAYq9PFRFN9ZootZ78U#key-1\"\n ],\n \"service\": []\n }\n }\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Schemas", + "item": [ + { + "name": "create schema", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create schema as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/schema", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "schema" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/schema", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:43:12 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 07:55:54 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "origin not passed", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 08:03:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body in schema", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as request body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema must be a non-empty object\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "empty body in schema", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "189" + }, + { + "key": "ETag", + "value": "W/\"bd-4k7ej2J3Ur64phdmP/JbGXuS298\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 08:32:22 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema must be a non-empty object\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty schema field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema is passed in request body and it is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema.name should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schema.name must be a string\")", + "", + " pm.expect(responseBody.message[2]).to.be.equal(\"schema.author should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"schema.author must be a string\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"schema.fields must contain at least 1 elements\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"namespace must be a string\")", + "", + " pm.expect(responseBody.message[8]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "empty schema field", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "390" + }, + { + "key": "ETag", + "value": "W/\"186-K+kfBSGJWSVK2K97X2qjs2kf/2k\"" + }, + { + "key": "Date", + "value": "Fri, 17 Feb 2023 11:29:54 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.name should not be empty\",\n \"schema.name must be a string\",\n \"schema.author should not be empty\",\n \"schema.author must be a string\",\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty schema.name field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema is passed in request body and it is has empty name fiekd\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema.name should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schema.author should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"schema.author must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"schema.fields must contain at least 1 elements\")", + "", + " pm.expect(responseBody.message[5]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"namespace must be a string\")", + "", + " pm.expect(responseBody.message[7]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "empty schema.name field", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "359" + }, + { + "key": "ETag", + "value": "W/\"167-bigYpWyz3bsMtSZqun+WP3FAArI\"" + }, + { + "key": "Date", + "value": "Fri, 17 Feb 2023 11:32:33 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.name should not be empty\",\n \"schema.author should not be empty\",\n \"schema.author must be a string\",\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "schema.author field not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema.name is passed in request body\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema.author should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schema.author must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"schema.fields must contain at least 1 elements\")", + "", + " pm.expect(responseBody.message[4]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"namespace must be a string\")", + "", + " pm.expect(responseBody.message[6]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "schema.author field not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "325" + }, + { + "key": "ETag", + "value": "W/\"145-C7D5KTk6HfM7m3dxlCZmOpyb9lI\"" + }, + { + "key": "Date", + "value": "Fri, 17 Feb 2023 11:46:40 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.author should not be empty\",\n \"schema.author must be a string\",\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty schema.author", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema.name is passed in request body\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"author cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "empty schema.author", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "77" + }, + { + "key": "ETag", + "value": "W/\"4d-8l1NN7nhrwKzrS0BgtwgkQL4CGU\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 09:04:44 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"author cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid schema.author", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema.name is passed in request body\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid author\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"xyz\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "invalid schema.author", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"xyz\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "69" + }, + { + "key": "ETag", + "value": "W/\"45-WbQcyl/Ldgkf8KUPadIyDjBkZ0Q\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 09:07:55 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid author\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "schema.additionalProperties not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema.additionalProperties is not passed.\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schema.fields must contain at least 1 elements\")", + "", + " pm.expect(responseBody.message[2]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "schema.additionalProperties not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "256" + }, + { + "key": "ETag", + "value": "W/\"100-A3t13plygImNsyRlfLCQkHpOQf0\"" + }, + { + "key": "Date", + "value": "Fri, 17 Feb 2023 11:36:10 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid schema.additionalProperties", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema.additionalProperties is not passed.\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema.additionalProperties must be a boolean value\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schema.fields must contain at least 1 elements\")", + "", + " pm.expect(responseBody.message[2]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":\"\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "invalid schema.additionalProperties", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":\"\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "256" + }, + { + "key": "ETag", + "value": "W/\"100-A3t13plygImNsyRlfLCQkHpOQf0\"" + }, + { + "key": "Date", + "value": "Fri, 17 Feb 2023 11:37:29 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.additionalProperties must be a boolean value\",\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "schema.fields not passed or empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field schema.fields is not passed or it is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema.fields must contain at least 1 elements\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":true\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "schema.fields not passed or empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\":\"Ticket schema\",\n \"author\":\"{{did}}\",\n \"additionalProperties\":true\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "162" + }, + { + "key": "ETag", + "value": "W/\"a2-gxYhrSwvE4QewhIQs1mHTE6EO1c\"" + }, + { + "key": "Date", + "value": "Fri, 17 Feb 2023 08:12:49 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.fields must contain at least 1 elements\",\n \"namespace should not be empty\",\n \"namespace must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "type mismatch for schema.fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as schema.field passed is of invalid type\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schema.fields must contain at least 1 elements\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schema.each value in nested property fields must be either object or array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":\"\"\n\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "invalid type for schema.field", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":\"\"\n\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "279" + }, + { + "key": "ETag", + "value": "W/\"117-eqV5Cdm0hrSouJi7hk4VqMLZzUg\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 09:45:06 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schema.fields must contain at least 1 elements\",\n \"schema.each value in nested property fields must be either object or array\",\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "namespace is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as only field namespace is not passed.\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "namespace is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "153" + }, + { + "key": "ETag", + "value": "W/\"99-1NFEqxPQsq35ZT6YmUCh7vIqsBc\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 09:48:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace should not be empty\",\n \"namespace must be a string\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty namespace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as namespace is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "empty namespace", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\":[\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "124" + }, + { + "key": "ETag", + "value": "W/\"7c-CZah9l0mddolWA2sOGGMFOtD/wI\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 09:50:22 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId field is not passed in request body\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId must be a string\")", + "", + " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "verificationMethodId not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "92" + }, + { + "key": "ETag", + "value": "W/\"5c-ii60+QasIfPIWaDzGUPaCa22xIU\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 09:30:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty verificationMethodId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId passed in request body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "empty verificationMethodId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "91" + }, + { + "key": "ETag", + "value": "W/\"5b-zP9LI+Oe9F8CDquWcPNgIxi8yfo\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 09:34:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid verificationMethodId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId passed in request body is not of type verificationMethodId\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "invalid verificationMethodId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 09:34:57 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid namespace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var namespace=JSON.parse( pm.request.body.raw).namespace", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as namespace passed in request body is not valid.It should be testnet but got some other\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(`${namespace} is invalid nameSpace`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"fyre\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "invalid namespace", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"fyre\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "350" + }, + { + "key": "ETag", + "value": "W/\"15e-M08Ywm3S0kox3D5P2aOv+JU6mM8\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 09:44:16 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: expected did namespace testnet, got fyre: Invalid schema Id [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_schema.go:36] With gas wanted: '0' and gas used: '52197' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create schema", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to pass and create new schema\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"schemaId\")).to.be.true;", + " pm.expect(responseBody.schemaId).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"transactionHash\")).to.be.true;", + " pm.expect(responseBody.transactionHash).to.be.an(\"string\");", + " pm.environment.set(\"schemaId\", responseBody.schemaId)", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"description\": \"Ticket schema\",\n \"additionalProperties\": false,\n \"fields\": [\n {\n \"name\": \"name\",\n \"format\": \"\",\n \"type\": \"string\",\n \"isRequired\": false\n }\n ]\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "create schema", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schema\": {\n \"name\": \"Ticket schema\",\n \"author\": \"{{did}}\",\n \"additionalProperties\": false\n },\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "165" + }, + { + "key": "ETag", + "value": "W/\"a5-j+sPjcbt3i4httdNgTWKTAMcReU\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 09:56:45 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"schemaId\": \"sch:hid:testnet:z3GrkvxjwNHc72y9YZ7sV8AZqhDo9eJJaYbuj1KTY8bBq:1.0\",\n \"transactionHash\": \"1E90D0835C81EF6D016C2A38086ABF2EA01EC15EBA4C5468D1E0B61AD6D23A6E\"\n}" + } + ] + } + ] + }, + { + "name": "get schema list", + "item": [ + { + "name": "invalid subdomin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to get schema list as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/schema", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "schema" + ] + } + }, + "response": [ + { + "name": "invalid subdomin", + "originalRequest": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/schema", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:49:24 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch schema list as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 07:55:54 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch schema list as origin passed in header not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "origin not passed", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 08:03:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "negative limit value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch schema list as limit is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema?page =2&limit=-10", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "query": [ + { + "key": "page ", + "value": "2" + }, + { + "key": "limit", + "value": "-10" + } + ] + } + }, + "response": [ + { + "name": "negative limit value", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema?page =2&limit=-10", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "query": [ + { + "key": "page ", + "value": "2" + }, + { + "key": "limit", + "value": "-10" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "84" + }, + { + "key": "ETag", + "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 11:11:45 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "negative page value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to feetch schema list as page is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema?page=-1&limit=1", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "1" + } + ] + } + }, + "response": [ + { + "name": "negative page value", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema?page=-1&limit=1", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "1" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 11:12:53 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "get schema list", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var page;", + "var limit;", + "var urlString = pm.request.url.toString();", + "var did = pm.environment.get('did')", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "", + "pm.test(\"Should be able to pass and have list of schemaIds in response body \", function () {", + " try {", + " page = urlString.match(/page=(\\d+)/)[1];", + " page = (parseInt(page))", + " } catch (e) {", + " page = 1", + " }", + " try {", + " limit = urlString.match(/limit=(\\d+)/)[1];", + " limit = parseInt(limit)", + " } catch (e) {", + " limit = 10", + " }", + " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", + " pm.expect(responseBody.totalCount).to.be.a('number')", + " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", + " pm.expect(responseBody.data).to.be.an(\"array\");", + " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema?page=1&limit=20", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "get schema list", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema?page=1&limit=20", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "229" + }, + { + "key": "ETag", + "value": "W/\"e5-UL6nLKgS9iA449LQtWw4NblFPMY\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 11:15:52 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"totalCount\": 3,\n \"data\": [\n \"sch:hid:testnet:z2qzw2qTqP68vrZTe5tCBpC3E88ARxvGruVmLtZxsu5Mz:1.0\",\n \"sch:hid:testnet:z3GrkvxjwNHc72y9YZ7sV8AZqhDo9eJJaYbuj1KTY8bBq:1.0\",\n \"sch:hid:testnet:z77YDLPSyXRSLwgKrbVTP2RbFTRNrzUn3sqDiStu9RWcG:1.0\"\n ]\n}" + } + ] + } + ] + }, + { + "name": "resolve schema", + "item": [ + { + "name": "invalid subdomin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to resolve as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/schema", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "schema" + ] + } + }, + "response": [ + { + "name": "invalid subdomin", + "originalRequest": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:3001/api/v1/schema", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "schema" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:52:07 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 07:55:54 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "response": [ + { + "name": "origin not passed", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}schema", + "host": [ + "{{studio-api-baseUrl}}schema" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 08:03:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "wrong schemaId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "let schemaId= (pm.request.url.path).toString().split(',')", + "schemaId= schemaId[schemaId.length-1]", + "var appId= pm.environment.get('appId')", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as schemaId passed in request params is wrong\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(404)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( `${schemaId} could not resolve this schema`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Not Found\")", + "});", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema/xyz", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "path": [ + "xyz" + ] + } + }, + "response": [ + { + "name": "wrong schemaId", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema/xyz", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "path": [ + "xyz" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:53:48 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "86" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"56-zDHFjPvyPEx0MuiLFqwAiKSDVzQ\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 404,\n \"message\": [\n \"xyz could not resolve this schema\"\n ],\n \"error\": \"Not Found\"\n}" + } + ] + }, + { + "name": "resolve schema", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.responseBody", + "var responseBody = pm.response.json()", + "var schemaId = pm.environment.get('schemaId')", + "var author = pm.environment.get('did')", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve newly created schema and hve list of properties in it\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.type).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"modelVersion\")).to.be.true;", + " pm.expect(responseBody.modelVersion).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.id).to.be.a('string')", + " pm.expect(responseBody.id).to.be.equal(schemaId)", + " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"author\")).to.be.true;", + " pm.expect(responseBody.author).to.be.a('string')", + " pm.expect(responseBody.author).to.be.eql(author)", + " pm.expect(responseBody.hasOwnProperty(\"authored\")).to.be.true;", + " pm.expect(responseBody.authored).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"schema\")).to.be.true;", + " pm.expect(responseBody.schema).to.be.a('object')", + " pm.expect(responseBody.schema.hasOwnProperty(\"schema\")).to.be.true;", + " pm.expect(responseBody.schema.schema).to.be.a('string')", + " pm.expect(responseBody.schema.hasOwnProperty(\"description\")).to.be.true;", + " pm.expect(responseBody.schema.description).to.be.a('string')", + " pm.expect(responseBody.schema.hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.schema.type).to.be.a('string')", + " pm.expect(responseBody.schema.type).to.be.equal('object')", + " pm.expect(responseBody.schema.hasOwnProperty(\"properties\")).to.be.true;", + " pm.expect(responseBody.schema.properties).to.be.a('object')", + " pm.expect(responseBody.schema.hasOwnProperty(\"required\")).to.be.true;", + " pm.expect(responseBody.schema.required).to.be.a('array')", + " pm.expect(responseBody.schema.hasOwnProperty(\"additionalProperties\")).to.be.true;", + " pm.expect(responseBody.schema.additionalProperties).to.be.a('boolean')", + " pm.expect(responseBody.hasOwnProperty(\"proof\")).to.be.true;", + " pm.expect(responseBody.proof).to.be.a('object')", + " pm.expect(responseBody.proof.hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.proof.type).to.be.a('string')", + " pm.expect(responseBody.proof.hasOwnProperty(\"created\")).to.be.true;", + " pm.expect(responseBody.proof.created).to.be.a('string')", + " pm.expect(responseBody.proof.hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.proof.verificationMethod).to.be.a('string')", + " pm.expect(responseBody.proof.verificationMethod).to.be.eql(`${author}` + '#key-1')", + " pm.expect(responseBody.proof.hasOwnProperty(\"proofPurpose\")).to.be.true;", + " pm.expect(responseBody.proof.proofPurpose).to.be.a('string')", + " pm.expect(responseBody.proof.proofPurpose).to.be.eql('assertion')", + " pm.expect(responseBody.proof.hasOwnProperty(\"proofValue\")).to.be.true;", + " pm.expect(responseBody.proof.proofValue).to.be.a('string')", + "", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema/{{schemaId}}", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "path": [ + "{{schemaId}}" + ] + } + }, + "response": [ + { + "name": "resolve schema", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}schema/{{schemaId}}", + "host": [ + "{{studio-api-baseUrl}}schema" + ], + "path": [ + "{{schemaId}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "749" + }, + { + "key": "ETag", + "value": "W/\"2ed-Lr5Zazfqtiz3XkrxUpiJ/2nRcMc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Feb 2023 10:39:16 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"type\": \"https://w3c-ccg.github.io/vc-json-schemas/v1/schema/1.0/schema.json\",\n \"modelVersion\": \"1.0\",\n \"id\": \"sch:hid:testnet:z3GrkvxjwNHc72y9YZ7sV8AZqhDo9eJJaYbuj1KTY8bBq:1.0\",\n \"name\": \"TicketSchema\",\n \"author\": \"did:hid:testnet:z12cYPtkuzG33qNwP6ZL7LcSaNeTrkLX1eLtkTwCb42ES\",\n \"authored\": \"2023-02-15T09:54:56Z\",\n \"schema\": {\n \"schema\": \"http://json-schema.org/draft-07/schema\",\n \"description\": \"\",\n \"type\": \"object\",\n \"properties\": \"\",\n \"required\": [],\n \"additionalProperties\": false\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-15T09:54:56Z\",\n \"verificationMethod\": \"did:hid:testnet:z12cYPtkuzG33qNwP6ZL7LcSaNeTrkLX1eLtkTwCb42ES#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"6t0B1PuD/E80Lr0zpwTC0zWeSe/+0oTT7TsfTLJTmTvYqwMw4CICEETKTL+754PcTZ8zumzbnV1+l9f7KzLUAQ==\"\n }\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Credentials", + "item": [ + { + "name": "create credential", + "item": [ + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create creadential as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/issue", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "issue" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/issue", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:57:11 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:33:19 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token is not passed in header is expired \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "token expired error", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:32:24 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:50:08 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as no request body is passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schemaContext should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schemaContext must be an array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"type must be an array\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"expirationDate should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"expirationDate must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"fields must be a non-empty object\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[8]).to.be.equal(\"persist must be a boolean value\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Thu, 16 Nov 2023 04:48:38 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "374" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"176-m0m0bb49LnL+YC4/BeDDKCz4lJM\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schemaContext should not be empty\",\n \"schemaContext must be an array\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty subject", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as subjectDid is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"subjectDid cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "empty subject", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "81" + }, + { + "key": "ETag", + "value": "W/\"51-arJk0VsmxvAAUl2Y1txQ9k0pjh4\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:51:28 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"subjectDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid subjectDid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as subjectDid passed is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subjectDid\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "invalid subjectDid", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "73" + }, + { + "key": "ETag", + "value": "W/\"49-GJ80+Jsh1+mPrHqunWrc1ErGH5k\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:51:45 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subjectDid\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "issuerDid not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to failas issuerDid field is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " ", + " pm.expect(responseBody.message[0]).to.be.equal(\"schemaContext should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal( \"schemaContext must be an array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"type must be an array\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"expirationDate should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"expirationDate must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"fields must be a non-empty object\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[8]).to.be.equal(\"persist must be a boolean value\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "issuerDid not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Thu, 16 Nov 2023 04:58:42 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "374" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"176-m0m0bb49LnL+YC4/BeDDKCz4lJM\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schemaContext should not be empty\",\n \"schemaContext must be an array\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty issuerDid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as issuerDid is empty string\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"issuerDid cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "empty issuerDid", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "80" + }, + { + "key": "ETag", + "value": "W/\"50-Q6AfT/Gjegi9N8P/x8NjP3sBUsI\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:52:35 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"issuerDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid issuerDid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as issuerDid passed is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuerDid\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "invalid issuerDid", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-V0YBWtrysi41hJWGfM2AhXxFVSo\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:52:57 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuerDid\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "neither schemaId nor schemaContext is passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var namespace = JSON.parse(pm.request.body.raw).namespace", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as neither schemaId nor schemaCOntext is passed in request body\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schemaContext should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"schemaContext must be an array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"type must be an array\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"expirationDate should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"expirationDate must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"fields must be a non-empty object\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[8]).to.be.equal(\"persist must be a boolean value\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "neither schemaId nor schemaContext is passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:01:58 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "374" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"176-m0m0bb49LnL+YC4/BeDDKCz4lJM\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schemaContext should not be empty\",\n \"schemaContext must be an array\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "schemaContext is not arrray", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as schemaContext passed in request body is empty array\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"schemaContext should not be empty\")", + "", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": []\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "schemaContext is not arrray", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": []\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:03:07 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "341" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"155-KATO/UTWeBMYYa3FkE6wwvQlVm4\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"schemaContext should not be empty\",\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "type field must be array", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as type field passed with schemaContext is not an array\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"type must be an array\")", + " ", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": \"RandomCredential\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "type field must be array", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": \"RandomCredential\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:04:37 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "305" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"131-sV2UXHrGORVLRdlVoTJLBZBO4Mc\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"type must be an array\",\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "type field is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as type field passed with type is empty array\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"expirationDate should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"expirationDate must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"fields must be a non-empty object\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"namespace must be a string\")", + " ", + " pm.expect(responseBody.message[5]).to.be.equal(\"persist must be a boolean value\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\":[],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "type field is empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\":[],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\"\n \n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:05:49 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "281" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"119-XqBulhKjASiXYav1ySTcQtnyW7g\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "expirationDate not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as expirationDate field is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"expirationDate should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"expirationDate must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"fields must be a non-empty object\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"persist must be a boolean value\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "expirationDate not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:06:31 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "281" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"119-XqBulhKjASiXYav1ySTcQtnyW7g\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expirationDate should not be empty\",\n \"expirationDate must be a string\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "expirationDate is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as expirationDate is empty \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"expirationDate should not be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "expirationDate is empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "330" + }, + { + "key": "ETag", + "value": "W/\"14a-kOPv7APGQAQoaxVJAruuCvbmCOI\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:27:11 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expirationDate should not be empty\",\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "field is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as field parameter is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"fields must be a non-empty object\")", + " ", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "field is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "293" + }, + { + "key": "ETag", + "value": "W/\"125-oiPSfMVnJfW1lwMk4PYN3z86JGs\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:26:38 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "field parameter is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as fields parameter passed is empty object\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"fields must be a non-empty object\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "field parameter is empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "293" + }, + { + "key": "ETag", + "value": "W/\"125-oiPSfMVnJfW1lwMk4PYN3z86JGs\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:26:08 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"fields must be a non-empty object\",\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "namespace is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as namespace parameter is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"namespace must be a string\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "namespace is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "257" + }, + { + "key": "ETag", + "value": "W/\"101-k3XdJMDX6V8nbm0BYVt621rD37Q\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:25:33 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "namespace is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as namespace is empty string\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"namespace must be one of the following values: 'testnet'\")", + " ", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "namespace is empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "228" + }, + { + "key": "ETag", + "value": "W/\"e4-SqFi4AAmJm7N5DQ5WDCp7VuM78w\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:25:06 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"persist must be a boolean value\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "verificationMethodId is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "169" + }, + { + "key": "ETag", + "value": "W/\"a9-bO2WicPIpdcCiUVjKxPf2w1F2kM\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:56:37 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty verificationMethodId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "empty verificationMethodId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "91" + }, + { + "key": "ETag", + "value": "W/\"5b-zP9LI+Oe9F8CDquWcPNgIxi8yfo\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:56:52 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid verificationMethodId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as verificationMethodId passed is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "invalid verificationMethodId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:57:09 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "persist is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as persist field is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"persist must be a boolean value\")", + "", + " ", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "persist is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"schemaContext\": [\n \"https://schema.org\"\n ],\n \"type\": [\n \"RandomCredential\"\n ],\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"xyz\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-w3jIdwUoG5xhVVSxm2gp4/WqAjk\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:35:34 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"persist must be a boolean value\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "sending wrong parameter in fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create a new credential as schemaId passed has only name property and additional property is made false but sending other property than name\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "sending wrong parameter in fields", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "139" + }, + { + "key": "ETag", + "value": "W/\"8b-f4KYwD4RaJSrcoUxl8YMe3KNhQE\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:57:42 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "sending extra property in field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create a new credential as schemaId passed has only name property and additional property is made false but sending other property with name\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\",\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "sending extra property in field", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\",\"age\":25},\n \"namespace\":\"testnet\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "139" + }, + { + "key": "ETag", + "value": "W/\"8b-f4KYwD4RaJSrcoUxl8YMe3KNhQE\"" + }, + { + "key": "Date", + "value": "Thu, 16 Feb 2023 12:58:27 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Only [\\\"name\\\"] attributes are possible. additionalProperties is false in the schema\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid namespace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var namespace=JSON.parse( pm.request.body.raw).namespace", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as namespace passed in request body is not valid.It should be testnet but got some other\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "invalid namespace", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"subjectDid\":\"{{did}}\",\n \"issuerDid\":\"{{did}}\",\n \"expirationDate\":\"2027-12-10T18:30:00.000Z\",\n \"fields\":{\"name\":\"varsha\"},\n \"namespace\":\"\",\n \"verificationMethodId\":\"{{did}}#key-1\",\n \"schemaId\":\"{{schemaId}}\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "111" + }, + { + "key": "ETag", + "value": "W/\"6f-GHTX8xTtTfuBk7ego9v2Ay35vEE\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:22:13 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create credential without schemaId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const { persist, issuerDid, subjectDid, expirationDate, type, verificationMethodId } = JSON.parse(pm.request.body.raw)", + "const credentialType = type[0]", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create credential without schemaId\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", + " pm.expect(responseBody.credentialDocument).to.be.a('object')", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", + " pm.expect(responseBody.credentialDocument[\"type\"].includes(credentialType))", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.issuer).to.be.eql(issuerDid)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.eql(expirationDate)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(verificationMethodId);", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", + "", + " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", + " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", + "", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.issuer).to.be.eql(issuerDid)", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.eql(expirationDate)", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", + " pm.expect(responseBody.persist).to.be.an(\"boolean\");", + " pm.expect(responseBody.persist).to.be.eql(persist)", + " //vcIdWOS means vcId generated without schemaId", + " pm.environment.set(\"vcIdWOS\", responseBody.credentialDocument.id)", + " pm.environment.set(\"vcDocWOS\",JSON.stringify(responseBody.credentialDocument))", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": [\"RandomCredential\"],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "create credential without schemaId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"schemaContext\": \n [ \"https://schema.org\"],\n \"type\": [\"RandomCredential\"],\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1436" + }, + { + "key": "ETag", + "value": "W/\"59c-2KgRQkWK/gOk0fm8eZ0d3g7UFoE\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 11:36:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://schema.org\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:z7Mz39M9TEpoesPFttubRVjjAHCKNq9Z6naPxHASHxYnB\",\n \"type\": [\n \"VerifiableCredential\",\n \"RandomCredential\"\n ],\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:35:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:z7Mz39M9TEpoesPFttubRVjjAHCKNq9Z6naPxHASHxYnB\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-22T11:36:53Z\",\n \"verificationMethod\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z61gwTaC4tc9RxobKQs1H7bRtAMs8pr6x43RNRWMicS1gSXwm44CyrdnkigziXBN35fVAPDgtS78MyvVE5hXkRJww\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:z7Mz39M9TEpoesPFttubRVjjAHCKNq9Z6naPxHASHxYnB\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:35:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"d072f9428ee6a176d5355ceaac64db067a770cb87fa56cebd36c2f1d920c3636\"\n },\n \"persist\": true\n}" + } + ] + }, + { + "name": "create credential with schemaId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const { persist, issuerDid, subjectDid, expirationDate, verificationMethodId } = JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create credential with schemaId generated at hypersign and persist true\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", + " pm.expect(responseBody.credentialDocument).to.be.a('object')", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.issuer).to.be.eql(issuerDid)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.eql(expirationDate)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(verificationMethodId);", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", + "", + " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", + " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", + "", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.issuer).to.be.eql(issuerDid)", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.eql(expirationDate)", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", + " pm.expect(responseBody.persist).to.be.an(\"boolean\");", + " pm.expect(responseBody.persist).to.be.eql(persist)", + " pm.expect(responseBody.persist).to.be.equal(true)", + " //vcIdPT means vcId generated using schemaId with persist flag true", + " pm.environment.set(\"vcIdPT\", responseBody.credentialDocument.id)", + " pm.environment.set(\"vcDocPT\",JSON.stringify(responseBody.credentialDocument))", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "create credential with schemaId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": true\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1703" + }, + { + "key": "ETag", + "value": "W/\"6a7-fYpjoT0/Ri0gRn/pzuflFJBOPbE\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 11:37:39 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:z2a2v3WLRUc9XQfQTc7eSVNtztwQ8Vk2Pw7YVJW2zgmqv\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-22T11:35:53Z\",\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:z2a2v3WLRUc9XQfQTc7eSVNtztwQ8Vk2Pw7YVJW2zgmqv\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-22T11:37:34Z\",\n \"verificationMethod\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z2WRuEUipNnLiDf95c2qxQ3CLkYjZrNCEUZGugRkczWMUscf1mk49TSMt18vQLpa9p8au7ySyyqHkTExyAP2etkTv\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:z2a2v3WLRUc9XQfQTc7eSVNtztwQ8Vk2Pw7YVJW2zgmqv\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:35:53Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"1087a4c4972783078c709720c1684d85c9593b2cfab402416ad2b0ac0811842b\"\n },\n \"persist\": true\n}" + } + ] + }, + { + "name": "create credential with schemaId with persists False", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const { persist, issuerDid, subjectDid, expirationDate, verificationMethodId } = JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to issue credential with schemaId generated at hypersign with persist false\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", + " pm.expect(responseBody.credentialDocument).to.be.a('object')", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.issuer).to.be.eql(issuerDid)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.eql(expirationDate)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(verificationMethodId);", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", + "", + " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", + " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", + "", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.issuer).to.be.eql(issuerDid)", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.eql(expirationDate)", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", + " pm.expect(responseBody.persist).to.be.an(\"boolean\");", + " pm.expect(responseBody.persist).to.be.eql(persist)", + " //vcIdPT means vcId generated using schemaId with persist flag false", + " pm.environment.set(\"vcIdPF\", responseBody.credentialDocument.id)", + " pm.environment.set(\"vcDocPF\",JSON.stringify(responseBody.credentialDocument))", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": false\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "response": [ + { + "name": "credential with PF", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"schemaId\":\"{{schemaId}}\",\n \"subjectDid\": \"{{did}}\",\n \"issuerDid\": \"{{did}}\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"fields\": {\"name\":\"varsha\"},\n \"namespace\": \"testnet\",\n \"verificationMethodId\": \"{{did}}#key-1\",\n \"persist\": false\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/issue", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "issue" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1704" + }, + { + "key": "ETag", + "value": "W/\"6a8-oObALeBEdjPMwN0otyI32+s7zPM\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 11:38:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:z8LivzqPMoNe8WCYEAHks2WSmvnUvYUAGPojYQJCNvCZc\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-22T11:36:33Z\",\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z3Wzv5PU5Dwh2DUFYoCsQBa6Xp1XLqWEKaB5Yti29mHG6:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:z8LivzqPMoNe8WCYEAHks2WSmvnUvYUAGPojYQJCNvCZc\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-22T11:38:14Z\",\n \"verificationMethod\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z3LJXS4576gfagcAKYKjwaS6TWweM5vwv5mZz53DdkjeEXdm3gpwCrTWPVQRjjvPCaVZJUCUajVvn8GWmQRCMHnjN\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:z8LivzqPMoNe8WCYEAHks2WSmvnUvYUAGPojYQJCNvCZc\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z5SduFL7DEbe4rDSJJyBqzo2h8ckcyR6fVrCujwvdwrWN\",\n \"issuanceDate\": \"2023-02-22T11:36:33Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"75a7195ade8ad4e05f83ca4b0920d0f617c0f227999ced3374234deec73a23e6\"\n },\n \"persist\": false\n}" + } + ] + } + ] + }, + { + "name": "credential list", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to get creadential list as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential?page =1&limit=20", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential?page =1&limit=20", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 14:59:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as authtoken is not passed Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to get credentail list as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "fail as authtoken is not passed", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Wed, 22 Feb 2023 11:43:20 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to get credentail list as access token passed in header is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal(\"jwt expired\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-20T11:45:39.000Z\")", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal(\"TokenExpiredError\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjEzOWUyMjZlZTk2NTE2MDJkN2ZmNmFkNjNlOTE4MGY4ZjU5MSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY4NzkxMzksImV4cCI6MTY3Njg5MzUzOX0.on40bkH8-GNzAVSvo_tckq9iYQp2kMpl61E7ZfojYwQ", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page =1&limit=20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-CeWWJEiR/bxTOJQoi8buMSfUsrw\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 04:48:37 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-20T11:45:39.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "negative limit value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to get credentail list as limit is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page =1&limit=-20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "-20" + } + ] + } + }, + "response": [ + { + "name": "negative limit value", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page =1&limit=-20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "-20" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "84" + }, + { + "key": "ETag", + "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 04:49:02 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "negative page value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to get credentail list as page is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page=-1&limit=20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "negative page value", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page=-1&limit=20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 04:49:29 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fetch credential list", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var page;", + "var limit;", + "var urlString = pm.request.url.toString();", + "var did = pm.environment.get('did')", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "", + "pm.test(\"Should be able to pass and have list of credentialId in response body \", function () {", + " try {", + " page = urlString.match(/page=(\\d+)/)[1];", + " page = (parseInt(page))", + " } catch (e) {", + " page = 1", + " }", + " try {", + " limit = urlString.match(/limit=(\\d+)/)[1];", + " limit = parseInt(limit)", + " } catch (e) {", + " limit = 10", + " }", + " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", + " pm.expect(responseBody.totalCount).to.be.a('number')", + " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", + " pm.expect(responseBody.data).to.be.an(\"array\");", + " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page=1&limit=30", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "30" + } + ] + } + }, + "response": [ + { + "name": "fetch credentail list", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential?page=1&limit=20", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "338" + }, + { + "key": "ETag", + "value": "W/\"152-9k2l7IIB0D5Rbvs5+gAsyka+Jus\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 04:49:55 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"totalCount\": 5,\n \"data\": [\n \"vc:hid:testnet:z87DVwi1JHVpgr3Nvvg1eQwakoG5Aq3wUdKJQ5ai3TvZA\",\n \"vc:hid:testnet:zCQA7XnPd5CJa2qsC8b5o1HG3i3eFN134oSGHVHUqmFKE\",\n \"vc:hid:testnet:zHQJahKEnQNFSWgF1aJSZZD3H7Prp1BxzfoortncZ4cUb\",\n \"vc:hid:testnet:zKeT8Re2ZJuVtEQpJaBkofGbMekwqmWzZ6RH37xRcr13\",\n \"vc:hid:testnet:zVj1xGBUMdGEnx7gjQyRWfxLjMs9YdNrXNU1dA34uufQ\"\n ]\n}" + } + ] + } + ] + }, + { + "name": "resolve credential", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to resolve creadential as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/{{vcIdWOS}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/{{vcIdWOS}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:08:54 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as authtoken is not passedf", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to resolve credentail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "fail as authtoken is not passed", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 05:59:08 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as access token passed in header is expired \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 06:01:03 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 06:01:41 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "resolve credential created without schemaId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var urlString = pm.request.url.toString()", + "let retrieveCredential;", + "try {", + " retrieveCredential = urlString.match(/retrieveCredential=(\\d+)/)[1];", + "} catch (e) {", + " retrieveCredential = false", + "}", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve credential and get CredentialStatus only as retrieveCredential set to false\", function () {", + "", + " const vcId = pm.environment.get('vcIdWOS')", + " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", + " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", + "", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", + "", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", + "", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", + " const did = pm.environment.get('did')", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", + " pm.expect(responseBody.persist).to.be.an(\"boolean\");", + " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", + " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", + " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "resolve credential created without schemaId", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "764" + }, + { + "key": "ETag", + "value": "W/\"2fc-sBLzICRd4Md6pL3w4q86AI3nUH0\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 06:31:04 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\",\n \"issuanceDate\": \"2023-02-24T05:40:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"7e4415ce3a4ca86db549938254dc950a8642398b89f4abe451fccf957aacb77e\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T05:40:54Z\",\n \"updated\": \"2023-02-24T05:40:54Z\",\n \"verificationMethod\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"jod36ApBFk8T0c07FuwCYh6sloeUw++IEEca29KLVAm6V03hMTIVMjfDuTTlzhhNuBtgh38EUdexhicE1hwyAQ==\"\n }\n },\n \"persist\": true,\n \"retrieveCredential\": false\n}" + } + ] + }, + { + "name": "resolve credential created without schemaId and fetch credDoc", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "let queryRetrieveCredential = pm.request.url.query.toObject()", + "let retrieveCredential = false", + "if (queryRetrieveCredential != {}) {", + " retrieveCredential = JSON.parse(queryRetrieveCredential['retrieveCredential'])", + "}", + "const vcId = pm.environment.get('vcIdWOS')", + "const did = pm.environment.get('did')", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve credential and get CredentialStatus as well credential document as retrieveCredential set to true and persist is set to true at the time of creating credential\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", + " pm.expect(responseBody.credentialDocument).to.be.a('object')", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", + " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.equal(vcId)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", + "", + " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", + " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", + " pm.expect(responseBody.persist).to.be.an(\"boolean\");", + " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", + " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", + " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}?retrieveCredential=true", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ], + "query": [ + { + "key": "retrieveCredential", + "value": "true" + } + ] + } + }, + "response": [ + { + "name": "resolve credential created without schemaId and fetch credDoc", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdWOS}}?retrieveCredential=true", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdWOS}}" + ], + "query": [ + { + "key": "retrieveCredential", + "value": "true" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1785" + }, + { + "key": "ETag", + "value": "W/\"6f9-2p9VwgbWgQ604sBQgBlDIBez3UY\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 07:11:41 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://schema.org\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"type\": [\n \"VerifiableCredential\",\n \"RandomCredential\"\n ],\n \"issuer\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\",\n \"issuanceDate\": \"2023-02-24T05:40:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T05:42:34Z\",\n \"verificationMethod\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z4HSzbtw7Znup2MGWTFj6UFoFpcCJoZ32gcniBQffaq8BVZ3vsGNq49smtAfiq1ama5EgRjgnwA96aZb7sJn7qjq2\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zFqjQayfAPjYZw7xUg3GxSGHymq4FXsZGynWcGScuar1J\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe\",\n \"issuanceDate\": \"2023-02-24T05:40:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"7e4415ce3a4ca86db549938254dc950a8642398b89f4abe451fccf957aacb77e\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T05:40:54Z\",\n \"updated\": \"2023-02-24T05:40:54Z\",\n \"verificationMethod\": \"did:hid:testnet:z1x7E5edAoMDpt6UNexdGvieRatN8NJwX28r24JaLLwe#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"jod36ApBFk8T0c07FuwCYh6sloeUw++IEEca29KLVAm6V03hMTIVMjfDuTTlzhhNuBtgh38EUdexhicE1hwyAQ==\"\n }\n },\n \"persist\": true,\n \"retrieveCredential\": true\n}" + } + ] + }, + { + "name": "resolve credential created schemaId and persist true", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "let queryRetrieveCredential = pm.request.url.query.toObject()", + "let retrieveCredential = false", + "if (queryRetrieveCredential != {}) {", + " retrieveCredential = JSON.parse(queryRetrieveCredential['retrieveCredential'])", + "}", + "const vcId = pm.environment.get('vcIdPT')", + "const did = pm.environment.get('did')", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve credential and get CredentialStatus and credential document as retrieveCredential set to true and persist is set to true at the time of creating credential\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"credentialDocument\")).to.be.true;", + " pm.expect(responseBody.credentialDocument).to.be.a('object')", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('@context')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"@context\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.an('string')", + " pm.expect(responseBody.credentialDocument[\"id\"]).to.be.equal(vcId)", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument[\"type\"]).to.be.an('array')", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuer).to.be.an(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialDocument.expirationDate).to.be.an(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialSubject')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialSubject.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialSubject.id).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('credentialStatus')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.id).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.credentialStatus.type).to.be.eql(\"CredentialStatusList2017\");", + "", + " pm.expect(responseBody.credentialDocument.hasOwnProperty('proof')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof).to.be.a(\"object\");", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.type).to.be.equal(\"Ed25519Signature2020\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.created).to.be.a(\"string\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialDocument.proof.proofPurpose).to.be.equal(\"assertionMethod\");", + "", + " pm.expect(responseBody.credentialDocument.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialDocument.proof.proofValue).to.be.a(\"string\");", + "", + " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", + " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", + " pm.expect(responseBody.persist).to.be.an(\"boolean\");", + " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", + " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", + " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdPT}}?retrieveCredential=true", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdPT}}" + ], + "query": [ + { + "key": "retrieveCredential", + "value": "true" + } + ] + } + }, + "response": [ + { + "name": "resolve credential created schemaId and persist true", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdPT}}?retrieveCredential=true", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdPT}}" + ], + "query": [ + { + "key": "retrieveCredential", + "value": "true" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "2057" + }, + { + "key": "ETag", + "value": "W/\"809-nC6w99xlbTs88mI9jI7ok5PyjQs\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 08:06:55 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"credentialDocument\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:zDDwvfe8xSdUbyVs9AhYGRLwSwqe6UUKeTXYasJhrczf9\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-24T08:04:36Z\",\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:zDDwvfe8xSdUbyVs9AhYGRLwSwqe6UUKeTXYasJhrczf9\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T08:06:16Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z4JnGK9StrYcoepoeRJjvtCaJs8b99ZMTiEiA6bfNpeRGSWxTmWRVv31QKNd2c2rzan5Zkqe11GPntxH81mNtZB6r\"\n }\n },\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zDDwvfe8xSdUbyVs9AhYGRLwSwqe6UUKeTXYasJhrczf9\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T08:04:36Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"b78ddf223d4ae50a3ce9eeeaba1b160a86da467cb4ac53bcd9343cf76bdfcbce\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T08:04:36Z\",\n \"updated\": \"2023-02-24T08:04:36Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"AJOZG5UaxNelDUaRv/GYx7Akm6PlnvsulZiczxSPYlfHZGPOMCHDlLdlDirwLxZ+A6F3RbqlV0RgoFzOV3FdCw==\"\n }\n },\n \"persist\": true,\n \"retrieveCredential\": true\n}" + } + ] + }, + { + "name": "resolve credential created schemaId and persist false", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "let queryRetrieveCredential = pm.request.url.query.toObject()", + "let retrieveCredential = false", + "if (queryRetrieveCredential != {}) {", + " retrieveCredential = JSON.parse(queryRetrieveCredential['retrieveCredential'])", + "}", + "const vcId = pm.environment.get('vcIdPF')", + "const did = pm.environment.get('did')", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to resolve credential and get only credentialStaus not credDoc even if retrieveCredential is set true as credential is creted with persist flag false\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"credentialStatus\")).to.be.true;", + " pm.expect(responseBody.credentialStatus).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim).to.be.an(\"object\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.id).to.be.eql(vcId)", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.currentStatus).to.be.eql(\"Live\");", + " pm.expect(responseBody.credentialStatus.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.claim.statusReason).to.be.eql(\"Credential is active\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.credentialStatus.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialStatus.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.type).to.be.equal(\"Ed25519Signature2020\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.created).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.credentialStatus.proof.proofPurpose).to.be.equal(\"assertion\");", + " pm.expect(responseBody.credentialStatus.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.credentialStatus.proof.proofValue).to.be.a(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"persist\")).to.be.true;", + " pm.expect(responseBody.persist).to.be.eql(false);", + "", + " pm.expect(responseBody.persist).to.be.an(\"boolean\");", + " pm.expect(responseBody.hasOwnProperty(\"retrieveCredential\")).to.be.true;", + " pm.expect(responseBody.retrieveCredential).to.be.a('boolean');", + " pm.expect(responseBody.retrieveCredential).to.be.eql(retrieveCredential);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdPF}}?retrieveCredential=true", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdPF}}" + ], + "query": [ + { + "key": "retrieveCredential", + "value": "true" + } + ] + } + }, + "response": [ + { + "name": "resolve credential created schemaId and persist false", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential/{{vcIdPF}}?retrieveCredential=true", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "{{vcIdPF}}" + ], + "query": [ + { + "key": "retrieveCredential", + "value": "true" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "766" + }, + { + "key": "ETag", + "value": "W/\"2fe-WdI7AJyRd5c03qwMw/5lO8UmwQM\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 08:32:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"credentialStatus\": {\n \"claim\": {\n \"id\": \"vc:hid:testnet:zG5xQoW87kWtcXS7xsGaFYQ5jc41T9CbhRPbKxyMpKCFL\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is active\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T08:04:54Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"277bd2320240363fd6b5a78e6a53072b7a102c918d773be99d0bb54faf2bf25d\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T08:04:55Z\",\n \"updated\": \"2023-02-24T08:04:55Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"jyDeF+wnN7NsLuxhHiuklgvFxWZlEZiZ9b/vjy/Siqq0jeHOLahnSGaTGCu38KtPcxa+4C8uwp7jT8E0uAFODA==\"\n }\n },\n \"persist\": false,\n \"retrieveCredential\": true\n}" + } + ] + } + ] + }, + { + "name": "update credential", + "item": [ + { + "name": "invalid subdomian", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update creadential as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/status/{{vcIdWOS}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "invalid subdomian", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/status/{{vcIdWOS}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:18:21 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as access token not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update credentail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "fail as access token not passed", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 08:37:04 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential status as token passed is expired \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 08:51:38 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 08:54:40 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as no request body is passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"namespace must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "352" + }, + { + "key": "ETag", + "value": "W/\"160-7TCMGX7LywAnjIT8BP+CBhQKT6g\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:18:17 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"namespace must be a string\",\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty namespace", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as namespace is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\") ", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "empty namespace", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "323" + }, + { + "key": "ETag", + "value": "W/\"143-L7Dq+2/Y4aVC1KA7e3kbCO+xCX8\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:20:43 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid namespace passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as namespace is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"namespace must be one of the following values: 'testnet'\") ", + " pm.expect(responseBody.message[1]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"issuerDid should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"issuerDid must be a string\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"verificationMethodId should not be empty\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"verificationMethodId must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "invalid namespace passed", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "323" + }, + { + "key": "ETag", + "value": "W/\"143-L7Dq+2/Y4aVC1KA7e3kbCO+xCX8\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:21:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"namespace must be one of the following values: 'testnet'\",\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "status is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as status is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + "", + " pm.expect(responseBody.message[0]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "status is not passed", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "264" + }, + { + "key": "ETag", + "value": "W/\"108-KiGuE6Tmrb2houF4Cn1fU2zl3vg\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:23:13 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty status field", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as issuerDid field is empty or invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"status must be one of the following values: LIVE, SUSPEND, REVOKE\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "empty status field", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "264" + }, + { + "key": "ETag", + "value": "W/\"108-KiGuE6Tmrb2houF4Cn1fU2zl3vg\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:25:04 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"status must be one of the following values: LIVE, SUSPEND, REVOKE\",\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "issuerDid not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as issuerDid is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"issuerDid should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"issuerDid must be a string\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "issuerDid not passed", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "196" + }, + { + "key": "ETag", + "value": "W/\"c4-tYSg0PfdScPMshtasZNNqCGb/LY\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:26:58 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"issuerDid should not be empty\",\n \"issuerDid must be a string\",\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "issuerDid is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as issuerDid is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"issuerDid cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "issuerDid is empty", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "80" + }, + { + "key": "ETag", + "value": "W/\"50-Q6AfT/Gjegi9N8P/x8NjP3sBUsI\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:30:12 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"issuerDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid issuerDid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as invalid issuerDid is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuerDid\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"abc\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "invalid issuerDid", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"abc\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-V0YBWtrysi41hJWGfM2AhXxFVSo\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:31:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuerDid\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as verificationMethodId not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"verificationMethodId must be a string\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "verificationMethodId not passed", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "135" + }, + { + "key": "ETag", + "value": "W/\"87-1I6WNb76erNPjLJ7LVf3pHrA/dI\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:33:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId should not be empty\",\n \"verificationMethodId must be a string\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verificationMethodId is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as verificationMethodId is empty \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"verificationMethodId cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "verificationMethodId is empty", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "91" + }, + { + "key": "ETag", + "value": "W/\"5b-zP9LI+Oe9F8CDquWcPNgIxi8yfo\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:36:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"verificationMethodId cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid verificationMethodId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as verificationMethodId is empty \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid verificationMethodId\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"abc\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "invalid verificationMethodId", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"abc\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-HmS+bQKLXOk9AJoxXx80grUQ77Q\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 09:38:03 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid verificationMethodId\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "updated credential status", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const vcId = pm.environment.get('vcIdWOS')", + "const did = pm.environment.get('did')", + "const {status}= JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"should be able to suspend the credential status\", function () {", + " ", + " pm.expect(responseBody.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.claim).to.be.an(\"object\");", + " pm.expect(responseBody.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.claim.id).to.be.an(\"string\");", + " pm.expect(responseBody.claim.id).to.be.eql(vcId)", + " pm.expect(responseBody.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.claim.currentStatus).to.be.eql(\"Suspended\");", + " pm.expect(responseBody.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.claim.statusReason).to.be.eql(`Credential is suspended`);", + " pm.expect(responseBody.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.proof.type).to.be.equal(\"Ed25519Signature2020\");", + " pm.expect(responseBody.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.proof.created).to.be.a(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.proof.proofPurpose).to.be.equal(\"assertion\");", + " pm.expect(responseBody.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.proof.proofValue).to.be.a(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty(\"updated\")).to.be.true;", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "updated credential status", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "711" + }, + { + "key": "ETag", + "value": "W/\"2c7-hRLXtU5gwD7UkR6aidTh4oMGRhI\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:13:27 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"claim\": {\n \"id\": \"vc:hid:testnet:zBwMKce1fa38gsbiE8nw5mxJBdQahGx7pHewUMqPt2xYM\",\n \"currentStatus\": \"Suspended\",\n \"statusReason\": \"Credential is suspended\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T10:11:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"eeacda44b2b6ee92d161ff49df75cbf7b4d069aa6cc63b110c9f0993f811dc88\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T10:11:12Z\",\n \"updated\": \"2023-02-24T10:11:42Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"RNuNqik/PcF0GYGQyin1IWNVAEBodNRuHBbU5uhCbIm7FDF8cqBl1G3VaS8yvVaRbXLdrGHEkt0u4Davt+AbDg==\"\n }\n}" + } + ] + }, + { + "name": "credential already suspended", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const vcId= pm.environment.get(\"vcIdWOS\")", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential as credential is already suspended\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(`${vcId} is already suspended`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "credential already suspended", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"SUSPEND\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "367" + }, + { + "key": "ETag", + "value": "W/\"16f-JSnJYb+POtlXVpCTnKX+8cR0BEE\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:20:03 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: credential claim status is already Suspended: Invalid Credential Status [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_credential.go:288] With gas wanted: '0' and gas used: '57146' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "updated credential status to live from suspended", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const vcId = pm.environment.get('vcIdWOS')", + "const did = pm.environment.get('did')", + "const {status}= JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"should be able to able to LIVE the suspended credential\", function () {", + " ", + " pm.expect(responseBody.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.claim).to.be.an(\"object\");", + " pm.expect(responseBody.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.claim.id).to.be.an(\"string\");", + " pm.expect(responseBody.claim.id).to.be.eql(vcId)", + " pm.expect(responseBody.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.claim.currentStatus).to.be.eql(\"Live\");", + " pm.expect(responseBody.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.claim.statusReason).to.be.eql(`Credential is live`);", + " pm.expect(responseBody.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.proof.type).to.be.equal(\"Ed25519Signature2020\");", + " pm.expect(responseBody.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.proof.created).to.be.a(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.proof.proofPurpose).to.be.equal(\"assertion\");", + " pm.expect(responseBody.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.proof.proofValue).to.be.a(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty(\"updated\")).to.be.true;", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "updated credential status to live", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "701" + }, + { + "key": "ETag", + "value": "W/\"2bd-zIVLEa5WhvJDJJgDSzuP10USyZc\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:23:40 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"claim\": {\n \"id\": \"vc:hid:testnet:zBwMKce1fa38gsbiE8nw5mxJBdQahGx7pHewUMqPt2xYM\",\n \"currentStatus\": \"Live\",\n \"statusReason\": \"Credential is live\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T10:11:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"eeacda44b2b6ee92d161ff49df75cbf7b4d069aa6cc63b110c9f0993f811dc88\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T10:11:12Z\",\n \"updated\": \"2023-02-24T10:21:52Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"GgSmDJe4ReheoaGwNM8K8EIApsHHgZUXCNZaN7NTy6eqV6x7DiJbNyYEQWNB9uZaSyoky13mtDNlw4shHlZrDQ==\"\n }\n}" + } + ] + }, + { + "name": "credential already live", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const vcId= pm.environment.get(\"vcIdWOS\")", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential status to live as credential status is already live\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(`${vcId} is already live`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "credential already live", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "362" + }, + { + "key": "ETag", + "value": "W/\"16a-crgLOEtstOUHWUvGTXELfxe4Az8\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:26:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: credential claim status is already Live: Invalid Credential Status [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_credential.go:264] With gas wanted: '0' and gas used: '57016' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "revoke the credential status", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const vcId = pm.environment.get('vcIdWOS')", + "const did = pm.environment.get('did')", + "const {status}= JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"should be able to able to revoke the credential\", function () {", + " ", + " pm.expect(responseBody.hasOwnProperty('claim')).to.be.true;", + " pm.expect(responseBody.claim).to.be.an(\"object\");", + " pm.expect(responseBody.claim.hasOwnProperty('id')).to.be.true;", + " pm.expect(responseBody.claim.id).to.be.an(\"string\");", + " pm.expect(responseBody.claim.id).to.be.eql(vcId)", + " pm.expect(responseBody.claim.hasOwnProperty('currentStatus')).to.be.true;", + " pm.expect(responseBody.claim.currentStatus).to.be.an(\"string\");", + " pm.expect(responseBody.claim.currentStatus).to.be.eql(\"Revoked\");", + " pm.expect(responseBody.claim.hasOwnProperty('statusReason')).to.be.true;", + " pm.expect(responseBody.claim.statusReason).to.be.an(\"string\");", + " pm.expect(responseBody.claim.statusReason).to.be.eql(`Credential is revoked`);", + " pm.expect(responseBody.hasOwnProperty('issuer')).to.be.true;", + " pm.expect(responseBody.issuer).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('issuanceDate')).to.be.true;", + " pm.expect(responseBody.issuanceDate).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('expirationDate')).to.be.true;", + " pm.expect(responseBody.expirationDate).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty('credentialHash')).to.be.true;", + " pm.expect(responseBody.credentialHash).to.be.an(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty('type')).to.be.true;", + " pm.expect(responseBody.proof.type).to.be.a(\"string\");", + " pm.expect(responseBody.proof.type).to.be.equal(\"Ed25519Signature2020\");", + " pm.expect(responseBody.proof.hasOwnProperty('created')).to.be.true;", + " pm.expect(responseBody.proof.created).to.be.a(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty('verificationMethod')).to.be.true;", + " pm.expect(responseBody.proof.verificationMethod).to.be.a(\"string\");", + " pm.expect(responseBody.proof.verificationMethod).to.be.equal(`${did}#key-1`);", + "", + " pm.expect(responseBody.proof.hasOwnProperty('proofPurpose')).to.be.true;", + " pm.expect(responseBody.proof.proofPurpose).to.be.a(\"string\");", + " pm.expect(responseBody.proof.proofPurpose).to.be.equal(\"assertion\");", + " pm.expect(responseBody.proof.hasOwnProperty('proofValue')).to.be.true;", + " pm.expect(responseBody.proof.proofValue).to.be.a(\"string\");", + " pm.expect(responseBody.proof.hasOwnProperty(\"updated\")).to.be.true;", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"REVOKE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "revoke the credential status", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"REVOKE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "707" + }, + { + "key": "ETag", + "value": "W/\"2c3-isQLkRYd5AKAxbRUbIH+OsUkkmY\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:29:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"claim\": {\n \"id\": \"vc:hid:testnet:zBwMKce1fa38gsbiE8nw5mxJBdQahGx7pHewUMqPt2xYM\",\n \"currentStatus\": \"Revoked\",\n \"statusReason\": \"Credential is revoked\"\n },\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"issuanceDate\": \"2023-02-24T10:11:12Z\",\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"credentialHash\": \"eeacda44b2b6ee92d161ff49df75cbf7b4d069aa6cc63b110c9f0993f811dc88\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T10:11:12Z\",\n \"updated\": \"2023-02-24T10:27:31Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertion\",\n \"proofValue\": \"M8P0bb0rwsm/9oO7B+8+aERbaCe3wMsXmbFNbHV/aJCkT1Zm281+BEZ0TsJPM/Gnpm8IBVOFeyDfFaka7SFNBw==\"\n }\n}" + } + ] + }, + { + "name": "revoke to live", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const vcId= pm.environment.get(\"vcIdWOS\")", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update credential to live as its status is revoked\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"status cannot be updated from Revoked to Live\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "response": [ + { + "name": "revoke to live", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"namespace\":\"testnet\",\n \"status\":\"LIVE\",\n \"issuerDid\":\"{{did}}\",\n \"verificationMethodId\":\"{{did}}#key-1\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/status/{{vcIdWOS}}", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "status", + "{{vcIdWOS}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "385" + }, + { + "key": "ETag", + "value": "W/\"181-D5uRGK/wCov0WsEZVnpI1K9Y/EA\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:32:44 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Query failed with (6): rpc error: code = Unknown desc = failed to execute message; message index: 0: credential claim status cannot be updated from Revoked to Live: Invalid Credential Status [/home/arnab/code/research/hid-node/x/ssi/keeper/msg_server_credential.go:301] With gas wanted: '0' and gas used: '57034' : unknown request\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + } + ] + }, + { + "name": "verify credential", + "item": [ + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to verify creadential as subdomain is not valid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/verify", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "verify" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/credential/verify", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "credential", + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:19:44 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fail as access token not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to verify credentail as access token is not passed in header \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "fail as access token not passed", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:40:45 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to fail token passed in header is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:48:25 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to verify credential as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 10:57:14 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to verify credential requestBody is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocument must be a non-empty object\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "100" + }, + { + "key": "ETag", + "value": "W/\"64-Ez6M0JYyWKY+n0FFHhgvpL1ld9Q\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 11:04:32 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocument must be a non-empty object\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "credentialDocument is empty object", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to verify credential requestBody is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocument.@context should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"credentialDocument.@context must be an array\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"credentialDocument.type should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"credentialDocument.type must be an array\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"credentialDocument.expirationDate must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"credentialDocument.expirationDate should not be empty\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"credentialDocument.issuanceDate must be a string\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"credentialDocument.issuanceDate should not be empty\")", + " pm.expect(responseBody.message[8]).to.be.equal(\"credentialDocument.credentialSubject must be a non-empty object\")", + " pm.expect(responseBody.message[9]).to.be.equal(\"credentialDocument.credentialStatus must be a non-empty object\")", + " pm.expect(responseBody.message[10]).to.be.equal(\"credentialDocument.proof must be a non-empty object\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocument\" :{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "credentialDocument is empty object", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocument\" :{}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Server", + "value": "nginx/1.18.0 (Ubuntu)" + }, + { + "key": "Date", + "value": "Thu, 16 Nov 2023 05:24:06 GMT" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "637" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "ETag", + "value": "W/\"27d-pwSvC+5L957j+WJt8BR92JowfjI\"" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocument.@context should not be empty\",\n \"credentialDocument.@context must be an array\",\n \"credentialDocument.type should not be empty\",\n \"credentialDocument.type must be an array\",\n \"credentialDocument.expirationDate must be a string\",\n \"credentialDocument.expirationDate should not be empty\",\n \"credentialDocument.issuanceDate must be a string\",\n \"credentialDocument.issuanceDate should not be empty\",\n \"credentialDocument.credentialSubject must be a non-empty object\",\n \"credentialDocument.credentialStatus must be a non-empty object\",\n \"credentialDocument.proof must be a non-empty object\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verifying revoked credetial", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to verify and its result is false as credential is revoked\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"verified\")).to.be.true;", + " pm.expect(responseBody.verified).to.be.a('boolean')", + " pm.expect(responseBody.verified).to.be.equal(false)", + "", + " pm.expect(responseBody.hasOwnProperty(\"results\")).to.be.true;", + " pm.expect(responseBody.results).to.be.an(\"array\");", + " pm.expect(responseBody.results[0].hasOwnProperty(\"proof\")).to.be.true;", + " pm.expect(responseBody.results[0].proof).to.be.an(\"object\");", + "", + " pm.expect(responseBody.results[0].hasOwnProperty(\"verified\")).to.be.true;", + " pm.expect(responseBody.results[0].verified).to.be.an(\"boolean\");", + " pm.expect(responseBody.results[0].verified).to.be.equal(true);", + " pm.expect(responseBody.results[0].hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod).to.be.an(\"object\");", + "", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod.id).to.be.a('string');", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod.type).to.be.a('string');", + " pm.expect(responseBody.results[0].verificationMethod.type).to.be.eql(\"Ed25519VerificationKey2020\");", + "", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty('controller')).to.be.true", + " pm.expect(responseBody.results[0].verificationMethod.controller).to.be.a('string');", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod.publicKeyMultibase).to.be.a('string');", + "", + " pm.expect(responseBody.results[0].purposeResult).to.be.an(\"object\");", + " pm.expect(responseBody.results[0].purposeResult.hasOwnProperty(\"valid\")).to.be.true;", + " pm.expect(responseBody.results[0].purposeResult.valid).to.be.a('boolean');", + "", + " pm.expect(responseBody.results[0].purposeResult.valid).to.be.eql(true);", + "", + " pm.expect(responseBody.hasOwnProperty(\"statusResult\")).to.be.true;", + " pm.expect(responseBody.statusResult).to.be.a('object')", + " pm.expect(responseBody.statusResult.hasOwnProperty(\"verified\")).to.be.true;", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocument\":{{vcDocWOS}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "verifying revoked credetial", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocument\":{{vcDocWOS}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "824" + }, + { + "key": "ETag", + "value": "W/\"338-hPd/o0FPzTav7b4UephEvIoEOPA\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 12:14:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"verified\": false,\n \"results\": [\n {\n \"proof\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://schema.org\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T11:41:03Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z5CEJmRnsyzWER5Z2EsDUKEZAFfDejNnE3FCmet75WUAiXUprUWbeHPibCeXjEZpHxZVgs6WNeEe1vUvN6ZCtw62P\"\n },\n \"verified\": true,\n \"verificationMethod\": {\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"publicKeyMultibase\": \"z6Mkw7aRvWZTBt8PHLEa9oN9JcoCv1ZS7YwnZmicLMpwdi8W\"\n },\n \"purposeResult\": {\n \"valid\": true\n }\n }\n ],\n \"statusResult\": {\n \"verified\": false\n }\n}" + } + ] + }, + { + "name": "verifying live credential", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to verify and its result will be true as credential is live\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"verified\")).to.be.true;", + " pm.expect(responseBody.verified).to.be.a('boolean')", + " pm.expect(responseBody.verified).to.be.equal(true)", + "", + " pm.expect(responseBody.hasOwnProperty(\"results\")).to.be.true;", + " pm.expect(responseBody.results).to.be.an(\"array\");", + " pm.expect(responseBody.results[0].hasOwnProperty(\"proof\")).to.be.true;", + " pm.expect(responseBody.results[0].proof).to.be.an(\"object\");", + "", + " pm.expect(responseBody.results[0].hasOwnProperty(\"verified\")).to.be.true;", + " pm.expect(responseBody.results[0].verified).to.be.an(\"boolean\");", + " pm.expect(responseBody.results[0].verified).to.be.equal(true);", + " pm.expect(responseBody.results[0].hasOwnProperty(\"verificationMethod\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod).to.be.an(\"object\");", + "", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod.id).to.be.a('string');", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod.type).to.be.a('string');", + " pm.expect(responseBody.results[0].verificationMethod.type).to.be.eql(\"Ed25519VerificationKey2020\");", + "", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty('controller')).to.be.true", + " pm.expect(responseBody.results[0].verificationMethod.controller).to.be.a('string');", + " pm.expect(responseBody.results[0].verificationMethod.hasOwnProperty(\"publicKeyMultibase\")).to.be.true;", + " pm.expect(responseBody.results[0].verificationMethod.publicKeyMultibase).to.be.a('string');", + "", + " pm.expect(responseBody.results[0].purposeResult).to.be.an(\"object\");", + " pm.expect(responseBody.results[0].purposeResult.hasOwnProperty(\"valid\")).to.be.true;", + " pm.expect(responseBody.results[0].purposeResult.valid).to.be.a('boolean');", + "", + " pm.expect(responseBody.results[0].purposeResult.valid).to.be.eql(true);", + "", + " pm.expect(responseBody.hasOwnProperty(\"statusResult\")).to.be.true;", + " pm.expect(responseBody.statusResult).to.be.a('object')", + " pm.expect(responseBody.statusResult.hasOwnProperty(\"verified\")).to.be.true;", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocument\":{{vcDocPF}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "verifying live credential", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocument\":{{vcDocPF}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}credential/verify", + "host": [ + "{{studio-api-baseUrl}}credential" + ], + "path": [ + "verify" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "966" + }, + { + "key": "ETag", + "value": "W/\"3c6-RN3kcEkZ67HaRzZyzexUlz0yDG8\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 12:18:06 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"verified\": true,\n \"results\": [\n {\n \"proof\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T11:41:43Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z3dZH8ScvAk5XoGY8rofiKhpmtBo4qX54Q4RJuz2b4GgHmko6fo8VjVGYjifYigVFNRn49zmuGAxJ5AHkzyVbnaw3\"\n },\n \"verified\": true,\n \"verificationMethod\": {\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"type\": \"Ed25519VerificationKey2020\",\n \"controller\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"publicKeyMultibase\": \"z6Mkw7aRvWZTBt8PHLEa9oN9JcoCv1ZS7YwnZmicLMpwdi8W\"\n },\n \"purposeResult\": {\n \"valid\": true\n }\n }\n ],\n \"statusResult\": {\n \"verified\": true\n }\n}" + } + ] + } + ] + } + ] + }, + { + "name": "Presentation template", + "item": [ + { + "name": "create template", + "item": [ + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation template as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subdomain\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:26:17 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation template as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 13:01:38 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation template as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 13:16:22 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 13:22:45 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template as request body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"domain must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"name should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"name must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"query must be an array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "214" + }, + { + "key": "ETag", + "value": "W/\"d6-9nDeY03zh8l/v2Gmb+HXjNd1I7E\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 13:32:24 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\",\n \"domain must be a string\",\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template domain is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"name should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"name must be a string\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"query must be an array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "empty domain", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "188" + }, + { + "key": "ETag", + "value": "W/\"bc-/DMmeCxBykL5TZYHBOxNMbUDbcE\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 13:45:36 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\",\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template domain is invalid url\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"name should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"name must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"query must be an array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "159" + }, + { + "key": "ETag", + "value": "W/\"9f-c97jiEp4C2R6LIUF//9F+cgbot8\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 13:47:06 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "name is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template domain is invalid url\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"name should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"name must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"query must be an array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "name is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "128" + }, + { + "key": "ETag", + "value": "W/\"80-fY2gU735uH3d16LA5wA+ivOyE/o\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 14:07:24 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"name should not be empty\",\n \"name must be a string\",\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "name is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template name is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"name cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "name is empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "75" + }, + { + "key": "ETag", + "value": "W/\"4b-cO/E+dioAAgfZYBhLTgd5w5H5OM\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 14:15:42 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"name cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "query field is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template query field is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"query must be an array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "query is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "77" + }, + { + "key": "ETag", + "value": "W/\"4d-i3QBiui3/f+whjQIYTcHmDvafs4\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 14:17:16 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query must be an array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "query is not array", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template query field is not of type array\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"query must be an array\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"nested property query must be either object or array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "query is not array", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "132" + }, + { + "key": "ETag", + "value": "W/\"84-7h9y70jfWpj1KBW8twoq066Q0hA\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 14:19:50 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query must be an array\",\n \"nested property query must be either object or array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create template with empty query", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create presentation template\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", + " pm.expect(responseBody.appId).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", + " pm.expect(responseBody.domain).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", + " pm.expect(responseBody.query).to.be.a(\"array\")", + " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " pm.environment.set(\"templateId\", responseBody._id)", + " pm.environment.set(\"templateName\", responseBody.name)", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "create template with empty query", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "146" + }, + { + "key": "ETag", + "value": "W/\"92-SWsGRKlotuO1i+z54aDlwfv5zFc\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 14:27:21 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate\",\n \"_id\": \"63f8c949a713f85a8ea2a13d\",\n \"__v\": 0\n}" + } + ] + }, + { + "name": "duplicate name error", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const templateName= pm.environment.get('templateName')", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template as template name already exist.It should be unique for particular app\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Template name must be unique\")", + " pm.expect(responseBody.message[1]).to.be.equal(`${templateName} already exists`)", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName}}\",\n \"query\":[]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "duplicate name", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName}}\",\n \"query\":[[]]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "113" + }, + { + "key": "ETag", + "value": "W/\"71-kD1WIrOkn/WE0wwqsojZM7wtC2k\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 14:30:09 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Template name must be unique\",\n \"DemoTemplate already exists\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid id in query", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template id passed in query field under credentialSubjecct is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid id\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"did:hid:testnet:.............................\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "invalid id in query", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"did:hid:testnet:.............................\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "65" + }, + { + "key": "ETag", + "value": "W/\"41-na6SRevQGHjq8mnH/gMyPqUL9ZQ\"" + }, + { + "key": "Date", + "value": "Sat, 25 Feb 2023 23:46:25 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid id\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid issuer in query", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template as issuer passed in query field under credentialSchema is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuer\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "invalid issuer in query", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:...............\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "69" + }, + { + "key": "ETag", + "value": "W/\"45-5/Fb0s8Sxcu+q3beCr/VdFe/jXI\"" + }, + { + "key": "Date", + "value": "Sat, 25 Feb 2023 23:48:05 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuer\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid trusted issuer in query", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template as invalid trustedIssuer is passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuer\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "invalid trusted issuer in query", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "69" + }, + { + "key": "ETag", + "value": "W/\"45-5/Fb0s8Sxcu+q3beCr/VdFe/jXI\"" + }, + { + "key": "Date", + "value": "Sat, 25 Feb 2023 23:50:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuer\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid trusted issuer in query Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template as invalid type is passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid issuer\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "invalid trusted issuer in query", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample / DIDAuthentication\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:................\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "69" + }, + { + "key": "ETag", + "value": "W/\"45-5/Fb0s8Sxcu+q3beCr/VdFe/jXI\"" + }, + { + "key": "Date", + "value": "Sat, 25 Feb 2023 23:50:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid issuer\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid type in query", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation template as query type passed is invalid passed in query field under credentialSubjecct is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"query.0.type must be one of the following values: QueryByExample, QueryByFrame, DIDAuthentication\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template57h\",\n \"query\":[\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "invalid type in query", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test Template57h\",\n \"query\":[\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "152" + }, + { + "key": "ETag", + "value": "W/\"98-45B7Qnrlrx83KhXSN0y8NT23UUE\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 00:49:26 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query.0.type must be one of the following values: QueryByExample, QueryByFrame, DIDAuthentication\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create template with all query fields", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create presentation template\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", + " pm.expect(responseBody.appId).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", + " pm.expect(responseBody.domain).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", + " pm.expect(responseBody.query).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.query[0].type).to.be.a(\"string\")", + " pm.expect(responseBody.query[0].hasOwnProperty(\"credentialQuery\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"required\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].required).to.be.a(\"boolean\")", + " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"reason\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].reason).to.be.a(\"string\")", + " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"example\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example).to.be.a(\"object\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['@context']).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['type']).to.be.a(\"string\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSubject\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSubject']).to.be.a(\"object\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSchema\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSchema']).to.be.a(\"object\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"trustedIssuer\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer']).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.trustedIssuer[0].hasOwnProperty(\"required\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer'][0].required).to.be.a(\"boolean\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " pm.environment.set(\"templateId2\", responseBody._id)", + " pm.environment.set(\"templateName2\", responseBody.name)", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const randomString = Array(8).fill(0).map(() => Math.random().toString(36).charAt(2)).join('');\r", + "pm.environment.set('randomstr', randomString)\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{randomstr}}Test Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "create template with all query fields", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template45\",\n \"query\":[\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "494" + }, + { + "key": "ETag", + "value": "W/\"1ee-n+HFKE1aQ40FkfTpDj8h+DKEPBs\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:18:54 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"DemoTemplate45\",\n \"_id\": \"63fab37ea0b683c8f2d96203\",\n \"__v\": 0\n}" + } + ] + } + ] + }, + { + "name": "template list", + "item": [ + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to get presentation template as invalid subdoamin\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subdomain\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:26:17 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch presentation template list as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:22:51 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to get presentation template list as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:23:26 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to get presentation template list as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:24:03 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "negative limit value", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch template list as limit is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"limit must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template?page =1&limit=-20", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "-20" + } + ] + } + }, + "response": [ + { + "name": "negative limit value", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template?page =1&limit=-20", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ], + "query": [ + { + "key": "page ", + "value": "1" + }, + { + "key": "limit", + "value": "-20" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "84" + }, + { + "key": "ETag", + "value": "W/\"54-JS1yHCty54pMtfB4VAZ/1jEtHHU\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:26:48 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"limit must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "negative page value Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Shouldnot be able to get template list as page is negative or 0\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal( \"page must not be less than 1\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template?page=-1&limit=20", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "response": [ + { + "name": "negative page value Copy", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template?page=-1&limit=20", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ], + "query": [ + { + "key": "page", + "value": "-1" + }, + { + "key": "limit", + "value": "20" + } + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-rSgVu62K2+soCfxfUvVCPAJHgqI\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:27:13 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"page must not be less than 1\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "fetch template list", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "var page;", + "var limit;", + "var urlString = pm.request.url.toString();", + "var did = pm.environment.get('did')", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "", + "pm.test(\"Should be able to and have list of dids in response body \", function () {", + " try {", + " page = urlString.match(/page=(\\d+)/)[1];", + " page = (parseInt(page))", + " } catch (e) {", + " page = 1", + " }", + " try {", + " limit = urlString.match(/limit=(\\d+)/)[1];", + " limit = parseInt(limit)", + " } catch (e) {", + " limit = 10", + " }", + " pm.expect(responseBody.hasOwnProperty(\"totalCount\")).to.be.true;", + " pm.expect(responseBody.totalCount).to.be.a('number')", + " pm.expect(responseBody.hasOwnProperty(\"data\")).to.be.true;", + " pm.expect(responseBody.data).to.be.an(\"array\");", + " pm.expect(responseBody.data).to.have.length.of.at.most(limit);", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template?page=1&limit=10", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "10" + } + ] + } + }, + "response": [ + { + "name": "fetch template list", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template?page=1&limit=10", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ], + "query": [ + { + "key": "page", + "value": "1" + }, + { + "key": "limit", + "value": "10" + } + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "3541" + }, + { + "key": "ETag", + "value": "W/\"dd5-96twqPPu7G2XdkWvxPu2YzNF5Nk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:37:28 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"totalCount\": 22,\n \"data\": [\n {\n \"_id\": \"63f8c7cda713f85a8ea2a133\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"testtemplate\",\n \"__v\": 0\n },\n {\n \"_id\": \"63f8c902a713f85a8ea2a137\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"testTemplate\",\n \"__v\": 0\n },\n {\n \"_id\": \"63f8c949a713f85a8ea2a13d\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faa9a4f54ca023fbb5f43e\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"DemoTemplate3\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faaa31f83c9c5dc6d4b6ea\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate5\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faaa96f83c9c5dc6d4b6f0\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate567\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faaab7f83c9c5dc6d4b6f4\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate57\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faab0bf83c9c5dc6d4b6f8\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"xyz\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"testTemplate57h\",\n \"__v\": 0\n },\n {\n \"_id\": \"63faabfea0b683c8f2d961c1\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate67\",\n \"__v\": 0\n },\n {\n \"_id\": \"63fab197a0b683c8f2d961cd\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"DemoTemplate5\",\n \"__v\": 0\n }\n ]\n}" + } + ] + } + ] + }, + { + "name": "template by id", + "item": [ + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to get presentation template as invalid subdoamin\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subdomain\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template/{{templateId}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template/{{templateId}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template", + "{{templateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:30:26 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to fetch presentation template as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:31:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to get presentation template as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:32:54 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to get presentation template as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:33:34 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "fetch template by templateId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to get presentation template by its id\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", + " pm.expect(responseBody.appId).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", + " pm.expect(responseBody.domain).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", + " pm.expect(responseBody.query).to.be.a(\"array\")", + " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " const name= pm.environment.get('templateName')", + " pm.expect(responseBody.name).to.be.eql(name)", + " const templateId= pm.environment.get(\"templateId\")", + " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", + " pm.expect(responseBody._id).to.be.a(\"string\")", + " pm.expect(responseBody._id).to.be.eql(templateId)", + "", + " ", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "fetch template by templateId", + "originalRequest": { + "method": "GET", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "140" + }, + { + "key": "ETag", + "value": "W/\"8c-xzW8y0hXCTpIXyWZoP4R9BI/goc\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:41:39 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"_id\": \"63faabfea0b683c8f2d961c1\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate67\"\n}" + } + ] + } + ] + }, + { + "name": "update presention template", + "item": [ + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update presentation template as invalid subdoamin\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subdomain\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template/{{templateId}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template/{{templateId}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template", + "{{templateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:32:14 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update presentation template as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:43:15 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to update presentation template as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:43:52 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update presentation template as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}}}" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "PATCH", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 01:44:26 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "update with empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to update presentation template even if it is empty body as it is part of partial create class\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", + " pm.expect(responseBody.appId).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", + " pm.expect(responseBody.domain).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", + " pm.expect(responseBody.query).to.be.a(\"array\")", + " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "update with empty body", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "148" + }, + { + "key": "ETag", + "value": "W/\"94-6n5qGOyH+N5xhISEyr0FS68jZoc\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:07:02 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"_id\": \"63faabfea0b683c8f2d961c1\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate67\",\n \"__v\": 0\n}" + } + ] + }, + { + "name": "empty domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update as presentation template domain is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "empty domain", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "112" + }, + { + "key": "ETag", + "value": "W/\"70-zvTj1ZYUPw9H/YH+AMzVG8vumIk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:11:56 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update presentation template as domain is invalid url\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-KSWf62Sscsg0DbNMcWyzdZVC6Ek\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:12:44 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "name is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update presentation template name is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"name cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "name is empty", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"http://localhost:3000\",\n \"name\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "75" + }, + { + "key": "ETag", + "value": "W/\"4b-cO/E+dioAAgfZYBhLTgd5w5H5OM\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:14:06 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"name cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "duplicate name is passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "const {name}=JSON.parse(pm.request.body.raw)", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update presentation template name passed is duplicate value\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Template name must be unique\")", + " pm.expect(responseBody.message[1]).to.be.equal(`${name} already exists`)", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName2}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "duplicate name", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"{{templateName2}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "115" + }, + { + "key": "ETag", + "value": "W/\"73-LUcRuDJ+g0lSnXRbzz7lHLV9Wyo\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:18:30 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Template name must be unique\",\n \"DemoTemplate45 already exists\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "query field is not array", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to update presentation template query field passed is not array\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"query must be an array\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"nested property query must be either object or array\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "query field is not array", + "originalRequest": { + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"test template\",\n \"query\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{temlateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{temlateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "132" + }, + { + "key": "ETag", + "value": "W/\"84-7h9y70jfWpj1KBW8twoq066Q0hA\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:21:25 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"query must be an array\",\n \"nested property query must be either object or array\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "update template", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create presentation template\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", + " pm.expect(responseBody.appId).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", + " pm.expect(responseBody.domain).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", + " pm.expect(responseBody.query).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.query[0].type).to.be.a(\"string\")", + " pm.expect(responseBody.query[0].hasOwnProperty(\"credentialQuery\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"required\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].required).to.be.a(\"boolean\")", + " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"reason\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].reason).to.be.a(\"string\")", + " pm.expect(responseBody.query[0].credentialQuery[0].hasOwnProperty(\"example\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example).to.be.a(\"object\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"@context\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['@context']).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"type\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['type']).to.be.a(\"string\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSubject\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSubject']).to.be.a(\"object\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"credentialSchema\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['credentialSchema']).to.be.a(\"object\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.hasOwnProperty(\"trustedIssuer\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer']).to.be.a(\"array\")", + " pm.expect(responseBody.query[0].credentialQuery[0].example.trustedIssuer[0].hasOwnProperty(\"required\")).to.be.true;", + " pm.expect(responseBody.query[0].credentialQuery[0].example['trustedIssuer'][0].required).to.be.a(\"boolean\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "PATCH", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"{{did}}\"\n },\n \"credentialSchema\": {\n \"id\": \"{{schemaId}}\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"{{did}}\"\n }\n ]\n }\n }\n ]\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "create template with empty query", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"domain\":\"hypersign.id\",\n \"name\":\"Demo Template\",\n \"query\":[]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "146" + }, + { + "key": "ETag", + "value": "W/\"92-SWsGRKlotuO1i+z54aDlwfv5zFc\"" + }, + { + "key": "Date", + "value": "Fri, 24 Feb 2023 14:27:21 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [],\n \"name\": \"DemoTemplate\",\n \"_id\": \"63f8c949a713f85a8ea2a13d\",\n \"__v\": 0\n}" + } + ] + } + ] + }, + { + "name": "delete template", + "item": [ + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to delete presentation template as invalid subdoamin\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subdomain\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template/{{templateId}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/template/{{templateId}}", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "template", + "{{templateId}}" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:34:27 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to delete presentation template as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:36:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to delete presentation template as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:37:14 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to get presentation template as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:37:36 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "delete template", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to delete presentation template by its id\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"appId\")).to.be.true;", + " pm.expect(responseBody.appId).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"domain\")).to.be.true;", + " pm.expect(responseBody.domain).to.be.an(\"string\");", + " pm.expect(responseBody.hasOwnProperty(\"query\")).to.be.true;", + " pm.expect(responseBody.query).to.be.a(\"array\")", + " pm.expect(responseBody.hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.name).to.be.a(\"string\")", + " const templateId= pm.environment.get(\"templateId\")", + " pm.expect(responseBody.hasOwnProperty(\"_id\")).to.be.true;", + " pm.expect(responseBody._id).to.be.a(\"string\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "delete template", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "708" + }, + { + "key": "ETag", + "value": "W/\"2c4-XTMSP71CPW06MAQ4w7v4ks9Pocg\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:38:31 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"_id\": \"63fac3af702a991edd3e034f\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\",\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true,\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"Demo Template\",\n \"__v\": 0\n}" + } + ] + }, + { + "name": "template already deleted", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const templateId= pm.environment.get('templateId')", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to delete presentation template as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(404)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('string')", + " pm.expect(responseBody.message[0]).to.be.eql( `No resource found for templateId ${templateId}`) ", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Not Found\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "template already deleted", + "originalRequest": { + "method": "DELETE", + "header": [ + { + "key": "origin", + "value": "http://localhost:3001", + "type": "text" + } + ], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "status": "Not Found", + "code": 404, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "110" + }, + { + "key": "ETag", + "value": "W/\"6e-11nuxcxleMnDXUB29hcjMdigZsw\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:46:52 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 404,\n \"message\": [\n \"No resource found for templateId 63fac3af702a991edd3e034f\"\n ],\n \"error\": \"Not Found\"\n}" + } + ] + }, + { + "name": "authorization issue Copy", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to delete presentation template as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/template/{{templateId}}", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "template", + "{{templateId}}" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 02:36:18 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + } + ] + } + ] + }, + { + "name": "presentation", + "item": [ + { + "name": "create presentation", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:37:40 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 07:44:00 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 07:43:27 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 07:41:37 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as request body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocuments should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"holderDid should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"holderDid must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"challenge should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"challenge must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"domain should not be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "276" + }, + { + "key": "ETag", + "value": "W/\"114-dqMifWeks/HChCFZCOFo0T2NsHw\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:56:57 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocuments should not be empty\",\n \"holderDid should not be empty\",\n \"holderDid must be a string\",\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty credentialDocument", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as credentialDocuments passed is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"credentialDocuments should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"holderDid should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"holderDid must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"challenge should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"challenge must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"domain should not be empty\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "empty credentialDocument", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "276" + }, + { + "key": "ETag", + "value": "W/\"114-dqMifWeks/HChCFZCOFo0T2NsHw\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:57:55 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"credentialDocuments should not be empty\",\n \"holderDid should not be empty\",\n \"holderDid must be a string\",\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty holderDid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "// var request= JSON.parse(pm.request.body.raw)", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as holder did is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"holderDid cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "empty holderDid", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"holderDid\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "80" + }, + { + "key": "ETag", + "value": "W/\"50-Ukg35dG8vyzO1/ozDJwg/1gbQ+8\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:02:41 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"holderDid cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid holderDid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as holdefr did is invalid\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid holderDid\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "invalid holderDid", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"holderDid\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-sDXx2DcWcY2ENdwfW0LEXq+msvQ\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:03:49 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid holderDid\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "challenge is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as challenge is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"challenge must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"domain should not be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "challenge is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"holderDid\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "173" + }, + { + "key": "ETag", + "value": "W/\"ad-c7ThoUlRlMnqDs223nuJdzPGHLo\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:31:06 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "challenge is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as challenge is empty string\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"domain should not be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "challenge is empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "144" + }, + { + "key": "ETag", + "value": "W/\"90-vx1B74wdC7c6SlKa9p7oEEgd8Nk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:33:04 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "domain is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as domain is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"domain should not be empty\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "domain is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "112" + }, + { + "key": "ETag", + "value": "W/\"70-zvTj1ZYUPw9H/YH+AMzVG8vumIk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:33:56 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\",\n \"domain should not be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid domain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation as domain is invalid url\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"domain must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "invalid domain", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "83" + }, + { + "key": "ETag", + "value": "W/\"53-KSWf62Sscsg0DbNMcWyzdZVC6Ek\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 08:34:32 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"domain must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "create presentation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const vcId = pm.environment.get('vcIdPF')", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create presentation\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"presentation\")).to.be.true;", + " pm.expect(responseBody.presentation).to.be.a('object')", + " pm.expect(responseBody.presentation.hasOwnProperty(\"@context\")).to.be.true", + " pm.expect(responseBody.presentation['@context']).to.be.a('array')", + " pm.expect(responseBody.presentation.hasOwnProperty(\"type\")).to.be.true", + " pm.expect(responseBody.presentation['type']).to.be.a('array')", + " pm.expect(responseBody.presentation.hasOwnProperty(\"verifiableCredential\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential']).to.be.a('array')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"@context\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['@context']).to.be.a('array')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"id\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['id']).to.be.a('string')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['id']).to.be.eql(vcId)", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"type\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['type']).to.be.a('array')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"expirationDate\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['expirationDate']).to.be.a('string')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"issuanceDate\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['issuanceDate']).to.be.a('string')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"issuer\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['issuer']).to.be.a('string')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"credentialSubject\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['credentialSubject']).to.be.a('object')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"credentialSchema\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['credentialSchema']).to.be.a('object')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"credentialStatus\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['credentialStatus']).to.be.a('object')", + " pm.expect(responseBody.presentation.verifiableCredential[0].hasOwnProperty(\"proof\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof']).to.be.a('object')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"type\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].type).to.be.a('string')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].type).to.be.eql('Ed25519Signature2020')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"created\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].created).to.be.a('string')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"verificationMethod\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].verificationMethod).to.be.a('string')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofPurpose\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].proofPurpose).to.be.a('string')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].proofPurpose).to.be.eql('assertionMethod')", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofValue\")).to.be.true", + " pm.expect(responseBody.presentation['verifiableCredential'][0]['proof'].proofValue).to.be.a('string')", + " pm.expect(responseBody.presentation.hasOwnProperty(\"id\")).to.be.true", + " pm.expect(responseBody.presentation['id']).to.be.a('string')", + " pm.expect(responseBody.presentation.hasOwnProperty(\"holder\")).to.be.true", + " pm.expect(responseBody.presentation['holder']).to.be.a('string')", + " pm.expect(responseBody.presentation.hasOwnProperty(\"proof\")).to.be.true", + " pm.expect(responseBody.presentation['proof']).to.be.a('object')", + " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"type\")).to.be.true", + " pm.expect(responseBody.presentation['proof'].type).to.be.a('string')", + " pm.expect(responseBody.presentation['proof'].type).to.be.eql('Ed25519Signature2020')", + " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"created\")).to.be.true", + " pm.expect(responseBody.presentation['proof'].created).to.be.a('string')", + " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"verificationMethod\")).to.be.true", + " pm.expect(responseBody.presentation['proof'].verificationMethod).to.be.a('string')", + " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"proofPurpose\")).to.be.true", + " pm.expect(responseBody.presentation['proof'].proofPurpose).to.be.a('string')", + " pm.expect(responseBody.presentation['proof'].proofPurpose).to.be.eql('authentication')", + " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"challenge\")).to.be.true", + " pm.expect(responseBody.presentation['proof'].challenge).to.be.a('string')", + " pm.expect(responseBody.presentation.proof.hasOwnProperty(\"proofValue\")).to.be.true", + " pm.expect(responseBody.presentation['proof'].proofValue).to.be.a('string')", + " pm.environment.set('presentation', JSON.stringify(responseBody.presentation))", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"fire.id\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "response": [ + { + "name": "create presentation", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"credentialDocuments\":[{{vcDocPF}}],\n \"holderDid\":\"{{did}}\",\n \"challenge\":\"h27ss3458vnbuqu2822yre\",\n \"domain\":\"fire.id\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation", + "host": [ + "{{studio-api-baseUrl}}presentation" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "1930" + }, + { + "key": "ETag", + "value": "W/\"78a-tdOOJu1hZdJEHgosVUEHNX48geE\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 09:50:01 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"presentation\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"type\": [\n \"VerifiablePresentation\"\n ],\n \"verifiableCredential\": [\n {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\",\n {\n \"hs\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0:\"\n },\n {\n \"name\": \"hs:name\"\n },\n \"https://w3id.org/security/suites/ed25519-2020/v1\"\n ],\n \"id\": \"vc:hid:testnet:zDqkTd5Drfc7bXnWxk2LAk1nzPzwnqx1TH5d1Cm5FYNB\",\n \"type\": [\n \"VerifiableCredential\",\n \"TicketSchema\"\n ],\n \"expirationDate\": \"2027-12-10T18:30:00Z\",\n \"issuanceDate\": \"2023-02-24T12:24:03Z\",\n \"issuer\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"credentialSubject\": {\n \"name\": \"varsha\",\n \"id\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n },\n \"credentialSchema\": {\n \"id\": \"sch:hid:testnet:z6Vrk951UdGp7jNi7whYL9fyrb5dXtVhFA9Ugz9jGgdaD:1.0\",\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"credentialStatus\": {\n \"id\": \"https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:zDqkTd5Drfc7bXnWxk2LAk1nzPzwnqx1TH5d1Cm5FYNB\",\n \"type\": \"CredentialStatusList2017\"\n },\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-24T12:25:44Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"assertionMethod\",\n \"proofValue\": \"z2A9uGxzWg2G4P2gB2GKUSKD7y5Ff6wu4dA6djoZj4xY5Qvz5SrsG9Ctk38DTKn55dkb9VVanBwLzKyQZABgAtjnB\"\n }\n }\n ],\n \"id\": \"vp:hid:testnet:zBTkHgSEdQknQoEZPDoM3Bai8aC9sPS3hWbgFmoVHmsxD\",\n \"holder\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"proof\": {\n \"type\": \"Ed25519Signature2020\",\n \"created\": \"2023-02-26T09:50:01Z\",\n \"verificationMethod\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8#key-1\",\n \"proofPurpose\": \"authentication\",\n \"challenge\": \"h27ss3458vnbuqu2822yre\",\n \"proofValue\": \"z5rZs3tGK3o9koJgzvcL5MPwEQbT4w1KMtyN7NaHYf3p34ncNNVFTFDG9hHTushvE7RcrGCa6VGYVEHUEdwLHziE6\"\n }\n }\n}" + } + ] + } + ] + }, + { + "name": "presentation request", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation request as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Invalid subdomain')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/request", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "request" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/request", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:40:25 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation request as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 09:53:23 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to create presentation request as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 09:54:01 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 09:54:57 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as request body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"challenge must be a string\",)", + " pm.expect(responseBody.message[2]).to.be.equal(\"did should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal( \"did must be a string\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"templateId should not be empty\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"templateId must be a string\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"expiresTime should not be empty\")", + " pm.expect(responseBody.message[8]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", + " pm.expect(responseBody.message[9]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[10]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "450" + }, + { + "key": "ETag", + "value": "W/\"1c2-zzQp2MjqqRoNw3ka9jvsp+wd/O0\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 09:59:01 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"challenge must be a string\",\n \"did should not be empty\",\n \"did must be a string\",\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "challenge is empty", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as challenge passed in request body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"challenge should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"did should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal( \"did must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"templateId should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"templateId must be a string\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"expiresTime should not be empty\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", + " pm.expect(responseBody.message[8]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[9]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "challenge is empty", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "421" + }, + { + "key": "ETag", + "value": "W/\"1a5-QgiUlWFm/IZpQad2/qbcRRj6ukA\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:01:24 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"challenge should not be empty\",\n \"did should not be empty\",\n \"did must be a string\",\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "did is not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as did is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"did should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal( \"did must be a string\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"templateId should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"templateId must be a string\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"expiresTime should not be empty\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", + " pm.expect(responseBody.message[7]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[8]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "did is not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "389" + }, + { + "key": "ETag", + "value": "W/\"185-z81BxtPSxoHBKQXWjp8tevvuQi4\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:04:05 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"did should not be empty\",\n \"did must be a string\",\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "did is empty string", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as did passed is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"did cannot be empty\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "did is empty string", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "74" + }, + { + "key": "ETag", + "value": "W/\"4a-fCicVlx7Avyc3KpBaOarxMFVHT4\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:05:11 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"did cannot be empty\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "invalid did", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as did passed is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid did\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "invalid did", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"xyz\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "66" + }, + { + "key": "ETag", + "value": "W/\"42-8Ba8Duu1E+QUY94luENhYozf6Ao\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:06:34 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid did\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "templateId not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as templateId is not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"templateId must be a string\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"expiresTime should not be empty\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[6]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "templateId not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "340" + }, + { + "key": "ETag", + "value": "W/\"154-z+fOrhiCfjfBx4HOX+Ym/pk/Kbw\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:08:40 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"templateId should not be empty\",\n \"templateId must be a string\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "empty templateId", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as templateId passed is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"expiresTime should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "empty templateId", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "310" + }, + { + "key": "ETag", + "value": "W/\"136-yz5JMSJ75k9/i/l+dBjzG8t7B1g\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:10:16 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"templateId should not be empty\",\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "expiresTime not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as expiresTime not passed\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"expiresTime should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"expiresTime must be a number conforming to the specified constraints\")", + " pm.expect(responseBody.message[4]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[5]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "expiresTime not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "277" + }, + { + "key": "ETag", + "value": "W/\"115-6a6Wib0wCp0e1DS1gl/403C4/3k\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:15:52 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expiresTime must not be less than 1677401772477\",\n \"expiresTime should not be empty\",\n \"expiresTime must be a number conforming to the specified constraints\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "expiresTime passed is less than expected", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as expiresTime passed less than current time\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.includes(\"templateId should not be empty\")", + "", + " pm.expect(responseBody.message[1]).to.be.includes(\"expiresTime must not be less than\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401472477\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "expiresTime passed is less than expected", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401472477\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "172" + }, + { + "key": "ETag", + "value": "W/\"ac-AO3sqze7/h5EdM+gGvR52XnsGCg\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:21:47 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"expiresTime must not be less than 1677401772477\",\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "callbackUrl not passed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to create presentation request as callbackUrl not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"templateId should not be empty\")", + " pm.expect(responseBody.message[2]).to.be.equal(\"callbackUrl should not be empty\")", + " pm.expect(responseBody.message[3]).to.be.equal(\"callbackUrl must be a URL address\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401872477\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "callbackUrl not passed", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{temlateId2}}\",\n \"expiresTime\":1677401872477\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "122" + }, + { + "key": "ETag", + "value": "W/\"7a-OGuez2tWp4W0y3uFOvgCWUnI3eo\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:23:25 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"callbackUrl should not be empty\",\n \"callbackUrl must be a URL address\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "created presentation request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const expiresTime = pm.environment.get('expiresTime')", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to create presentation request\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"id\")).to.be.true;", + " pm.expect(responseBody.id).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"from\")).to.be.true", + " pm.expect(responseBody['from']).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"created_time\")).to.be.true", + " pm.expect(responseBody['created_time']).to.be.a('number')", + " pm.expect(responseBody.hasOwnProperty(\"expires_time\")).to.be.true", + " pm.expect(responseBody['expires_time']).to.be.a('number')", + " pm.expect(responseBody['expires_time']).to.be.equal(expiresTime)", + " pm.expect(responseBody.hasOwnProperty(\"reply_url\")).to.be.true", + " pm.expect(responseBody['reply_url']).to.be.a('string')", + " pm.expect(responseBody.hasOwnProperty(\"reply_to\")).to.be.true", + " pm.expect(responseBody['reply_to']).to.be.a('array')", + " pm.expect(responseBody.hasOwnProperty(\"body\")).to.be.true", + " pm.expect(responseBody['body']).to.be.a('object')", + " const templateId = pm.environment.get(\"templateId2\")", + " pm.expect(responseBody.body.hasOwnProperty(\"_id\")).to.be.true", + " pm.expect(responseBody.body._id).to.be.a('string')", + " pm.expect(responseBody.body._id).to.be.equal(templateId)", + " const appId = pm.environment.get(\"appId\")", + " pm.expect(responseBody.body.hasOwnProperty(\"appId\")).to.be.true", + " pm.expect(responseBody.body.appId).to.be.a('string')", + " pm.expect(responseBody.body.appId).to.be.equal(appId)", + " pm.expect(responseBody.body.hasOwnProperty(\"domain\")).to.be.true", + " pm.expect(responseBody.body['domain']).to.be.a('string')", + " pm.expect(responseBody.body.hasOwnProperty(\"query\")).to.be.true", + " pm.expect(responseBody.body['query']).to.be.a('array')", + " pm.expect(responseBody.body.hasOwnProperty(\"name\")).to.be.true", + " pm.expect(responseBody.body['name']).to.be.a('string')", + " pm.expect(responseBody.body.hasOwnProperty(\"challenge\")).to.be.true", + " pm.expect(responseBody.body['challenge']).to.be.a('string')", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const oneDayInMilliseconds = 24 * 60 * 60 * 1000;", + "const expiresTime = Date.now() + oneDayInMilliseconds;", + "pm.environment.set('expiresTime',expiresTime)" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{templateId2}}\",\n \"expiresTime\":{{expiresTime}},\n \"callbackUrl\":\"https://api.hypersign.id\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "response": [ + { + "name": "created presentation request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{templateId2}}\",\n \"expiresTime\":{{expiresTime}},\n \"callbackUrl\":\"https://api.hypersign.id\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "830" + }, + { + "key": "ETag", + "value": "W/\"33e-niOG4hcvWcJ32p8Cj2aoCIV874g\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:47:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ca47291f8ff2effaef8443209c7554ca7162\",\n \"from\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"created_time\": 1677408479785,\n \"expires_time\": 1677494879557,\n \"reply_url\": \"https://api.hypersign.id\",\n \"reply_to\": [\n \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n ],\n \"body\": {\n \"_id\": \"63fb0a73c398867bf047c5d5\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"TestTemplate567789701945rt\",\n \"challenge\": \"wjwwrjgtj573nbcj jt\"\n }\n}" + } + ] + } + ] + }, + { + "name": "presentation verify", + "item": [ + { + "name": "invalid subdomain", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to verify presentation request as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"Invalid subdomain\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/verify", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "verify" + ] + } + }, + "response": [ + { + "name": "invalid subdomain", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "http://localhost:3001/api/v1/presentation/verify", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "3001", + "path": [ + "api", + "v1", + "presentation", + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "72" + }, + { + "key": "ETag", + "value": "W/\"48-MGaPbvaAmaW0eZ+V1mF5RpHHAvc\"" + }, + { + "key": "Date", + "value": "Wed, 15 Nov 2023 15:44:00 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"Invalid subdomain\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "authorization issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to verify presentation request as accesstoken is not passed \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Unauthorized')", + " pm.expect(responseBody.message[1]).to.be.equal('Please pass access token')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "authorization issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "95" + }, + { + "key": "ETag", + "value": "W/\"5f-aJwKIlmGef0ljYKkUGy5EfswjQk\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 11:15:17 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Unauthorized\",\n \"Please pass access token\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "token expired", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not be able to verify presentation request as access token passed is expired\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.an('object')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"name\")).to.be.true;", + " pm.expect(responseBody.message[0].name).to.be.equal('TokenExpiredError')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message[0].message).to.be.equal('jwt expired')", + " pm.expect(responseBody.message[0].hasOwnProperty(\"expiredAt\")).to.be.true;", + " pm.expect(responseBody.message[0].expiredAt).to.be.equal(\"2023-02-16T11:11:11.000Z\")", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjFlNGI4NmE2NzY3ZmQ1YWRmY2FhZWEzZjczYWE4ZjkyODkxOSIsInVzZXJJZCI6InZhcnNoYWt1bWFyaTM3MEBnbWFpbC5jb20iLCJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJpYXQiOjE2NzY1MzE0NzEsImV4cCI6MTY3NjU0NTg3MX0.vg0Oe7WPCth_i32d8zyUPcf6tLNZ3n9RvnmPBxibES0", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "token expired", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "145" + }, + { + "key": "ETag", + "value": "W/\"91-dr0epDB3A/ELlhrlSzW2dTgaR04\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 11:16:19 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n {\n \"name\": \"TokenExpiredError\",\n \"message\": \"jwt expired\",\n \"expiredAt\": \"2023-02-16T11:11:11.000Z\"\n }\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "origin issue", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to verify presentation request as origin is not matched with origin set in app \", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(401)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal('Origin mismatch')", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Unauthorized\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "origin issue", + "originalRequest": { + "method": "POST", + "header": [], + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "status": "Unauthorized", + "code": 401, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "71" + }, + { + "key": "ETag", + "value": "W/\"47-Z/rvm+daBAjYJdCCZju2EE6gB8U\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 11:17:00 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 401,\n \"message\": [\n \"Origin mismatch\"\n ],\n \"error\": \"Unauthorized\"\n}" + } + ] + }, + { + "name": "empty body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should not able to verify presentation request as request body is empty\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"statusCode\")).to.be.true;", + " pm.expect(responseBody.statusCode).to.be.a('number')", + " pm.expect(responseBody.statusCode).to.be.equal(400)", + " pm.expect(responseBody.hasOwnProperty(\"message\")).to.be.true;", + " pm.expect(responseBody.message).to.be.an(\"array\");", + " pm.expect(responseBody.message[0]).to.be.equal(\"presentation must be a non-empty object\")", + " pm.expect(responseBody.message[1]).to.be.equal(\"presentation must be an object\")", + "", + " pm.expect(responseBody.hasOwnProperty(\"error\")).to.be.true;", + " pm.expect(responseBody.error).to.be.equal(\"Bad Request\")", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "empty body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "status": "Bad Request", + "code": 400, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "127" + }, + { + "key": "ETag", + "value": "W/\"7f-WcK0L8PCZVAHUhq3xmKOVO6H7f0\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 11:19:04 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"statusCode\": 400,\n \"message\": [\n \"presentation must be a non-empty object\",\n \"presentation must be an object\"\n ],\n \"error\": \"Bad Request\"\n}" + } + ] + }, + { + "name": "verify presentation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var responseBody = pm.response.json()", + "const expiresTime = pm.environment.get('expiresTime')", + "const vcId = pm.environment.get('vcIdPF')", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test('Response body should be an object', function () {", + " pm.expect(typeof responseBody).to.equal(\"object\")", + "})", + "pm.test(\"Should be able to verify presenatation\", function () {", + " pm.expect(responseBody.hasOwnProperty(\"verified\")).to.be.true;", + " pm.expect(responseBody.verified).to.be.a('boolean')", + " pm.expect(responseBody.verified).to.be.equal(true)", + " pm.expect(responseBody.hasOwnProperty(\"results\")).to.be.true", + " pm.expect(responseBody['results']).to.be.a('array')", + "", + "", + "", + "", + " pm.expect(responseBody.results[0].hasOwnProperty(\"@context\")).to.be.true", + " pm.expect(responseBody['results'][0]['@context']).to.be.a('array')", + "", + " pm.expect(responseBody.results[0].hasOwnProperty(\"type\")).to.be.true", + " pm.expect(responseBody['results'][0]['type']).to.be.a('array')", + "", + "", + "", + "", + "", + " pm.expect(responseBody.results[0].hasOwnProperty(\"verifiableCredential\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential']).to.be.a('array')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"@context\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['@context']).to.be.a('array')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"id\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['id']).to.be.a('string')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['id']).to.be.eql(vcId)", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"type\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['type']).to.be.a('array')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"expirationDate\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['expirationDate']).to.be.a('string')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"issuanceDate\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['issuanceDate']).to.be.a('string')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"issuer\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['issuer']).to.be.a('string')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"credentialSubject\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['credentialSubject']).to.be.a('object')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"credentialSchema\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['credentialSchema']).to.be.a('object')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"credentialStatus\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['credentialStatus']).to.be.a('object')", + " pm.expect(responseBody.results[0].verifiableCredential[0].hasOwnProperty(\"proof\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof']).to.be.a('object')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"type\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].type).to.be.a('string')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].type).to.be.eql('Ed25519Signature2020')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"created\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].created).to.be.a('string')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"verificationMethod\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].verificationMethod).to.be.a('string')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofPurpose\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].proofPurpose).to.be.a('string')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].proofPurpose).to.be.eql('assertionMethod')", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].hasOwnProperty(\"proofValue\")).to.be.true", + " pm.expect(responseBody.results[0]['verifiableCredential'][0]['proof'].proofValue).to.be.a('string')", + "", + "pm.expect(responseBody.results[0].hasOwnProperty('id')).to.be.a.true", + "pm.expect(responseBody.results[0].id).to.be.a('string')", + "pm.expect(responseBody.results[0].hasOwnProperty('holder')).to.be.a.true", + "pm.expect(responseBody.results[0].holder).to.be.a('string')", + "pm.expect(responseBody.results[0].hasOwnProperty('proof')).to.be.a.true", + "pm.expect(responseBody.results[0].proof).to.be.a('object')", + "pm.expect(responseBody.results[0].proof.hasOwnProperty('type')).to.be.a.true", + "pm.expect(responseBody.results[0].proof.type).to.be.a('string')", + "pm.expect(responseBody.results[0].proof.type).to.be.equal('Ed25519Signature2020')", + "pm.expect(responseBody.results[0].proof.hasOwnProperty('created')).to.be.a.true", + "pm.expect(responseBody.results[0].proof.created).to.be.a('string')", + "", + "pm.expect(responseBody.results[0].proof.hasOwnProperty('verificationMethod')).to.be.a.true", + "pm.expect(responseBody.results[0].proof.verificationMethod).to.be.a('string')", + "pm.expect(responseBody.results[0].proof.hasOwnProperty('proofPurpose')).to.be.a.true", + "pm.expect(responseBody.results[0].proof.proofPurpose).to.be.a('string')", + "pm.expect(responseBody.results[0].proof.proofPurpose).to.be.equal('authentication')", + "pm.expect(responseBody.results[0].proof.hasOwnProperty('challenge')).to.be.a.true", + "pm.expect(responseBody.results[0].proof.challenge).to.be.a('string')", + "pm.expect(responseBody.results[0].proof.hasOwnProperty('proofValue')).to.be.a.true", + "pm.expect(responseBody.results[0].proof.proofValue).to.be.a('string')", + "", + "", + "", + " pm.expect(responseBody.hasOwnProperty(\"credentialResults\")).to.be.true", + " pm.expect(responseBody['credentialResults']).to.be.a('array')", + "", + "", + "", + "});", + "", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "const oneDayInMilliseconds = 24 * 60 * 60 * 1000;", + "const expiresTime = Date.now() + oneDayInMilliseconds;", + "pm.environment.set('expiresTime',expiresTime)" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{access_Token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"presentation\":{{presentation}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/verify", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "verify" + ] + } + }, + "response": [ + { + "name": "created presentation request", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "origin", + "value": "{{Origin}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"challenge\":\"wjwwrjgtj573nbcj jt\",\n \"did\":\"{{did}}\",\n \"templateId\":\"{{templateId2}}\",\n \"expiresTime\":{{expiresTime}},\n \"callbackUrl\":\"https://api.hypersign.id\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{studio-api-baseUrl}}presentation/request", + "host": [ + "{{studio-api-baseUrl}}presentation" + ], + "path": [ + "request" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "X-Powered-By", + "value": "Express" + }, + { + "key": "Access-Control-Allow-Origin", + "value": "*" + }, + { + "key": "Content-Type", + "value": "application/json; charset=utf-8" + }, + { + "key": "Content-Length", + "value": "830" + }, + { + "key": "ETag", + "value": "W/\"33e-niOG4hcvWcJ32p8Cj2aoCIV874g\"" + }, + { + "key": "Date", + "value": "Sun, 26 Feb 2023 10:47:59 GMT" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "Keep-Alive", + "value": "timeout=5" + } + ], + "cookie": [], + "body": "{\n \"id\": \"ca47291f8ff2effaef8443209c7554ca7162\",\n \"from\": \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\",\n \"created_time\": 1677408479785,\n \"expires_time\": 1677494879557,\n \"reply_url\": \"https://api.hypersign.id\",\n \"reply_to\": [\n \"did:hid:testnet:zHfKPLGK1rLdvAqPsUEQJTXFD6SHahfhRskogW5rviVM8\"\n ],\n \"body\": {\n \"_id\": \"63fb0a73c398867bf047c5d5\",\n \"appId\": \"5c3f07b6c044a691e4b1d6beed381a5483fa\",\n \"domain\": \"hypersign.id\",\n \"query\": [\n {\n \"type\": \"QueryByExample\",\n \"credentialQuery\": [\n {\n \"required\": true,\n \"reason\": \"We need you to prove your eligibility to work.\",\n \"example\": {\n \"@context\": [\n \"https://www.w3.org/2018/credentials/v1\"\n ],\n \"type\": \"AlumniCredential\",\n \"credentialSubject\": {\n \"name\": \"Random name\"\n },\n \"credentialSchema\": {\n \"type\": \"JsonSchemaValidator2018\"\n },\n \"trustedIssuer\": [\n {\n \"required\": true\n }\n ]\n }\n }\n ]\n }\n ],\n \"name\": \"TestTemplate567789701945rt\",\n \"challenge\": \"wjwwrjgtj573nbcj jt\"\n }\n}" + } + ] + } + ] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "studio-api-baseUrl", + "value": "http://ent_9d75832.localhost:8080/api/v1/" + }, + { + "key": "studio_API_auth", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVmFyc2hhIGt1bWFyaSIsImVtYWlsIjoidmFyc2hha3VtYXJpMzcwQGdtYWlsLmNvbSIsImlkIjoiZGlkOmhpZDp0ZXN0bmV0Ono1bjM1YkJpTmhBRmVlZ1QyTUNUcmE0WEhSZkV1Mk5BNzlnaGFjZnRhZ3FZUyIsImlhdCI6MTY3NjQwMTM2MywiZXhwIjoxODg2NTIxMzYzfQ.zboCVCKejYdSZDHXDNYRJQWklVUi9WLx6ww6U2fCcsU" + }, + { + "key": "Origin", + "value": "http://localhost:3001" + }, + { + "key": "access_Token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImJjMDk4YTc4YzAxM2M2M2RlNjU4ZDc5OGFkZWUxMmZjNjQyYyIsInVzZXJJZCI6ImFiOGQ0OGUwLTYwZWItNDM3Yy05YTg2LWUwNjMwODBiMjk0MyIsImdyYW50VHlwZSI6ImNsaWVudF9jcmVkZW50aWFscyIsImttc0lkIjoiaHM6ZG9jOi1qM3F0bHFqb2R0OGxiLWVocWdpcGNkbGphbF9lZWt6MDh4a3EtdzdjbW0iLCJ3aGl0ZWxpc3RlZENvcnMiOlsiaHR0cDovL2VudF85ZDc1ODMyLmxvY2FsaG9zdDo4MDgwIiwiaHR0cDovL2xvY2FsaG9zdDozMDAxIl0sInN1YmRvbWFpbiI6ImVudF85ZDc1ODMyIiwiZWR2SWQiOiJoczpzdHVkaW8tYXBpOmFwcDpiYzA5OGE3OGMwMTNjNjNkZTY1OGQ3OThhZGVlMTJmYzY0MmMiLCJpYXQiOjE3MDAwNDU2NjAsImV4cCI6MTc2MzExNzY2MH0.bDFOwBPcA0WH6RCb2fwEih3GWOKtTdEfLSRZFFUanz0", + "type": "string" + } + ] +} \ No newline at end of file