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"
]
}
40 changes: 40 additions & 0 deletions bruno/single-node/environments/local-con-x-env.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
vars {
ISSUER_DID_API: {{ISSUER_DOMAIN}}
ISSUER_ID_API: {{ISSUER_DOMAIN}}/api/identity
ISSUER_ISS_API: {{ISSUER_DOMAIN}}/api/issuer
CONSUMER_IDHUB_DID_API: {{CONSUMER_DOMAIN}}
CONSUMER_IDHUB_ID_API: {{CONSUMER_DOMAIN}}/api/identity
CONSUMER_IDHUB_STS_API: {{CONSUMER_DOMAIN}}/api/sts
CONSUMER_IDHUB_CREDS_API: {{CONSUMER_DOMAIN}}/api/credentials
ISSUER_APIKEY: ZGlkOndlYjpsb2NhbC1pc3N1ZXItc2VydmljZTpmeC1pc3N1ZXI=.CmYgVcuzneJXqzcbj7vmld5feejy6OguIylflSrz6WTjG1HNQRvO62EafFrQjS/lVlZAwiwz2rwwZgXrbpyhcg==
CONSUMER_IH_APIKEY: ZGlkOndlYjpsb2NhbC11c2VyLWlkaHViOnVzZXI6Y29uc3VtZXI=.ObFly02OtymUNRE43uH9SblWVtsZH0NMddgm1dFYQXRekO3qXX+rHFV7NvM+DUW3lcA2PbILt5rwWYEqm7WNgw==
PROVIDER_IH_APIKEY: ZGlkOndlYjpsb2NhbC11c2VyLWlkaHViOnVzZXI6cHJvdmlkZXI=.Knip+hedL63qedBQfOvZhhrF2ooSCfP2YgjONvtmehofor2ejdw/en0MAXDBZEcXrCwYNppDMNFDsRlG5rB/Mw==
CONSUMER_VAULTURL: {{CONSUMER_DOMAIN}}
CONSUMER_STS_SECRET: VD0q6jOEyslSeFV2
PROVIDER_STS_SECRET: XjDk9ncaJSrSfkQW
PROVIDER_MANAGEMENT: {{PROVIDER_DOMAIN}}/management
CONSUMER_MANAGEMENT: {{CONSUMER_DOMAIN}}/management
PROVIDER_DATAPLANE_PUBLIC: {{PROVIDER_DOMAIN}}/public
PROVIDER_IDHUB_DID_API: {{PROVIDER_DOMAIN}}
PROVIDER_IDHUB_ID_API: {{PROVIDER_DOMAIN}}/api/identity
PROVIDER_IDHUB_STS_API: {{PROVIDER_DOMAIN}}/api/sts
PROVIDER_IDHUB_CREDS_API: {{PROVIDER_DOMAIN}}/api/credentials
ISS_ID: did:web:example.com
CONS_ID: did:web:example.com
PROV_ID: did:web:example.com
cons_access_token: eyJraWQiOiJkaWQ6d2ViOmNvbnN1bWVyLWlkaHViOnVzZXI6Y29uc3VtZXIja2V5LTEiLCJhbGciOiJFZDI1NTE5In0.eyJhdWQiOiJkaWQ6d2ViOmNvbnN1bWVyLWlkaHViOnVzZXI6Y29uc3VtZXIiLCJzdWIiOiJkaWQ6d2ViOnByb3ZpZGVyLWlkaHViOnVzZXI6cHJvdmlkZXIiLCJuYmYiOjE3NzAyNzg5NTQsInNjb3BlIjoib3JnLmVjbGlwc2UudHJhY3R1c3gudmMudHlwZTpNZW1iZXJzaGlwQ3JlZGVudGlhbDpyZWFkIiwiaXNzIjoiZGlkOndlYjpjb25zdW1lci1pZGh1Yjp1c2VyOmNvbnN1bWVyIiwiZXhwIjoxNzcwMjc5MjU0LCJpYXQiOjE3NzAyNzg5NTQsImp0aSI6ImFjY2Vzc3Rva2VuLTcxYThmNTA5LTgwYTktNDMwZC1iMjU0LTMxNGFiYTBkNjY5OSJ9.ipRpdi_Ekh7y4IIqhqLgHU35Fn7NNkv6e6hILXy8pZObdy33y3MKppI61424eyHwqzmh7X2kwV2S5gDy3aOKCQ
prov_access_token: eyJraWQiOiJkaWQ6d2ViOnByb3ZpZGVyLWlkaHViOnVzZXI6cHJvdmlkZ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Z0hVMzVGbjdOTmt2NmU2aElMWHk4cFpPYmR5MzN5M01LcHBJNjE0MjRleUh3cXptaDdYMmt3VjJTNWdEeTNhT0tDUSJ9.42YDTnuzZ0RprqLjFw6hUoAXrgpPxyzKNFrqLdbWz6HXAiujkq32QAFU-M9gtQ0hMNcjshRZUX6DryBWxhGNDw
offerId: MQ==:YXNzZXRJZA==:MDFhN2ZjYWYtODgzOS00N2JmLTllZDAtM2Y0YjliMTFiOWM5
negotiation-id: 3745ad50-6b99-4142-bf1a-509b3d0e313d
contractId: 3345f7f1-f735-4c92-8aa2-6e137203b2f9
transferId: 3ebe55c6-900a-4c03-b213-20c5c3f0274d
pullSecret: eyJraWQiOiJwcm92X3B1YiIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJhbm9ueW1vdXMiLCJhdWQiOiJkaWQ6d2ViOmNvbnN1bWVyLWlkaHViOnVzZXI6Y29uc3VtZXIiLCJzdWIiOiJhbm9ueW1vdXMiLCJpYXQiOjE3NzAyNzg5ODgsImp0aSI6IjUwYWQxMjk3LWZhN2QtNDI0ZC1hNjBhLTg5M2MwMGE4OTZhYyJ9.GkSz0qXhFmqPaLQpfPLkAvODX-iekoAQvLh3Kglhm7DApNF3PsGnv-Qzm7m8eNAqTUTWB9XXkRng_XqWmuAd-FWvzwG8d7ZaAahuykkOgX1W7vHWBMdJa-zvNm0cnzm-TQLWYCU-tDSKk_g_UrDUaFf9Jdq-avCoer3wcZrEmrf0K4o_WWs-l5hZEfDIOYHRsgoCY3P8pMcZYRjV57zdLUDl9SvLuCRR0ex0fKxJ2pb7mlaCL5ooD6fRaqWyrLvrIKZaDYfwKrX7IRJT9ePKyls9VKA9JBakh676L0jBr5-2TYG3uE9Xhyv4CZlqyck-_NyiL4Jao8-lL5FVCbPDVQ
ISS_PART_CONT: did:web:example.com
CONS_PART_CONT: did:web:example.com
PROV_PART_CONT: did:web:example.com
PROVIDER_VAULTURL: {{PROVIDER_DOMAIN}}
CONSUMER_MANAGEMENT_API_KEY: prov-management-api-key
ISSUER_DOMAIN: https://example.com
CONSUMER_DOMAIN: https://example.com
PROVIDER_DOMAIN: https://example.com
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
meta {
name: ShowConsumerCredentials
type: http
seq: 1
}

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

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

script:pre-request {
const t = Date.now();
await new Promise(resolve => setTimeout(resolve, 2500));
console.log("Waited " + (Date.now() - t) + " ms");
}

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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
meta {
name: ShowProviderCredentials
type: http
seq: 2
}

get {
url: {{PROVIDER_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: 4
}

auth {
mode: inherit
}

docs {
Here we are taking a look at the credentials, that the trusted issuer created for the participants.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
meta {
name: CreateConsumerParticipant
type: http
seq: 1
}

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

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

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

script:pre-request {
const cons_id = bru.getEnvVar("CONS_ID");
//const participantContext = cons_id.split(":").slice(3).join(":").replace(/:/g, "-");
const participantContext = cons_id
bru.setEnvVar("CONS_PART_CONT", participantContext);
}

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

settings {
encodeUrl: true
timeout: 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Get Consumer DID Doc
type: http
seq: 3
}

get {
url: {{CONSUMER_IDHUB_DID_API}}/did.json
body: none
auth: inherit
}

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

post {
url: {{CONSUMER_IDHUB_ID_API}}/v1alpha/participants/{{CONS_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 {
const cons_id = bru.getEnvVar("CONS_ID");
//const participantContext = cons_id.split(":").slice(3).join(":").replace(/:/g, "-");
const participantContext = cons_id
bru.setEnvVar("CONS_PART_CONT", participantContext);
req.setHeader("x-api-key", bru.getEnvVar("CONSUMER_IH_APIKEY"));
}

settings {
encodeUrl: true
timeout: 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
meta {
name: VaultSecret test
type: http
seq: 5
}

get {
url: {{CONSUMER_VAULTURL}}/v1/secret/data/consumersecret
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 Consumer 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: {{CONSUMER_VAULTURL}}/v1/secret/data/consumersecret
body: json
auth: inherit
}

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

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

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

auth {
mode: inherit
}

docs {
The requests in this folder are necessary for creating the identity of the consumer 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,63 @@
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": "{{ISSUER_DOMAIN}}/api/issuance/v1alpha/participants/{{ISS_PART_CONT}}"
},
{
"id": "IssuerCredentialService-ID",
"type": "CredentialService",
"serviceEndpoint": "{{ISSUER_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:pre-request {
const iss_id = bru.getEnvVar("ISS_ID");
//const participantContext = iss_id.split(":").slice(3).join(":").replace(/:/g, "-");
const participantContext = iss_id
bru.setEnvVar("ISS_PART_CONT", participantContext);
}

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}}/did.json
body: none
auth: inherit
}

settings {
encodeUrl: true
timeout: 0
}
Loading