Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Commit

Permalink
fix: HTTPS Support for DIDComm Inbound port
Browse files Browse the repository at this point in the history
- Add HTTPS Support for DIDComm Inbound port
- Add prc card scope in RP adapter
- Add citizenship json-ld context

Signed-off-by: Rolson Quadras <[email protected]>
  • Loading branch information
rolsonquadras committed Feb 16, 2022
1 parent 120025c commit e44894b
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 6 deletions.
5 changes: 2 additions & 3 deletions cmd/adapter-rest/startcmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,12 +1039,11 @@ func createAriesAgent( // nolint:gocyclo,cyclop
return nil, errors.New("didcomm inbound host is mandatory")
}

// TODO - enable TLS on aries inbound transports: https://github.com/trustbloc/edge-adapter/issues/303
inboundTransportOpt := defaults.WithInboundHTTPAddr(
parameters.didCommParameters.inboundHostInternal,
parameters.didCommParameters.inboundHostExternal,
"",
"",
parameters.tlsParams.serveCertPath,
parameters.tlsParams.serveKeyPath,
)

outbound, err := arieshttp.NewOutbound(arieshttp.WithOutboundTLSConfig(tlsConfig))
Expand Down
7 changes: 4 additions & 3 deletions test/bdd/fixtures/adapter-rest/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
- ADAPTER_REST_TLS_SERVE_CERT=/etc/tls/ec-pubCert.pem
- ADAPTER_REST_TLS_SERVE_KEY=/etc/tls/ec-key.pem
- ADAPTER_REST_DIDCOMM_INBOUND_HOST=0.0.0.0:9071
- ADAPTER_REST_DIDCOMM_INBOUND_HOST_EXTERNAL=http://issuer-adapter-rest.trustbloc.local:9071
- ADAPTER_REST_DIDCOMM_INBOUND_HOST_EXTERNAL=https://issuer-adapter-rest.trustbloc.local:9071
- ADAPTER_REST_TRUSTBLOC_DOMAIN=${BLOC_DOMAIN}
- ADAPTER_REST_UNIVERSAL_RESOLVER_URL=http://did.rest.example.com:8072/1.0/identifiers
- ADAPTER_REST_DSN=mongodb://mongodb.example.com:27017
Expand Down Expand Up @@ -57,8 +57,8 @@ services:
- ADAPTER_REST_DSN=mongodb://mongodb.example.com:27017
- ADAPTER_REST_OP_URL=http://PUT-SOMETHING-HERE.com
- ADAPTER_REST_PRESENTATION_DEFINITIONS_FILE=/etc/testdata/presentationdefinitions.json
- ADAPTER_REST_DIDCOMM_INBOUND_HOST=0.0.0.0:8071
- ADAPTER_REST_DIDCOMM_INBOUND_HOST_EXTERNAL=http://rp.adapter.rest.example.com:8071
- ADAPTER_REST_DIDCOMM_INBOUND_HOST=0.0.0.0:8075
- ADAPTER_REST_DIDCOMM_INBOUND_HOST_EXTERNAL=https://rp.adapter.rest.example.com:8075
- ADAPTER_REST_TRUSTBLOC_DOMAIN=${BLOC_DOMAIN}
- ADAPTER_REST_HYDRA_URL=https://hydra.trustbloc.local:4445
- ADAPTER_REST_UNIVERSAL_RESOLVER_URL=http://did.rest.example.com:8072/1.0/identifiers
Expand All @@ -72,6 +72,7 @@ services:
- ADAPTER_REST_MEDIA_TYPE_PROFILES=${AGENT_MEDIA_TYPE_PROFILES}
ports:
- 8070:8070
- 8075:8075
entrypoint: ""
command: /bin/sh -c "adapter-rest start"
volumes:
Expand Down
60 changes: 60 additions & 0 deletions test/bdd/fixtures/testdata/contexts/test-contexts.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,66 @@
}
}
},
{
"url": "https://w3id.org/citizenship/v1",
"content": {
"@context": {
"@version": 1.1,
"@protected": true,
"name": "http://schema.org/name",
"description": "http://schema.org/description",
"identifier": "http://schema.org/identifier",
"image": {
"@id": "http://schema.org/image",
"@type": "@id"
},
"PermanentResidentCard": {
"@id": "https://w3id.org/citizenship#PermanentResidentCard",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"description": "http://schema.org/description",
"name": "http://schema.org/name",
"identifier": "http://schema.org/identifier",
"image": {
"@id": "http://schema.org/image",
"@type": "@id"
}
}
},
"PermanentResident": {
"@id": "https://w3id.org/citizenship#PermanentResident",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"ctzn": "https://w3id.org/citizenship#",
"schema": "http://schema.org/",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"birthCountry": "ctzn:birthCountry",
"birthDate": {
"@id": "schema:birthDate",
"@type": "xsd:dateTime"
},
"commuterClassification": "ctzn:commuterClassification",
"familyName": "schema:familyName",
"gender": "schema:gender",
"givenName": "schema:givenName",
"lprCategory": "ctzn:lprCategory",
"lprNumber": "ctzn:lprNumber",
"residentSince": {
"@id": "ctzn:residentSince",
"@type": "xsd:dateTime"
}
}
},
"Person": "http://schema.org/Person"
}
}
},
{
"url": "https://trustbloc.github.io/context/vc/examples/credit-card-v1.jsonld",
"content": {
Expand Down
9 changes: 9 additions & 0 deletions test/bdd/fixtures/testdata/presentationdefinitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
]
}
},
"prc:local": {
"name": "Permanent Resident Card",
"purpose": "Verify your identity.",
"schema": [
{
"uri": "https://w3id.org/citizenship#PermanentResidentCard"
}
]
},
"credit_score:remote": {
"schema": [{
"uri": "https://example.org/examples#AuthorizationCredential"
Expand Down

0 comments on commit e44894b

Please sign in to comment.