-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/pip/dot-github/workflows/nox-2024…
….10.9
- Loading branch information
Showing
35 changed files
with
2,954 additions
and
2,773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.venv | ||
pygeoapi-openapi.yml | ||
pygeoapi-openapi.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
mkdocs-material | ||
termynal | ||
mkdocs-swagger-ui-tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ pip==24.1.2 | |
nox==2024.10.9 | ||
nox-poetry==1.0.3 | ||
poetry==1.8.3 | ||
poetry-plugin-export==1.8.0 | ||
virtualenv==20.26.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5.1.1 | ||
uses: actions/setup-python@v5.3.0 | ||
with: | ||
python-version: "3.10" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5.1.1 | ||
uses: actions/setup-python@v5.3.0 | ||
with: | ||
python-version: "3.10" | ||
|
||
|
@@ -28,7 +28,7 @@ jobs: | |
pipx install --pip-args=--constraint=$GITHUB_WORKSPACE/.github/workflows/constraints.txt poetry | ||
poetry --version | ||
- name: Install fastgeoapi CLI | ||
- name: Create OpenAPI with fastgeoapi CLI | ||
run: | | ||
poetry install | ||
poetry run fastgeoapi openapi | ||
|
@@ -53,7 +53,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5.1.1 | ||
uses: actions/setup-python@v5.3.0 | ||
with: | ||
python-version: "3.10" | ||
|
||
|
@@ -67,7 +67,7 @@ jobs: | |
pipx install --pip-args=--constraint=$GITHUB_WORKSPACE/.github/workflows/constraints.txt poetry | ||
poetry --version | ||
- name: Install fastgeoapi CLI | ||
- name: Create OpenAPI with fastgeoapi CLI | ||
run: | | ||
poetry install | ||
poetry run fastgeoapi openapi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,7 @@ jobs: | |
- { python: "3.10", os: "ubuntu-20.04", session: "safety" } | ||
- { python: "3.10", os: "ubuntu-20.04", session: "bandit" } | ||
- { python: "3.10", os: "ubuntu-20.04", session: "mypy" } | ||
- { python: "3.9", os: "ubuntu-20.04", session: "mypy" } | ||
- { python: "3.10", os: "ubuntu-20.04", session: "tests" } | ||
- { python: "3.9", os: "ubuntu-20.04", session: "tests" } | ||
# - { python: "3.10", os: "windows-latest", session: "tests" } | ||
# - { python: "3.10", os: "macos-latest", session: "tests" } | ||
- { python: "3.10", os: "ubuntu-20.04", session: "typeguard" } | ||
|
@@ -35,7 +33,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v5.1.1 | ||
uses: actions/setup-python@v5.3.0 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
|
@@ -86,7 +84,7 @@ jobs: | |
print("::set-output name=result::{}".format(result)) | ||
- name: Restore pre-commit cache | ||
uses: actions/cache@v4.0.2 | ||
uses: actions/cache@v4.1.2 | ||
if: matrix.session == 'pre-commit' | ||
with: | ||
path: ~/.cache/pre-commit | ||
|
@@ -100,14 +98,14 @@ jobs: | |
- name: Upload coverage data | ||
if: always() && matrix.session == 'tests' | ||
uses: "actions/upload-artifact@v4.3.4" | ||
uses: "actions/upload-artifact@v4.4.3" | ||
with: | ||
name: coverage-data | ||
path: ".coverage.*" | ||
|
||
- name: Upload documentation | ||
if: matrix.session == 'docs-build' | ||
uses: actions/upload-artifact@v4.3.4 | ||
uses: actions/upload-artifact@v4.4.3 | ||
with: | ||
name: docs | ||
path: docs_build/site | ||
|
@@ -120,7 +118,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5.1.1 | ||
uses: actions/setup-python@v5.3.0 | ||
with: | ||
python-version: "3.10" | ||
|
||
|
@@ -154,4 +152,4 @@ jobs: | |
nox --force-color --session=coverage -- xml | ||
- name: Upload coverage report | ||
uses: codecov/codecov-action@v4.5.0 | ||
uses: codecov/codecov-action@v4.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
"""Authentication models module.""" | ||
|
||
import typing | ||
|
||
import pydantic | ||
from openapi_pydantic.v3.v3_0_3 import Response | ||
|
||
unauthorized = { | ||
"401": Response(description="Unauthorized response", message="Unauthenticated") | ||
} | ||
|
||
|
||
class OAuth2Claim(pydantic.BaseModel): | ||
"""Parse OAuth2 claims.""" | ||
|
||
jti: str = pydantic.Field(...) | ||
sub: str = pydantic.Field(...) | ||
iat: int = pydantic.Field(...) | ||
exp: int = pydantic.Field(...) | ||
iss: str = pydantic.Field(...) | ||
aud: str = pydantic.Field(...) | ||
client_id: typing.Optional[str] = pydantic.Field(None) | ||
|
||
|
||
class TokenPayload(pydantic.BaseModel): | ||
"""Parse payload to token endpoint.""" | ||
|
||
grant_type: str = pydantic.Field(...) | ||
resource: str = pydantic.Field(...) | ||
scope: str = pydantic.Field(...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.