Skip to content

Commit

Permalink
test(sdk): update integration tests with new use cases (#855)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Holovko <andriy.holovko@gmail.com>
  • Loading branch information
aholovko authored Dec 12, 2024
1 parent 9898fbd commit aef1a52
Show file tree
Hide file tree
Showing 7 changed files with 350 additions and 18 deletions.
2 changes: 1 addition & 1 deletion test/integration/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions test/integration/cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY=
go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY=
golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fixtures/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# vc services
VC_REST_IMAGE=ghcr.io/trustbloc-cicd/vc-server
VC_REST_IMAGE_TAG=v1.11.1-snapshot-ef7a658
VC_REST_IMAGE_TAG=v1.11.1-snapshot-4106ae8

# Remote JSON-LD context provider
CONTEXT_PROVIDER_URL=https://file-server.trustbloc.local:10096/ld-contexts.json
Expand Down
320 changes: 320 additions & 0 deletions test/integration/fixtures/profile/profiles.json
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,138 @@
},
"createDID": true
},
{
"issuer": {
"id": "university_degree_issuer_jwt",
"version": "v1.0",
"groupID": "group_university_degree_issuer",
"name": "University Degree Issuer",
"organizationID": "f13d1va9lp403pb9lyj89vk55",
"url": "http://localhost:8075",
"active": true,
"vcConfig": {
"signingAlgorithm": "JsonWebSignature2020",
"signatureRepresentation": 0,
"keyType": "ED25519",
"format": "jwt",
"didMethod": "ion",
"status": {
"type": "StatusList2021Entry"
}
},
"oidcConfig": {
"client_id": "7d4u50e7w6nfq8tfayhzplgjf",
"client_secret_handle": "282ks4fkuqfosus5k0x30abnv",
"issuer_well_known": "http://cognito-mock.trustbloc.local:9229/local_5a9GzRvB/.well-known/openid-configuration",
"scopes_supported": [
"openid",
"profile"
],
"grant_types_supported": [
"urn:ietf:params:oauth:grant-type:pre-authorized_code"
],
"response_types_supported": [
"code"
],
"token_endpoint_auth_methods_supported": [
"none"
],
"pre-authorized_grant_anonymous_access_supported": true
},
"credentialTemplates": [
{
"contexts": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"type": "UniversityDegreeCredential",
"id": "templateID",
"issuer": "did:ion:university_degree_issuer_jwt",
"checks": {
"strict": false
}
}
],
"credentialMetadata": {
"credential_configurations_supported": {
"UniversityDegreeCredential_jwt_vc": {
"format": "jwt_vc_json",
"credential_definition": {
"type": [
"VerifiableCredential",
"UniversityDegreeCredential"
],
"credentialSubject": {
"familyName": {
"display": [
{
"name": "Family Name",
"locale": "en-US"
}
],
"value_type": "string"
},
"givenName": {
"display": [
{
"name": "Given Name",
"locale": "en-US"
}
],
"value_type": "string"
},
"degree": {
"display": [
{
"name": "Degree",
"locale": "en-US"
}
],
"value_type": "string"
},
"photo": {
"display": [
{
"name": "Photo"
}
],
"value_type": "image"
},
"degreeSchool": {
"display": [
{
"name": "Degree School",
"locale": "en-US"
}
],
"value_type": "string"
}
}
},
"cryptographic_binding_methods_supported": [
"did"
],
"credential_signing_alg_values_supported": [
"JsonWebSignature2020"
],
"display": [
{
"name": "University Degree Credential",
"locale": "en-US",
"logo": {
"uri": "https://example.com/public/logo.png",
"alt_text": "a square logo of a degree verification"
},
"background_color": "#12107c",
"text_color": "#FFFFFF"
}
]
}
}
}
},
"createDID": true
},
{
"issuer": {
"id": "university_degree_issuer_bbs",
Expand Down Expand Up @@ -1439,6 +1571,105 @@
},
"createDID": true
},
{
"verifier": {
"id": "v_ldp_university_degree_v2",
"version": "v1.0",
"name": "v_ldp_university_degree_v2",
"organizationID": "f13d1va9lp403pb9lyj89vk55",
"url": "https://test-verifier.com",
"active": true,
"webHook": "http://vcs.webhook.example.com:8180",
"checks": {
"credential": {
"format": [
"ldp"
],
"proof": true
},
"presentation": {
"format": [
"ldp",
"jwt"
],
"vcSubject": true,
"proof": true
}
},
"oidcConfig": {
"roSigningAlgorithm": "JsonWebSignature2020",
"keyType": "ED25519",
"didMethod": "ion"
},
"presentationDefinitions": [
{
"id": "32f54163-7166-48f1-93d8-ff217bdb0653",
"format": {
"ldp_vc": {
"proof_type": [
"JsonWebSignature2020"
]
},
"ldp_vp": {
"proof_type": [
"JsonWebSignature2020"
]
}
},
"input_descriptors": [
{
"id": "degree",
"name": "Degree",
"purpose": "We can only hire with university degree.",
"constraints": {
"fields": [
{
"path": [
"$['@context']"
],
"filter": {
"type": "array",
"allOf": [
{
"contains": {
"type": "string",
"const": "https://www.w3.org/ns/credentials/v2"
}
},
{
"contains": {
"type": "string",
"const": "https://www.w3.org/ns/credentials/examples/v2"
}
}
]
}
},
{
"path": [
"$['type']"
],
"filter": {
"type": "array",
"allOf": [
{
"contains": {
"type": "string",
"const": "UniversityDegreeCredential"
}
}
]
}
}
]
}
}
]
}
]
},
"createDID": true
},
{
"verifier": {
"id": "v_ldp_university_degree_sd_bbs",
Expand Down Expand Up @@ -1523,6 +1754,95 @@
},
"createDID": true
},
{
"verifier": {
"id": "v_jwt_university_degree",
"version": "v1.0",
"name": "v_jwt_university_degree",
"organizationID": "f13d1va9lp403pb9lyj89vk55",
"url": "https://test-verifier.com",
"active": true,
"webHook": "http://vcs.webhook.example.com:8180",
"checks": {
"credential": {
"format": [
"jwt"
],
"proof": true,
"status": true
},
"presentation": {
"format": [
"jwt"
],
"vcSubject": true,
"proof": true
}
},
"oidcConfig": {
"roSigningAlgorithm": "JsonWebSignature2020",
"keyType": "ED25519",
"didMethod": "ion"
},
"presentationDefinitions": [
{
"id": "6eca10b3-7e68-4ce5-bc19-4bd8aa464fc3",
"input_descriptors": [
{
"id": "e17655ff-e769-43fb-8e20-e72e7501aedd",
"name": "Degree",
"purpose": "We can only hire with university degree.",
"constraints": {
"fields": [
{
"path": [
"$.issuer",
"$.iss"
],
"filter": {
"type": "string",
"pattern": "^did:ion:[a-zA-Z0-9_-]+:[a-zA-Z0-9_-]+$"
}
},
{
"path": [
"$.credentialStatus",
"$.vc.credentialStatus"
]
},
{
"path": [
"$.expirationDate",
"$.exp"
],
"filter": {
"type": "number",
"minimum": 1733839361
}
},
{
"path": [
"$.vc.credentialSubject.degreeSchool"
],
"filter": {
"type": "string",
"const": "MIT school"
}
}
]
},
"schema": [
{
"uri": "VerifiableCredential"
}
]
}
]
}
]
},
"createDID": true
},
{
"verifier": {
"id": "v_myprofile_ldp",
Expand Down
8 changes: 4 additions & 4 deletions test/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ require (
go.opentelemetry.io/otel/trace v1.14.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/crypto v0.30.0 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit aef1a52

Please sign in to comment.