Skip to content

Commit 40322dc

Browse files
authored
feat: DID URL dereferencing (#146)
Merging work on DID URL dereferencing as has been tested
2 parents 8a7414b + 95c96d7 commit 40322dc

File tree

291 files changed

+21579
-2441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+21579
-2441
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424
go install github.com/onsi/ginkgo/v2/ginkgo@latest
2525
2626
- name: Run Golang unit tests
27-
run: ginkgo -r --race --randomize-all --randomize-suites --keep-going --trace
27+
working-directory: ./tests/unit/
28+
run: ginkgo -r --tags unit --race --randomize-all --randomize-suites --keep-going --trace
2829

2930
integration-tests:
3031
name: "Integration Tests"
@@ -46,15 +47,27 @@ jobs:
4647
- name: Set up Docker container for test
4748
run: docker compose -f tests/docker-compose-testing.yml up --detach --no-build
4849

49-
- name: Setup Python environment
50-
working-directory: ./tests/pytest
51-
run: |
52-
set -euo pipefail
53-
pip3 install -r requirements.txt >> /dev/null
54-
sudo chmod -R 775 /home/runner/
50+
- uses: actions/setup-go@v4
51+
with:
52+
go-version-file: ./go.mod
53+
cache: true
5554

56-
- name: Run tests
57-
working-directory: ./tests/pytest
55+
- name: Install ginkgo
56+
working-directory: ./..
57+
run: go install github.com/onsi/ginkgo/v2/ginkgo@latest
58+
59+
- name: Run Ginkgo integration tests
60+
working-directory: ./tests/integration/rest
5861
run: |
59-
set -euo pipefail
60-
pytest -v -rP ./*.py
62+
ginkgo -r --tags integration --race --randomize-suites --keep-going --trace --junit-report ./report-integration.xml
63+
64+
- name: Show logs
65+
if: failure()
66+
working-directory: ./docker/localnet
67+
run: docker compose -f tests/docker-compose-testing.yml logs --tail --follow
68+
69+
- name: Upload integration tests result
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: report-integration.xml
73+
path: tests/integration/rest/report-integration.xml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,6 @@ cython_debug/
445445
# and can be added to the global gitignore or merged into this file. For a more nuclear
446446
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
447447
#.idea/
448+
449+
# Integration test report file
450+
tests/integration/rest/report-integration.xml

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ tidy:
130130
###############################################################################
131131

132132
unit-tests:
133-
go test -v ./...
133+
cd tests/unit && ginkgo -r --tags unit --race
134+
135+
integration-tests:
136+
cd tests/integration/rest && ginkgo -r --tags integration --race
134137

135138
lint:
136139
golangci-lint run --config .github/linters/.golangci.yaml
@@ -155,7 +158,7 @@ clean:
155158

156159
swagger:
157160
@echo "Generating Swagger files..."
158-
@go install github.com/swaggo/swag/cmd/swag@latest
161+
@go install github.com/swaggo/swag/cmd/swag@v1.8.11
159162
@swag fmt
160163
@swag init -g ./main.go
161164
.PHONY: swagger

docs/docs.go

Lines changed: 83 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/swagger.json

Lines changed: 82 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,98 @@
4747
},
4848
{
4949
"type": "string",
50-
"description": "Service Type",
50+
"description": "#Fragment",
51+
"name": "fragmentId",
52+
"in": "query"
53+
},
54+
{
55+
"type": "string",
56+
"description": "Version",
57+
"name": "versionId",
58+
"in": "query"
59+
},
60+
{
61+
"type": "string",
62+
"description": "Created of Updated time of DID Document",
63+
"name": "versionTime",
64+
"in": "query"
65+
},
66+
{
67+
"type": "string",
68+
"description": "Can transform Verification Method into another type",
69+
"name": "transformKey",
70+
"in": "query"
71+
},
72+
{
73+
"type": "string",
74+
"description": "Redirects to Service Endpoint",
5175
"name": "service",
5276
"in": "query"
5377
},
5478
{
5579
"type": "string",
56-
"description": "#Fragment",
57-
"name": "fragmentId",
80+
"description": "Addition to Service Endpoint",
81+
"name": "relativeRef",
5882
"in": "query"
5983
},
6084
{
6185
"type": "string",
62-
"description": "Version",
63-
"name": "versionId",
86+
"description": "Show only metadata of DID Document",
87+
"name": "metadata",
88+
"in": "query"
89+
},
90+
{
91+
"type": "string",
92+
"description": "Filter by ResourceId",
93+
"name": "resourceId",
94+
"in": "query"
95+
},
96+
{
97+
"type": "string",
98+
"description": "Filter by CollectionId",
99+
"name": "resourceCollectionId",
100+
"in": "query"
101+
},
102+
{
103+
"type": "string",
104+
"description": "Filter by Resource Type",
105+
"name": "resourceType",
106+
"in": "query"
107+
},
108+
{
109+
"type": "string",
110+
"description": "Filter by Resource Name",
111+
"name": "resourceName",
112+
"in": "query"
113+
},
114+
{
115+
"type": "string",
116+
"description": "Filter by Resource Version",
117+
"name": "resourceVersion",
118+
"in": "query"
119+
},
120+
{
121+
"type": "string",
122+
"description": "Get the nearest resource by creation time",
123+
"name": "resourceVersionTime",
124+
"in": "query"
125+
},
126+
{
127+
"type": "string",
128+
"description": "Show only metadata of resources",
129+
"name": "resourceMetadata",
130+
"in": "query"
131+
},
132+
{
133+
"type": "string",
134+
"description": "Sanity check that Checksum of resource is the same as expected",
135+
"name": "checksum",
64136
"in": "query"
65137
}
66138
],
67139
"responses": {
68140
"200": {
69-
"description": "OK",
141+
"description": "versionId, versionTime, transformKey returns Full DID Document",
70142
"schema": {
71143
"$ref": "#/definitions/types.DidResolution"
72144
}
@@ -621,6 +693,10 @@
621693
"resourceURI": {
622694
"type": "string",
623695
"example": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b"
696+
},
697+
"resourceVersion": {
698+
"type": "string",
699+
"example": "1"
624700
}
625701
}
626702
},

0 commit comments

Comments
 (0)