diff --git a/README.md b/README.md index 0f1c0c3..d59a85d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/verifier/core/verifying.py b/src/verifier/core/verifying.py index 96d9134..53e3601 100644 --- a/src/verifier/core/verifying.py +++ b/src/verifier/core/verifying.py @@ -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 [] diff --git a/tests/core/test_verifying.py b/tests/core/test_verifying.py index 83a2217..55c44aa 100644 --- a/tests/core/test_verifying.py +++ b/tests/core/test_verifying.py @@ -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 @@ -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 @@ -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