-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add basic structure * feat: add few ocpi data types * feat: add data types * feat: add version module enums and schemas * feat: add basic versions module * feat: add versions details endpoint * refactor: modify VersionNumber enum * feat: add locations module, crud and adaptor * chore: update prospector config * refactor: adaptor * refactor: adaptor * chore: update readme * feat: make crud and adapter dependency, add example * refactor: import core enums and datatypes to source module * refactor: make routers and CRUD methods asycn * fix: linter * fix: update schema definitions * fix: update schema definitions * chore: add pypi publish workflow * refactor: change project name to py_ocpi * Update README.md * refactor: get prefix from env * refactor: change HOST to OCPI_HOST * feat: add pagination for list endpoints * fix: add id param to update method of crud * Update README.md * Rename README.md to README.rst * Update README.rst * Update pyproject.toml * OCPI-55 (#7) * feat: add sessions module schemas and enums * feat: add sessions module schemas and enums * feat: add sessions endpoints * OCPI-48 (#3) * feat: add schemas and enums for credentials module * fix: pylint fix * feat: add credentials module * fix: PR review changes * feat: make crud funtions in credentials endpoint async * fix: change verification params * feat: add cdrs schemas and enums (#10) * feat: add cdrs endpoints, refactor code enums, move universal files to core (#11) * OCPI-48 (#15) * feat: update authorization process * fix: pylint fix * feat: add exception handlder * fix: pylint, add middleware fix * feat: add all test modules (#17) * feat: change post credentials url * feat: modify commands module cpo (#18) * OCPI-66 (#22) * feat: improve crud and adapter, improve OCPI version management * refactor: add routers and modules directories * Fix the router URLs (#36) * Fix the router URLs * Fix versions and details URLs * fix: return version details based on role (#39) * Use dict type instead of list for details endpoint (#40) * Fix the initial authentication (#43) * Base64 encode the bearer token * Decode the base64 encoded authentication token * Require authorization when listing versions * Revert "Fix the initial authentication (#43)" (#44) This reverts commit a40dc0d. * Update push.yaml * Fix initial credentials exchange (#46) * Fix the initial authentication (#43) * Base64 encode the bearer token * Decode the base64 encoded authentication token * Require authorization when listing versions * Remove the list wrapping the credentials object * Fix tests * Skip false positive Bandit test B105 * Ignore false positive * Fix linter error * feat: make new version 0.3.1 --------- Co-authored-by: Hamed Akhavan <[email protected]> Co-authored-by: ViCt0r99 <[email protected]> Co-authored-by: ViCt0r99 <[email protected]> Co-authored-by: Wojtek Siudzinski <[email protected]>
- Loading branch information
1 parent
6dcd0c7
commit 770fd1b
Showing
20 changed files
with
230 additions
and
169 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
branches: | ||
- 'develop' | ||
- 'feature/**' | ||
- 'fix/**' | ||
|
||
jobs: | ||
lint: | ||
|
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,6 +1,6 @@ | ||
"""Python Implementation of OCPI""" | ||
|
||
__version__ = "0.3.0" | ||
__version__ = "0.3.1" | ||
|
||
from .core import enums, data_types | ||
from .main import get_application |
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,107 +1,108 @@ | ||
from py_ocpi.core.enums import ModuleID | ||
from py_ocpi.core.enums import ModuleID, RoleEnum | ||
from py_ocpi.core.data_types import URL | ||
from py_ocpi.core.config import settings | ||
from py_ocpi.modules.versions.schemas import Endpoint | ||
from py_ocpi.modules.versions.enums import VersionNumber, InterfaceRole | ||
|
||
ENDPOINTS = { | ||
VersionNumber.v_2_2_1: [ | ||
VersionNumber.v_2_2_1: { | ||
# ###############--CPO--############### | ||
|
||
# locations | ||
Endpoint( | ||
identifier=ModuleID.locations, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.locations}') | ||
), | ||
# sessions | ||
Endpoint( | ||
identifier=ModuleID.sessions, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.sessions}') | ||
), | ||
# credentials | ||
Endpoint( | ||
identifier=ModuleID.credentials_and_registration, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.credentials_and_registration}') | ||
), | ||
# tariffs | ||
Endpoint( | ||
identifier=ModuleID.tariffs, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.tariffs}') | ||
), | ||
# cdrs | ||
Endpoint( | ||
identifier=ModuleID.cdrs, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.cdrs}') | ||
), | ||
# tokens | ||
Endpoint( | ||
identifier=ModuleID.tokens, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.tokens}') | ||
), | ||
RoleEnum.cpo: [ | ||
# locations | ||
Endpoint( | ||
identifier=ModuleID.locations, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.locations.value}') | ||
), | ||
# sessions | ||
Endpoint( | ||
identifier=ModuleID.sessions, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.sessions.value}') | ||
), | ||
# credentials | ||
Endpoint( | ||
identifier=ModuleID.credentials_and_registration, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.credentials_and_registration.value}') | ||
), | ||
# tariffs | ||
Endpoint( | ||
identifier=ModuleID.tariffs, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.tariffs.value}') | ||
), | ||
# cdrs | ||
Endpoint( | ||
identifier=ModuleID.cdrs, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.cdrs.value}') | ||
), | ||
# tokens | ||
Endpoint( | ||
identifier=ModuleID.tokens, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/cpo' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.tokens.value}') | ||
), | ||
], | ||
|
||
# ###############--EMSP--############### | ||
|
||
# credentials | ||
Endpoint( | ||
identifier=ModuleID.credentials_and_registration, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.credentials_and_registration}') | ||
), | ||
# locations | ||
Endpoint( | ||
identifier=ModuleID.locations, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.locations}') | ||
), | ||
# sessions | ||
Endpoint( | ||
identifier=ModuleID.sessions, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.sessions}') | ||
), | ||
# cdrs | ||
Endpoint( | ||
identifier=ModuleID.cdrs, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.cdrs}') | ||
), | ||
# tariffs | ||
Endpoint( | ||
identifier=ModuleID.tariffs, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.tariffs}') | ||
), | ||
# commands | ||
Endpoint( | ||
identifier=ModuleID.commands, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.commands}') | ||
), | ||
# tokens | ||
Endpoint( | ||
identifier=ModuleID.tokens, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1}/{ModuleID.tokens}') | ||
), | ||
] | ||
|
||
RoleEnum.emsp: [ | ||
# credentials | ||
Endpoint( | ||
identifier=ModuleID.credentials_and_registration, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.credentials_and_registration.value}') | ||
), | ||
# locations | ||
Endpoint( | ||
identifier=ModuleID.locations, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.locations.value}') | ||
), | ||
# sessions | ||
Endpoint( | ||
identifier=ModuleID.sessions, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.sessions.value}') | ||
), | ||
# cdrs | ||
Endpoint( | ||
identifier=ModuleID.cdrs, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.cdrs.value}') | ||
), | ||
# tariffs | ||
Endpoint( | ||
identifier=ModuleID.tariffs, | ||
role=InterfaceRole.receiver, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.tariffs.value}') | ||
), | ||
# commands | ||
Endpoint( | ||
identifier=ModuleID.commands, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.commands.value}') | ||
), | ||
# tokens | ||
Endpoint( | ||
identifier=ModuleID.tokens, | ||
role=InterfaceRole.sender, | ||
url=URL(f'https://{settings.OCPI_HOST}/{settings.OCPI_PREFIX}/emsp' | ||
f'/{VersionNumber.v_2_2_1.value}/{ModuleID.tokens.value}') | ||
), | ||
] | ||
} | ||
} |
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
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.