Skip to content

Commit

Permalink
Merge f143683 into c16b0ce
Browse files Browse the repository at this point in the history
  • Loading branch information
playpauseandstop committed May 29, 2023
2 parents c16b0ce + f143683 commit 169649f
Show file tree
Hide file tree
Showing 11 changed files with 1,420 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
- uses: "./.github/actions/run_tox"
env:
LEVEL: "test"
PYTHONPATH: "examples/hobotnica/src:examples/petstore/src:examples/simulations/src:examples/todobackend/src"
PYTHONPATH: "examples/hobotnica/src:examples/petstore/src:examples/simulations/src:examples/todobackend/src:examples/vc-api/src"
REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}/0"
with:
python-path: "${{ steps.python_and_poetry.outputs.python-path }}"
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ validate: install
$(PYTHON_BIN) -m openapi_spec_validator $(EXAMPLES_DIR)/petstore/src/petstore/petstore-expanded.yaml
$(PYTHON_BIN) -m openapi_spec_validator $(EXAMPLES_DIR)/simulations/src/simulations/openapi.yaml
$(PYTHON_BIN) -m openapi_spec_validator $(EXAMPLES_DIR)/todobackend/src/todobackend/openapi.yaml
$(PYTHON_BIN) -m openapi_spec_validator $(EXAMPLES_DIR)/vc-api/src/vc_api/vc-api.yaml
$(PYTHON_BIN) -m openapi_spec_validator $(TESTS_DIR)/$(PROJECT)/openapi.json
$(PYTHON_BIN) -m openapi_spec_validator $(TESTS_DIR)/$(PROJECT)/openapi.yaml
6 changes: 6 additions & 0 deletions examples/vc-api/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=========================
Verifiable Credential API
=========================

Ensure that OpenAPI schema from https://github.com/w3c-ccg/vc-api/ supported
well by *rororo* library.
Empty file.
22 changes: 22 additions & 0 deletions examples/vc-api/src/vc_api/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from pathlib import Path
from typing import List, Union

from aiohttp import web

from rororo import BaseSettings, setup_openapi, setup_settings
from vc_api.views import operations


def create_app(
argv: Union[List[str], None] = None,
*,
settings: Union[BaseSettings, None] = None,
) -> web.Application:
settings = settings or BaseSettings.from_environ()

return setup_openapi(
setup_settings(web.Application(), settings),
Path(__file__).parent / "vc-api.yaml",
operations,
cache_create_schema_and_spec=settings.is_test,
)
35 changes: 35 additions & 0 deletions examples/vc-api/src/vc_api/examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ISSUE_CREDENTIAL_REQUEST = {
"credential": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1",
],
"id": "http://example.gov/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "did:example:123",
"issuanceDate": "2020-03-16T22:37:26.544Z",
"credentialSubject": {
"id": "did:example:123",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts",
},
},
},
"options": {
"created": "2020-04-02T18:48:36Z",
"credentialStatus": {"type": "RevocationList2020Status"},
},
}

ISSUE_CREDENTIAL_RESPONSE = {
"verifiableCredential": {
"proof": {
"type": "Ed25519Signature2018",
"created": "2020-04-02T18:28:08Z",
"verificationMethod": "did:example:123#z6MksHh7qHWvybLg5QTPPdG2DgEjjduBDArV9EF9mRiRzMBN",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..YtqjEYnFENT7fNW-COD0HAACxeuQxPKAmp4nIl8jYAu__6IH2FpSxv81w-l5PvE1og50tS9tH8WyXMlXyo45CA",
},
}
}

0 comments on commit 169649f

Please sign in to comment.