Coder Social home page Coder Social logo

extrawest / extrawest_ocpi Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 344 KB

Python implementation of Open Charge Point Interface (OCPI) protocol based on fastapi.

Home Page: https://www.extrawest.com/

License: MIT License

Python 100.00%
cpo emsp ocpi

extrawest_ocpi's Introduction

Extrawest OCPI

pre-commit Code style: black Checked with mypy commit-check


Python implementation of Open Charge Point Interface (OCPI) protocol based on fastapi.

Supported OCPI versions: 2.2.1, 2.1.1

OCPI Documentation: 2.2.1, 2.1.1


Requirements


Python >= 3.10

Installation


  pip install extrawest-ocpi

Documentation, installation and quickstart instructions are HERE

Roadmap


  • Issues fixing

Related


The project was created through inspiration and adaptation of this project PY_OCPI.

License


This project is licensed under the terms of the MIT license.

extrawest_ocpi's People

Contributors

oleksandr-bozbei-ew avatar andrewdubyniak avatar mykola-bulavkin-ew avatar

Stargazers

David Ringhofer avatar  avatar Stefano Bonetta avatar

Watchers

Stefano Bonetta avatar  avatar

Forkers

ciumabok

extrawest_ocpi's Issues

Hard coded timestamp

timestamp: DateTime = str(datetime.now(timezone.utc)) # type: ignore

Due to this hardcoded value, the timestamps always correspondes to the time the app started.

Instead, fix the last line as follows:

from datetime import datetime, timezone
from typing import List, Union

from pydantic import BaseModel, Field

from py_ocpi.core.data_types import String, DateTime, URL
from py_ocpi.core.enums import ModuleID


class OCPIResponse(BaseModel):
    """
    https://github.com/ocpi/ocpi/blob/2.2.1/transport_and_format.asciidoc#117-response-format
    """

    data: Union[list, dict]
    status_code: int
    status_message: String(255)  # type: ignore
    timestamp: DateTime = Field(default_factory=lambda: datetime.now(tz=timezone.utc).isoformat())

[Vulnerability] FastAPI 0.101.1 possibility to fix?

OSV Report

Scanned /workspace/app/requirements.txt file as a requirements.txt and found 19 packages
+-------------------------------------+------+-----------+---------+---------+----------------------+
| OSV URL                             | CVSS | ECOSYSTEM | PACKAGE | VERSION | SOURCE               |
+-------------------------------------+------+-----------+---------+---------+----------------------+
| https://osv.dev/GHSA-2jv5-9r88-3w3p | 7.5  | PyPI      | fastapi | 0.101.1 | app/requirements.txt |
| https://osv.dev/PYSEC-2024-38       |      |           |         |         |                      |
+-------------------------------------+------+-----------+---------+---------+----------------------+

Safety Report

+==============================================================================+
 VULNERABILITIES FOUND
+==============================================================================+

-> Vulnerability found in fastapi version 0.101.1
   Vulnerability ID: 64930
   Affected spec: <0.109.1
   ADVISORY: FastAPI 0.109.1 addresses a critical security issue by
   upgrading its dependency python-multipart to version >=0.0.7. The upgrade...
   PVE-2024-64930
   For more information, please visit
   https://data.safetycli.com/v/64930/f17

 Scan was completed. 1 vulnerability was found. 

+==============================================================================+

To inform and ask for possibility to fix vulnerabilities?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.