Skip to content
Snippets Groups Projects
Commit 9ab33028 authored by Kalin Canov's avatar Kalin Canov :fishing_pole_and_fish:
Browse files

Merge branch 'main' into 'develop'

sync

See merge request !11
parents 4f0ff318 e30c5069
No related branches found
No related tags found
2 merge requests!12Update,!11sync
Showing
with 1197 additions and 203 deletions
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [
"status",
"code",
"data",
"counters"
],
"properties": {
"status": {
"$id": "#root/status",
"title": "Status",
"type": "string",
"default": "",
"examples": [
"OK"
],
"pattern": "^.*$"
},
"code": {
"$id": "#root/code",
"title": "Code",
"type": "string",
"default": "",
"examples": [
"200"
],
"pattern": "^.*$"
},
"data": {
"$id": "#root/data",
"title": "Data",
"type": "integer",
"examples": [
50
],
"default": 0
},
"counters": {
"$id": "#root/counters",
"title": "Counters",
"type": "object",
"required": [
"receivedStatus",
"storedStatus",
"anchoredStatus",
"anchoredBatches"
],
"properties": {
"receivedStatus": {
"$id": "#root/counters/receivedStatus",
"title": "Receivedstatus",
"type": "integer",
"examples": [
50
],
"default": 0
},
"storedStatus": {
"$id": "#root/counters/storedStatus",
"title": "Storedstatus",
"type": "integer",
"examples": [
50
],
"default": 0
},
"anchoredStatus": {
"$id": "#root/counters/anchoredStatus",
"title": "Anchoredstatus",
"type": "integer",
"examples": [
50
],
"default": 0
},
"anchoredBatches": {
"$id": "#root/counters/anchoredBatches",
"title": "Anchoredbatches",
"type": "integer",
"examples": [
40
],
"default": 0
}
}
}
}
}
This diff is collapsed.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"statusCode": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"invitationUrl": {
"type": "string"
},
"invitation": {
"type": "object",
"properties": {
"@type": {
"type": "string"
},
"@id": {
"type": "string"
},
"label": {
"type": "string"
},
"recipientKeys": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"serviceEndpoint": {
"type": "string"
},
"routingKeys": {
"type": "array",
"items": {}
}
},
"required": [
"@type",
"@id",
"label",
"recipientKeys",
"serviceEndpoint",
"routingKeys"
]
},
"connection": {
"type": "object",
"properties": {
"_tags": {
"type": "object"
},
"metadata": {
"type": "object"
},
"id": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"did": {
"type": "string"
},
"didDoc": {
"type": "object",
"properties": {
"@context": {
"type": "string"
},
"publicKey": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"controller": {
"type": "string"
},
"type": {
"type": "string"
},
"publicKeyBase58": {
"type": "string"
}
},
"required": [
"id",
"controller",
"type",
"publicKeyBase58"
]
}
]
},
"service": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"serviceEndpoint": {
"type": "string"
},
"type": {
"type": "string"
},
"priority": {
"type": "integer"
},
"recipientKeys": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"routingKeys": {
"type": "array",
"items": {}
}
},
"required": [
"id",
"serviceEndpoint",
"type",
"priority",
"recipientKeys",
"routingKeys"
]
}
]
},
"authentication": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"publicKey": {
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"publicKey",
"type"
]
}
]
},
"id": {
"type": "string"
}
},
"required": [
"@context",
"publicKey",
"service",
"authentication",
"id"
]
},
"verkey": {
"type": "string"
},
"state": {
"type": "string"
},
"role": {
"type": "string"
},
"alias": {
"type": "string"
},
"invitation": {
"type": "object",
"properties": {
"@type": {
"type": "string"
},
"@id": {
"type": "string"
},
"label": {
"type": "string"
},
"recipientKeys": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"serviceEndpoint": {
"type": "string"
},
"routingKeys": {
"type": "array",
"items": {}
}
},
"required": [
"@type",
"@id",
"label",
"recipientKeys",
"serviceEndpoint",
"routingKeys"
]
},
"multiUseInvitation": {
"type": "boolean"
}
},
"required": [
"_tags",
"metadata",
"id",
"createdAt",
"did",
"didDoc",
"verkey",
"state",
"role",
"alias",
"invitation",
"multiUseInvitation"
]
}
},
"required": [
"invitationUrl",
"invitation",
"connection"
]
}
},
"required": [
"statusCode",
"message",
"data"
]
}
\ No newline at end of file
#Copyright (c) 2018 Vereign AG [https://www.vereign.com]
#
#This is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as
#published by the Free Software Foundation, either version 3 of the
#License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU Affero General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost/api/getStatuses
#Author: Rosen Georgiev rosen.georgiev@vereign.com
@rest @batch @all
Feature: API - getStatuses POST
Get the previously added Batches
Background:
Given we are testing the VIAM Api
@getStatuses @test
Scenario: Send a batch request and then fetch it with getStatuses - Positive
#Send Batch
Given I load the REST request {Batch.json} with profile {successful_batch}
Given I send a new random batch request via API
And the status code should be {200}
#Get Statuses
Then I wait for {60000} mseconds
Given I clear the request body
Then I call getStatuses with the current sealKey via API
And the status code should be {200}
And the field {$.status} has the value {OK}
And the field {$.code} has the value {200}
And the response is valid according to the {Batch_GetStatuses_schema.json} REST schema
And I assert that getStatus status is the same as the sendBatch value via API
@getStatuses @negative
Scenario Outline: Try to call getStatuses with invalid request - <profile> - Negative
#Get Statuses
Given I clear the request body
Given I load the REST request {Batch.json} with profile {<profile>}
Then I call getStatuses request via API
And the status code should be {400}
And the field {$.message} has the value {<msg>}
Examples:
| profile | msg |
| getStatuses_missing_key | sealID (key) is missing |
| getStatuses_missing_value | sealID (key) is missing |
| getStatuses_empty | sealID (key) is missing |
@sendbatch
Scenario: Send a batch requests with 2 objects and then get them - Positive
#Send Batch
Given I load the REST request {Batch.json} with profile {successful_batch}
Then I send a new random batch request with 2 objects via API
And the status code should be {200}
And the field {message} has the value {batch is queued}
#Get Statuses of seal key 1
Then I wait for {60000} mseconds
Given I clear the request body
Then I call getStatuses with the current sealKey via API
And the status code should be {200}
And the response is valid according to the {Batch_GetStatuses_schema.json} REST schema
And I assert that getStatus status is the same as the sendBatch value via API
#Get Statuses of seal key 2
Given I clear the request body
Then I call getStatuses with the current sealKey2 via API
And the status code should be {200}
And the response is valid according to the {Batch_GetStatuses_schema.json} REST schema
And I assert that getStatus status is the same as the sendBatch value via API
@sendbatch
Scenario: Send 2 separate batch requests for the same key and then get them - Positive
#Send Batch
Given I load the REST request {Batch.json} with profile {successful_batch}
Given I send a new random batch request via API
And the status code should be {200}
Then I send a new batch request via API
And the status code should be {200}
And the field {message} has the value {batch is queued}
#Get Statuses
Then I wait for {120000} mseconds
Given I clear the request body
Then I call getStatuses with the current sealKey via API
And the status code should be {200}
And the field {$..Status} contains {2} elements
\ No newline at end of file
......@@ -13,49 +13,20 @@
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost/api/sendbatch
#http://localhost/ocm/attestation/v1/health
#Author: Rosen Georgiev rosen.georgiev@vereign.com
@rest @batch @all
Feature: API - sendBatch POST
This all sends batch request
@rest @all @ocm @attestation
Feature: API - OCM - attestation - v1 - health GET
Attestation manager health check
Background:
Given we are testing the VIAM Api
Given we are testing the OCM Api
@sendbatch
Scenario: Send a new random batch - Positive
#Send Batch
Given I load the REST request {Batch.json} with profile {successful_batch}
Given I send a new random batch request via API
@health
Scenario: OCM - Attestation - Health check - Positive
Given we call the health check for attestation manager via OCM api
Then the field {statusCode} contains the value {200}
And the status code should be {200}
And the field {message} has the value {batch is queued}
@sendbatch
Scenario: Send 2 batch requests for the same key - Positive
#Send Batch
Given I load the REST request {Batch.json} with profile {successful_batch}
Given I send a new random batch request via API
And the status code should be {200}
Then I send a new batch request via API
And the status code should be {200}
And the field {message} has the value {batch is queued}
@sendbatch @negative
Scenario Outline: Try to send invalid batch requests for sendBatch - <profile> - Negative
#Send Batch
Given I load the REST request {Batch.json} with profile {<profile>}
Given I send a new batch request via API
And the status code should be {<code>}
And the field {message} has the value {<message>}
And the field {kind} has the value {<kind>}
And the field {id} is present and not empty
Examples:
| profile | message | code | kind |
| missing_batch | no status entries to process | 400 | 1 |
| empty_seal_key | invalid batch | 400 | 1 |
| empty_seal_value | invalid batch | 400 | 1 |
| missing_seal | no status entries to process | 400 | 1 |
| not_base64_value | invalid batch | 400 | 1 |
And the field {message} is present and not empty
And I clear the request body
\ No newline at end of file
#Copyright (c) 2018 Vereign AG [https://www.vereign.com]
#
#This is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as
#published by the Free Software Foundation, either version 3 of the
#License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU Affero General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost/ocm/connection/v1/connections
#Author: Rosen Georgiev rosen.georgiev@vereign.com
@rest @all @ocm @connection
Feature: API - OCM - connection - v1 - connections GET
This request fetches the connection information against the provided participantDID otherwise all the connections are fetched.
Background:
Given we are testing the OCM Api
@connections
Scenario: OCM - GET all connections - Positive
Given an administrator fetches all the connections via OCM api
Then the field {statusCode} contains the value {200}
And the response is valid according to the {Connection_GetConnections_schema.json} REST schema
Then the field {message} contains the value {Connections fetch successfully}
@connections
Scenario: OCM - GET all connections with pagination - Positive
Given an administrator fetches all the connections with pageSize {5} and page {1} via OCM api
Then the field {statusCode} contains the value {200}
And the response is valid according to the {Connection_GetConnections_schema.json} REST schema
Then the field {message} contains the value {Connections fetch successfully}
And the field {$.data.records} contains {5} elements
@connections @negative
Scenario: OCM - GET all connections with pagination out of bounds - negative
Given an administrator fetches all the connections with pageSize {9999} and page {9999} via OCM api
Then the field {statusCode} contains the value {200}
And the response is valid according to the {Connection_GetConnections_schema.json} REST schema
Then the field {message} contains the value {Connections fetch successfully}
And the field {$.data.records} contains {0} elements
\ No newline at end of file
#Copyright (c) 2018 Vereign AG [https://www.vereign.com]
#
#This is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as
#published by the Free Software Foundation, either version 3 of the
#License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU Affero General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost/ocm/connection/v1/connections/{connectionId}
#Author: Rosen Georgiev rosen.georgiev@vereign.com
@rest @all @ocm @connection
Feature: API - OCM - connection - v1 - connections - connectionId GET
This request is used to fetch connection information for the connection id provided in URL.
It also provides state of the connection established.
Background:
Given we are testing the OCM Api
@connections @negative
Scenario Outline: OCM - Try to get connection by providing invalid connectionID - <connId> - Negative
Given an administrator fetches connection with connectionId {<connId>}
Then the field {statusCode} contains the value {404}
Then the field {message} contains the value {No Data found}
Examples:
| connId |
| dasdasdas |
\ No newline at end of file
#Copyright (c) 2018 Vereign AG [https://www.vereign.com]
#
#This is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as
#published by the Free Software Foundation, either version 3 of the
#License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU Affero General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost/ocm/connection/v1/health
#Author: Rosen Georgiev rosen.georgiev@vereign.com
@rest @all @ocm @connection
Feature: API - OCM - connection - v1 - health GET
Connection manager health check
Background:
Given we are testing the OCM Api
@health
Scenario: OCM - Connection - Health check - Positive
Given we call the health check for connection manager via OCM api
Then the field {statusCode} contains the value {200}
And the status code should be {200}
And the field {message} is present and not empty
And I clear the request body
\ No newline at end of file
#Copyright (c) 2018 Vereign AG [https://www.vereign.com]
#
#This is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as
#published by the Free Software Foundation, either version 3 of the
#License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU Affero General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost/ocm/connection/v1/invitation-url
#Author: Rosen Georgiev rosen.georgiev@vereign.com
@rest @all @ocm
Feature: API - OCM - connection - v1 - invitation-url POST
It is used to create the connection invitation URL to establish the peer to peer connection,
between two aeries agents or the participant user and the principal user.
Background:
Given we are testing the OCM Api
@connection
Scenario Outline: OCM - Creating a new process connection with alias <alias>- Positive
#Create a new member process connection
Given an administrator generates a QR code by creating a connection with alias {<alias>} via OCM api
Then the field {statusCode} contains the value {200}
And the status code should be {201}
And the response is valid according to the {Connection_POST_invitationURL.json} REST schema
Then the field {message} contains the value {Connection created successfully}
And the field {$..state} contains the value {invited}
And the field {$..role} contains the value {inviter}
And the field {$..alias} contains the value {<alias>}
Examples:
| alias |
| member |
| subscriber |
@connection @negative
Scenario Outline: OCM - Trying to create a new member process connection with invalid alias <alias> - Negative
#Create a new member process connection
Given an administrator generates a QR code by creating a connection with alias {<alias>} via OCM api
Then the field {statusCode} contains the value {400}
And the status code should be {400}
Then the field {message} contains the value {Alias must be provided}
And I clear the request body
Examples:
| alias |
| dsadasd |
| |
@connection @negative
Scenario: OCM - Trying to create a new member process connection without alies - Negative
#Create a new member process connection
Given an administrator generates a QR code by creating a connection via OCM api
Then the field {statusCode} contains the value {400}
And the status code should be {400}
Then the field {message} contains the value {Alias must be provided}
And I clear the request body
\ No newline at end of file
......@@ -13,17 +13,20 @@
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost/policy
#http://localhost/ocm/proof/v1/health
#Author: Rosen Georgiev rosen.georgiev@vereign.com
@rest @all
Feature: API - TSA - policy POST
Add a new policy
@rest @all @ocm @proof
Feature: API - OCM - proof - v1 - health GET
proof manager health check
Background:
Given we are testing the TSA Policy Api
Given we are testing the OCM Api
@policy
Scenario: TSA - Adding a new Policy - Positive
#Send Batch
And I clear the request body
\ No newline at end of file
@health
Scenario: OCM - Proof - Health check - Positive
Given we call the health check for proof manager via OCM api
Then the field {statusCode} contains the value {200}
And the status code should be {200}
And the field {message} is present and not empty
And I clear the request body
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="RegressionTestSuite" tests="1" skipped="0" failures="1" errors="0" timestamp="2022-04-15T13:56:29" hostname="vereign-e4802" time="0.0">
<properties/>
<testcase name="initializationError" classname="RegressionTestSuite" time="0.0">
<failure message="courgette.runtime.CourgetteTestFailureException: There were failing tests. Refer to the Courgette html report for more details." type="courgette.runtime.CourgetteTestFailureException">courgette.runtime.CourgetteTestFailureException: There were failing tests. Refer to the Courgette html report for more details.
</failure>
</testcase>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[Apr 15, 2022 4:56:26 PM cucumber.runtime.filter.TagExpressionOld isOldTagExpression
WARNING: Found tags option '~@wip'. Support for '~@tag' will be removed from the next release of Cucumber-JVM. Please use 'not @tag' instead.
]]></system-err>
</testsuite>
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
As an OCM user
I want to create a new Credential Definition
Feature: Create a new Credential Definition
Create a new Credential Definition on Ledger and save details in DB
Scenario: Provide valid and required Credential Definition Details
Given I have passed all required credential definition details.
# src\credentialDef\controller\controller.ts -> REST API with POST method -> credentialDef/
When passed all valid credential definition details.
Then credential definition should be created on the Ledger with the given details.
And should return the newly created credential definition id.
And store the details in DB.
And I should get the HTTP status code 201 Created and the created Credential Definition Details.
Scenario: Provide invalid schemaID, name, created_by, is_revokable or is_auto_issue
Given I have passed schemaID, name, created_by, is_revokable and is_auto_issue.
# src\credentialDef\controller\controller.ts -> REST API with POST method -> credentialDef/
When passed invalid schemaID, name, created_by, is_revokable or is_auto_issue.
Then I should get HTTP status code 400 Bad Request.
Scenario: Provide name and schemaID of the existing Credential Definition.
Given I have passed all required credential definition details.
# src\credentialDef\controller\controller.ts -> REST API with POST method -> credentialDef/
When passed name and schemaID of the existing Credential Definition.
Then I should get HTTP status code 409 Conflict.
\ No newline at end of file
As an OCM user
I want to get all Credential Definitions by schema id
Feature: Get All Credential Definitions by schema id
Get All Credential Definitions from the DB by given schema id
Scenario: Provide valid schema id, page and page size.
Given I have passed the required schema id, page and page size.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/
When passed details are valid.
Then I should get the HTTP status code 200 Ok and list of Credential Definitions from the DB.
Scenario: Provide invalid schema id.
Given I have passed the required schema id.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/
When passed schema id is invalid.
Then I should get the HTTP status code 404 NOT Found.
\ No newline at end of file
As an OCM user
I want to find Credential Definition by id
Feature: Get Credential Definition by Id
Get Credential Definition by the given cred_def_id
Scenario: Provide valid cred_def_id.
Given I have passed the required cred_def_id.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/:id
When passed cred_def_id is valid.
Then I should get the HTTP status code 200 Ok and Credential Definition from the DB.
Scenario: Provide invalid cred_def_id.
Given I have passed the required cred_def_id.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/:id
When passed cred_def_id is invalid.
Then I should get the HTTP status code 404 Not Found.
As an OCM user
I want to accept a credential offer
Feature: Accept offer credential
Accept a credential offer
Scenario: Provide valid and required credentialId
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> accept-request/
When passed all valid accept offer credential details.
Then credential offer should get accepted.
And I should get the HTTP status code 202 Accepted and the updated credential offer Details.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment