Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bruno/single-node/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "1",
"name": "con-x-local-test",
"type": "collection",
"ignore": [
"node_modules",
".git"
]
}
27 changes: 27 additions & 0 deletions bruno/single-node/environments/con-x-env.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vars {
DOMAIN: https://example.com
ID: did:web:example.com
PART_CONT: connector1
VAULTURL: {{DOMAIN}}
MANAGEMENT: {{DOMAIN}}/management
MANAGEMENT_API_KEY: management-api-key
IDHUB_ID_API: {{DOMAIN}}/api/identity
IDHUB_DID_API: {{DOMAIN}}
IDHUB_CREDS_API: {{DOMAIN}}/api/credentials
ISS_ID: did:web:example.com
ISS_PART_CONT: issuer1
ISSUER_DID_API: {{DOMAIN}}
ISSUER_ID_API: {{DOMAIN}}/api/identity
ISSUER_ISS_API: {{DOMAIN}}/api/issuer
COUNTERPARTY_DOMAIN: https://example.com
COUNTERPARTY_ID: did:web:example.com
COUNTERPARTY_DATAPLANE_PUBLIC: https://example.com/public
IH_APIKEY:
STS_SECRET:
ISSUER_APIKEY:
offerId:
negotiation-id:
pullSecret:
contractId:
transferId:
}
27 changes: 27 additions & 0 deletions bruno/single-node/identities/Inspect Outcome/ShowCredentials.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
meta {
name: ShowCredentials
type: http
seq: 1
}

get {
url: {{IDHUB_ID_API}}/v1alpha/credentials
body: none
auth: none
}

headers {
x-api-key: YWRtaW4.adminKey
}

tests {
test("Got non-empty response", function(){
const body = res.getBody()
expect(body).to.be.an("array").that.is.not.empty;
})
}

settings {
encodeUrl: true
timeout: 0
}
12 changes: 12 additions & 0 deletions bruno/single-node/identities/Inspect Outcome/folder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
meta {
name: Inspect Outcome
seq: 3
}

auth {
mode: inherit
}

docs {
Here we are taking a look at the credentials, that the trusted issuer created for the participants.
}
60 changes: 60 additions & 0 deletions bruno/single-node/identities/Prepare ID/CreateParticipant.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
meta {
name: CreateParticipant
type: http
seq: 1
}

post {
url: {{IDHUB_ID_API}}/v1alpha/participants
body: json
auth: inherit
}

headers {
x-api-key: YWRtaW4.adminKey
}

body:json {
{
"roles": [],
"serviceEndpoints": [
{
"id": "ProviderCredentialService-ID",
"type": "CredentialService",
"serviceEndpoint": "{{DOMAIN}}/api/credentials/v1/participants/{{PART_CONT}}"
},
{
"id": "ProviderIssuerService-ID",
"type": "IssuerService",
"serviceEndpoint": "{{DOMAIN}}/api/issuance/v1alpha/participants/{{PART_CONT}}"
}
],
"active": true,
"participantContextId": "{{PART_CONT}}",
"did": "{{ID}}",
"key": {
"keyId": "{{ID}}#key-1",
"privateKeyAlias": "{{ID}}-alias",
"keyGeneratorParams": {
"algorithm": "EdDSA",
"curve": "Ed25519"
}
}
}
}

script:post-response {
const apiKey = res.getBody().apiKey.trim();
if (apiKey) {
bru.setEnvVar("IH_APIKEY", apiKey);
}
const stsSecret = res.getBody().clientSecret.trim();
if (stsSecret) {
bru.setEnvVar("STS_SECRET", stsSecret)
}
}

settings {
encodeUrl: true
timeout: 0
}
16 changes: 16 additions & 0 deletions bruno/single-node/identities/Prepare ID/Get DID Doc.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Get DID Doc
type: http
seq: 3
}

get {
url: {{IDHUB_DID_API}}/{{PART_CONT}}
body: none
auth: inherit
}

settings {
encodeUrl: true
timeout: 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
meta {
name: RequestDevMemCredential
type: http
seq: 2
}

post {
url: {{IDHUB_ID_API}}/v1alpha/participants/{{PART_CONT}}/credentials/request
body: json
auth: none
}

body:json {
{
"issuerDid": "{{ISS_ID}}",
"credentials": [{
"format": "VC1_0_JWT",
"type": "MembershipCredential",
"id": "dev-credential-def-1"
}]
}
}

script:pre-request {
req.setHeader("x-api-key", bru.getEnvVar("IH_APIKEY"));
}

settings {
encodeUrl: true
timeout: 0
}
21 changes: 21 additions & 0 deletions bruno/single-node/identities/Prepare ID/VaultSecret test.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
meta {
name: VaultSecret test
type: http
seq: 5
}

get {
url: {{VAULTURL}}/v1/secret/data/vaultsecret
body: none
auth: inherit
}

headers {
X-Vault-Token: vaultsecret0123456789
~X-Vault-Token: <VAULT_TOKEN>
}

settings {
encodeUrl: true
timeout: 0
}
29 changes: 29 additions & 0 deletions bruno/single-node/identities/Prepare ID/VaultSecret.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
meta {
name: VaultSecret
type: http
seq: 4
}

post {
url: {{VAULTURL}}/v1/secret/data/vaultsecret
body: json
auth: inherit
}

headers {
X-Vault-Token: vaultsecret0123456789
~X-Vault-Token: <VAULT_TOKEN>
}

body:json {
{
"data": {
"content": "{{STS_SECRET}}"
}
}
}

settings {
encodeUrl: true
timeout: 0
}
13 changes: 13 additions & 0 deletions bruno/single-node/identities/Prepare ID/folder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
meta {
name: Prepare ID
seq: 2
}

auth {
mode: inherit
}

docs {
The requests in this folder are necessary for creating the identity of the provider participant.
We are doing an initial registration at the identity hub. Then we take a look at the created DID document. Then we trigger a credential request toward the trusted issuer. And also, we are storing the STS secret that the identity hub gave us, at the vault.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
meta {
name: CreateIssuerParticipant
type: http
seq: 1
}

post {
url: {{ISSUER_ID_API}}/v1alpha/participants
body: json
auth: inherit
}

headers {
x-api-key: YWRtaW4.adminKey
}

body:json {
{
"roles": [],
"serviceEndpoints": [
{
"id": "IssuerIssuerService-ID",
"type": "IssuerService",
"serviceEndpoint": "{{DOMAIN}}/api/issuance/v1alpha/participants/{{ISS_PART_CONT}}"
},
{
"id": "IssuerCredentialService-ID",
"type": "CredentialService",
"serviceEndpoint": "{{DOMAIN}}/api/credentials/v1/participants/{{ISS_PART_CONT}}"
}
],
"active": true,
"participantContextId": "{{ISS_PART_CONT}}",
"did": "{{ISS_ID}}",
"key": {
"keyId": "{{ISS_ID}}#key-1",
"privateKeyAlias": "{{ISS_ID}}-alias",
"keyGeneratorParams": {
"algorithm": "EdDSA",
"curve": "Ed25519"
}
}
}
}

script:post-response {
const apiKey = res.getBody().apiKey.trim();
if (apiKey) {
bru.setEnvVar("ISSUER_APIKEY", apiKey);
}
}

settings {
encodeUrl: true
timeout: 0
}
16 changes: 16 additions & 0 deletions bruno/single-node/identities/Prepare Issuer/Get Issuer DID Doc.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Get Issuer DID Doc
type: http
seq: 2
}

get {
url: {{ISSUER_DID_API}}/{{ISS_PART_CONT}}
body: none
auth: inherit
}

settings {
encodeUrl: true
timeout: 0
}
28 changes: 28 additions & 0 deletions bruno/single-node/identities/Prepare Issuer/addHolder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
meta {
name: addHolder
type: http
seq: 3
}

post {
url: {{ISSUER_ISS_API}}/v1alpha/participants/{{ISS_PART_CONT}}/holders
body: json
auth: inherit
}

body:json {
{
"holderId" : "DID",
"did" : "DID",
"name" : "PART_CONT"
}
}

script:pre-request {
req.setHeader("x-api-key", bru.getEnvVar("ISSUER_APIKEY"));
}

settings {
encodeUrl: true
timeout: 0
}
Loading