Skip to content

Commit

Permalink
Add /v1/cesr-verifier as base URL (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-a-tanjim authored Oct 30, 2024
1 parent 7578e30 commit 9b16b42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ verifier server start --config-dir scripts --config-file verifier-config.json


## API
PUT `/presentations/{said}` with the CESR material in the body. Examples:
PUT `/v1/cesr-verifier/presentations/{said}` with the CESR material in the body. Examples:

```
curl -X PUT http://localhost:7676/presentations/EFgXpBg0WwFqdnCV0lHfZqjP-ZAlO4XBgF1fSi8e_ZeB -vvvv -H "Content-Type: application/json+cesr" --data "@./tests/data/credential/EFgXpBg0WwFqdnCV0lHfZqjP-ZAlO4XBgF1fSi8e_ZeB.cesr"
curl -X PUT http://localhost:7676/v1/cesr-verifier/presentations/EFgXpBg0WwFqdnCV0lHfZqjP-ZAlO4XBgF1fSi8e_ZeB -vvvv -H "Content-Type: application/json+cesr" --data "@./tests/data/credential/EFgXpBg0WwFqdnCV0lHfZqjP-ZAlO4XBgF1fSi8e_ZeB.cesr"
curl -X PUT http://localhost:7676/presentations/EKLZNI1s8U0PCGG1XtjIX6VV-O6GCtdv1qpFPlEzZJuO -vvvv -H "Content-Type: application/json+cesr" --data "@./tests/data/credential/EKLZNI1s8U0PCGG1XtjIX6VV-O6GCtdv1qpFPlEzZJuO.cesr"
curl -X PUT http://localhost:7676/v1/cesr-verifier/presentations/EKLZNI1s8U0PCGG1XtjIX6VV-O6GCtdv1qpFPlEzZJuO -vvvv -H "Content-Type: application/json+cesr" --data "@./tests/data/credential/EKLZNI1s8U0PCGG1XtjIX6VV-O6GCtdv1qpFPlEzZJuO.cesr"
```

## State of the Application
Expand Down
4 changes: 2 additions & 2 deletions src/verifier/core/verifying.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def loadEnds(app, hby, vdb, tvy, vry):
healthEnd = HealthEndpoint()
app.add_route("/health", healthEnd)
credEnd = PresentationResourceEndpoint(hby, vdb, tvy, vry)
app.add_route("/presentations/{said}", credEnd)
app.add_route("/v1/cesr-verifier/presentations/{said}", credEnd)
verifierEnd = VerifierResourceEndpoint(hby, vdb, tvy, vry)
app.add_route("/verifier", verifierEnd)
app.add_route("/v1/cesr-verifier/verifier", verifierEnd)
return []


Expand Down
8 changes: 4 additions & 4 deletions tests/core/test_verifying.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_setup_verifying(seeder):
# Create a test client
client = falcon.testing.TestClient(app)
# Define the said and the credential
result = client.simulate_put(f'/presentations/{said}',
result = client.simulate_put(f'/v1/cesr-verifier/presentations/{said}',
body=acdc,
headers={'Content-Type': 'application/json+cesr'})
assert result.status == falcon.HTTP_202
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_ecr(seeder):
# Create a test client
client = falcon.testing.TestClient(app)
# Define the said and the credential
result = client.simulate_put(f'/presentations/{ecsaid}',
result = client.simulate_put(f'/v1/cesr-verifier/presentations/{ecsaid}',
body=acdc,
headers={'Content-Type': 'application/json+cesr'})
assert result.status == falcon.HTTP_202
Expand Down Expand Up @@ -124,14 +124,14 @@ def test_ecr_missing(seeder):
# Create a test client
client = falcon.testing.TestClient(app)
# Define the said and the credential
result = client.simulate_put(f'/presentations/{easaid}',
result = client.simulate_put(f'/v1/cesr-verifier/presentations/{easaid}',
body=acdc,
headers={'Content-Type': 'application/json+cesr'})
assert result.status == falcon.HTTP_400

issAndCred.extend(eamsgs)
acdc = issAndCred.decode("utf-8")
result = client.simulate_put(f'/presentations/{easaid}',
result = client.simulate_put(f'/v1/cesr-verifier/presentations/{easaid}',
body=acdc,
headers={'Content-Type': 'application/json'})
assert result.status == falcon.HTTP_400
Expand Down

0 comments on commit 9b16b42

Please sign in to comment.