From 7694f736ec869f5391d70ac2dcfaaa11356de936 Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Sun, 17 Mar 2024 16:43:56 +0200 Subject: [PATCH 01/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From a6d14bfb113f26fe1f68f66b7a42300487cd71bd Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Wed, 1 May 2024 02:46:35 +0300 Subject: [PATCH 02/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 6d713e599a3bbee2329a20460bcf7eeecf896897 Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Wed, 1 May 2024 05:13:55 +0300 Subject: [PATCH 03/70] squash! --- .github/dependabot.yml | 14 ++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++++++++++++++ .github/workflows/GitHub.yml | 57 ++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4242a05 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..e6091e5 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..0be30ba --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,57 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + steps: + - uses: pozil/auto-assign-issue@v1.14.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From 9c0ff1e69d9cb2f276e9946db4d391d73bed5aec Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Wed, 1 May 2024 22:53:19 +0300 Subject: [PATCH 04/70] squash! --- .github/dependabot.yml | 14 -------- .github/workflows/Dependabot.yml | 45 ------------------------- .github/workflows/GitHub.yml | 57 -------------------------------- 3 files changed, 116 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index e6091e5..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 0be30ba..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - steps: - - uses: pozil/auto-assign-issue@v1.14.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 From 2bbee7d436298d402cbfe3a84e7a69eefce07738 Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Thu, 2 May 2024 04:23:11 +0300 Subject: [PATCH 05/70] squash! --- .github/dependabot.yml | 14 ++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++++++++++++++ .github/workflows/GitHub.yml | 57 ++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4242a05 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..e6091e5 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..0be30ba --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,57 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + steps: + - uses: pozil/auto-assign-issue@v1.14.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From cca69ea755dbb87fb09b90976e941edbc625209f Mon Sep 17 00:00:00 2001 From: "Nikola R. Hristov" Date: Thu, 2 May 2024 23:32:04 +0300 Subject: [PATCH 06/70] squash! --- .gitignore | 106 -------------------------------------- CODE_OF_CONDUCT.md | 9 ---- LICENSE | 21 -------- README.md | 48 ----------------- SECURITY.md | 41 --------------- SUPPORT.md | 25 --------- flushdb.py | 9 ---- main.py | 126 --------------------------------------------- models.py | 9 ---- requirements.txt | 18 ------- 10 files changed, 412 deletions(-) delete mode 100644 .gitignore delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 SECURITY.md delete mode 100644 SUPPORT.md delete mode 100644 flushdb.py delete mode 100644 main.py delete mode 100644 models.py delete mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f75400b..0000000 --- a/.gitignore +++ /dev/null @@ -1,106 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -settings.json \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index f9ba8cf..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 62f454e..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 7c991dd..0000000 --- a/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Python/FastAPI Tutorial for Visual Studio Code -This sample contains the completed program from the tutorial: [FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). Immediate steps are not included. - -## Run the app using GitHub Codespaces -[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments that work how and where you want it to. To learn how to set up a GitHub Codespace for this repository, check the [documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to start the debugger and run the application. - -Once it's ready, you will see a notification with a button `Open in the Browser`. Clicking the button will open your application on the browser. You can then add `/docs` to the end of the URL to access the Swagger UI and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your operating system. To get started, first clone this project on your machine and then open it in VS Code (**File** > **Open Folder...**). - -### Windows -To run this app locally in VS Code on Windows, you can use either [WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers -1. Make sure you have [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL -1. Make sure you have [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing -Contributions to the sample are welcome! When submitting changes, also consider submitting matching changes to the tutorial, the source file for which is [tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - -## Additional details - -* This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -* For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -* Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index b3c89ef..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). - - diff --git a/SUPPORT.md b/SUPPORT.md deleted file mode 100644 index 291d4d4..0000000 --- a/SUPPORT.md +++ /dev/null @@ -1,25 +0,0 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? - -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. - -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/flushdb.py b/flushdb.py deleted file mode 100644 index 65442ad..0000000 --- a/flushdb.py +++ /dev/null @@ -1,9 +0,0 @@ -""" -This module is used to interact with a Redis database. - -WARNING: This script will flush the entire Redis database. Use with caution. -""" -import redis - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) -redis_client.flushdb() diff --git a/main.py b/main.py deleted file mode 100644 index 1ad8072..0000000 --- a/main.py +++ /dev/null @@ -1,126 +0,0 @@ -import os - -import redis -from fastapi import FastAPI, HTTPException, Request - -from models import ItemPayload - -app = FastAPI() - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) - - -@app.get("/") -def home(request: Request) -> dict[str, str]: - url: str = ( - f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}/" - if os.getenv("CODESPACE_NAME") - else str(request.base_url) - ) - return { - "message": f"Navigate to the following URL to access the Swagger UI: {url}docs" - } - - -# Route to add an item -@app.post("/items/{item_name}/{quantity}") -def add_item(item_name: str, quantity: int) -> dict[str, ItemPayload]: - if quantity <= 0: - raise HTTPException(status_code=400, detail="Quantity must be greater than 0.") - - # Check if item already exists - item_id_str: str | None = redis_client.hget("item_name_to_id", item_name) - - if item_id_str is not None: - item_id = int(item_id_str) - quantity = redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity) - else: - # Generate an id for the item - item_id: int = redis_client.incr("item_ids") - redis_client.hset( - f"item_id:{item_id}", - mapping={ - "item_id": item_id, - "item_name": item_name, - "quantity": quantity, - }, - ) - # Create a set so we can search by name too - redis_client.hset("item_name_to_id", item_name, item_id) - - return { - "item": ItemPayload(item_id=item_id, item_name=item_name, quantity=quantity) - } - - -# Route to list a specific item by id but using Redis -@app.get("/items/{item_id}") -def list_item(item_id: int) -> dict[str, dict[str, str]]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - return {"item": redis_client.hgetall(f"item_id:{item_id}")} - - -@app.get("/items") -def list_items() -> dict[str, list[ItemPayload]]: - items: list[ItemPayload] = [] - stored_items: dict[str, str] = redis_client.hgetall("item_name_to_id") - - for name, id_str in stored_items.items(): - item_id: int = int(id_str) - - item_name_str: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - if item_name_str is not None: - item_name: str = item_name_str - else: - continue # skip this item if it has no name - - item_quantity_str: str | None = redis_client.hget( - f"item_id:{item_id}", "quantity" - ) - if item_quantity_str is not None: - item_quantity: int = int(item_quantity_str) - else: - item_quantity = 0 - - items.append( - ItemPayload(item_id=item_id, item_name=item_name, quantity=item_quantity) - ) - - return {"items": items} - - -# Route to delete a specific item by id but using Redis -@app.delete("/items/{item_id}") -def delete_item(item_id: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - - -# Route to remove some quantity of a specific item by id but using Redis -@app.delete("/items/{item_id}/{quantity}") -def remove_quantity(item_id: int, quantity: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - - item_quantity: str | None = redis_client.hget(f"item_id:{item_id}", "quantity") - - # if quantity to be removed is higher or equal to item's quantity, delete the item - if item_quantity is None: - existing_quantity: int = 0 - else: - existing_quantity: int = int(item_quantity) - if existing_quantity <= quantity: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - else: - redis_client.hincrby(f"item_id:{item_id}", "quantity", -quantity) - return {"result": f"{quantity} items removed."} diff --git a/models.py b/models.py deleted file mode 100644 index bba7954..0000000 --- a/models.py +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Optional - -from pydantic import BaseModel - - -class ItemPayload(BaseModel): - item_id: Optional[int] - item_name: str - quantity: int diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6ea752e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -annotated-types==0.6.0 -anyio==3.7.1 -cffi==1.16.0 -click==8.1.7 -cryptography==41.0.4 -fastapi==0.104.0 -h11==0.14.0 -idna==3.4 -pycparser==2.21 -pydantic==2.4.2 -pydantic-core==2.10.1 -redis==5.0.1 -sniffio==1.3.0 -starlette==0.27.0 -types-pyopenssl==23.3.0.0 -types-redis==4.6.0.7 -typing-extensions==4.8.0 -uvicorn==0.23.2 From 97dc6a9eeecdcb95241a368eb8c2ce284ddcd8b7 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 15 May 2024 05:19:08 +0300 Subject: [PATCH 07/70] squash! --- .github/workflows/GitHub.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml index 0be30ba..5e814e3 100644 --- a/.github/workflows/GitHub.yml +++ b/.github/workflows/GitHub.yml @@ -50,7 +50,7 @@ jobs: TELEMETRY_DISABLED: 1 steps: - - uses: pozil/auto-assign-issue@v1.14.0 + - uses: pozil/auto-assign-issue@v2.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} assignees: NikolaRHristov From e17a5a57d909c07867e1070c5d656a7968e42d52 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 17 May 2024 08:12:23 +0300 Subject: [PATCH 08/70] squash! --- .github/dependabot.yml | 14 -------- .github/workflows/Dependabot.yml | 45 ------------------------- .github/workflows/GitHub.yml | 57 -------------------------------- 3 files changed, 116 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index e6091e5..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 5e814e3..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 From eab6fdc1d3e2f1eb3b8852c8cea5c625c220556b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 20 May 2024 15:28:11 +0300 Subject: [PATCH 09/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 123c37815e77e6b9892f418c730041b25619248d Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 23 May 2024 11:52:26 +0300 Subject: [PATCH 10/70] squash! --- .gitignore | 210 ++++++++++++++++++++++++++--------------------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/.gitignore b/.gitignore index f75400b..c3caf9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,106 +1,106 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + settings.json \ No newline at end of file From 1d290482bc4cf18d08e7072b8b7cb6566adc70db Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 23 May 2024 12:55:27 +0300 Subject: [PATCH 11/70] squash! --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index c3caf9a..bc1d61f 100644 --- a/.gitignore +++ b/.gitignore @@ -82,10 +82,8 @@ celerybeat-schedule *.sage.py # Environments -.env .venv env/ -venv/ ENV/ env.bak/ venv.bak/ From 756b00427a48e5cc1315001b55ca97b2eae5afb5 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 25 May 2024 01:17:02 +0300 Subject: [PATCH 12/70] squash! --- .github/dependabot.yml | 14 ++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++++++++++++++ .github/workflows/GitHub.yml | 57 ++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4242a05 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..e6091e5 --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.1.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..5e814e3 --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,57 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From 5f2c072ff825b6b249f982ac888b8f3146448d7f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 26 May 2024 14:19:38 +0300 Subject: [PATCH 13/70] squash! --- CODE_OF_CONDUCT.md | 10 +- FUNDING.yml | 1 + LICENSE | 42 ++++---- README.md | 136 +++++++++++++++--------- SECURITY.md | 51 ++++++--- SUPPORT.md | 57 +++++----- main.py | 252 ++++++++++++++++++++++----------------------- models.py | 18 ++-- requirements.txt | 36 +++---- 9 files changed, 337 insertions(+), 266 deletions(-) create mode 100644 FUNDING.yml diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f9ba8cf..bb1fb9a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,9 +1,11 @@ # Microsoft Open Source Code of Conduct -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Resources: -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with + questions or concerns diff --git a/FUNDING.yml b/FUNDING.yml new file mode 100644 index 0000000..12f5195 --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1 @@ +open_collective: code-editor-land diff --git a/LICENSE b/LICENSE index 62f454e..115963d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 7c991dd..4fdcd81 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,88 @@ -# Python/FastAPI Tutorial for Visual Studio Code -This sample contains the completed program from the tutorial: [FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). Immediate steps are not included. - -## Run the app using GitHub Codespaces -[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments that work how and where you want it to. To learn how to set up a GitHub Codespace for this repository, check the [documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to start the debugger and run the application. - -Once it's ready, you will see a notification with a button `Open in the Browser`. Clicking the button will open your application on the browser. You can then add `/docs` to the end of the URL to access the Swagger UI and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your operating system. To get started, first clone this project on your machine and then open it in VS Code (**File** > **Open Folder...**). - -### Windows -To run this app locally in VS Code on Windows, you can use either [WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers -1. Make sure you have [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL -1. Make sure you have [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing -Contributions to the sample are welcome! When submitting changes, also consider submitting matching changes to the tutorial, the source file for which is [tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - -## Additional details - -* This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -* For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -* Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +# Python/FastAPI Tutorial for Visual Studio Code + +This sample contains the completed program from the tutorial: +[FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). +Immediate steps are not included. + +## Run the app using GitHub Codespaces + +[GitHub Codespaces](https://github.com/features/codespaces) provides +cloud-powered development environments that work how and where you want it to. +To learn how to set up a GitHub Codespace for this repository, check the +[documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). + +Once you open this repository in GitHub Codespaces, you can press **F5** to +start the debugger and run the application. + +Once it's ready, you will see a notification with a button +`Open in the Browser`. Clicking the button will open your application on the +browser. You can then add `/docs` to the end of the URL to access the Swagger UI +and interact with the application! + +## Run the app locally in VS Code + +There are diffent ways you can run this app locally in VS Code depending on your +operating system. To get started, first clone this project on your machine and +then open it in VS Code (**File** > **Open Folder...**). + +### Windows + +To run this app locally in VS Code on Windows, you can use either +[WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for +Linux) or [Docker](https://www.docker.com/products/docker-desktop). + +#### Docker Containers + +1. Make sure you have + [Docker installed](https://www.docker.com/products/docker-desktop) +1. Install the + [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "Dev Container: Reopen in Container" command. +1. Press **F5** to debug your application! + +#### WSL + +1. Make sure you have + [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) +1. Install the + [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) + for VS Code +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "WSL: Reopen Folder in WSL" command +1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. + +### macOS / Linux + +1. Install the + [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) + for VS Code +1. Run the "Python: Create Environment" command in the Command Palette +1. Select `Venv`, the latest available version of Python and then the + `requirements.txt` file to install the dependencies. +1. Press **F5** to run your application! + +## Contributing + +Contributions to the sample are welcome! When submitting changes, also consider +submitting matching changes to the tutorial, the source file for which is +[tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). + +Most contributions require you to agree to a Contributor License Agreement (CLA) +declaring that you have the right to, and actually do, grant us the rights to +use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot automatically determines whether you +need to provide a CLA and decorate the PR appropriately (e.g., label, comment). +Simply follow the instructions provided by the bot. You will only need to do +this once across all repos using our CLA. + +## Additional details + +- This project has adopted the + [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +- For more information see the + [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) + or +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any + additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md index b3c89ef..27d107b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,33 +2,53 @@ ## Security -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). +Microsoft takes the security of our software products and services seriously, +which includes all source code repositories managed through our GitHub +organizations, which include [Microsoft](https://github.com/Microsoft), +[Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), +[AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. +If you believe you have found a security vulnerability in any Microsoft-owned +repository that meets +[Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), +please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). +Instead, please report them to the Microsoft Security Response Center (MSRC) at +[https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). +If you prefer to submit without logging in, send email to +[secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your +message with our PGP key; please download it from the +[Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). +You should receive a response within 24 hours. If for some reason you do not, +please follow up via email to ensure we received your original message. +Additional information can be found at +[microsoft.com/msrc](https://www.microsoft.com/msrc). -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: +Please include the requested information listed below (as much as you can +provide) to help us better understand the nature and scope of the possible +issue: - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue +- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, + etc.) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code (if possible) +- Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. +If you are reporting for a bug bounty, more complete reports can contribute to a +higher bounty award. Please visit our +[Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for +more details about our active programs. ## Preferred Languages @@ -36,6 +56,7 @@ We prefer all communications to be in English. ## Policy -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). +Microsoft follows the principle of +[Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). diff --git a/SUPPORT.md b/SUPPORT.md index 291d4d4..4b5b614 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,25 +1,32 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? - -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. - -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this +product/project? + +- **No CSS support:** Fill out this template with information about how to + file issues and get help. +- **Yes CSS support:** Fill out an intake form at + [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work + with/help you to determine next steps. +- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will + help you decide. + +_Then remove this first heading from this SUPPORT.MD file before publishing your +repo._ + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please +search the existing issues before filing new issues to avoid duplicates. For new +issues, file your bug or feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: +INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. +COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed +above. diff --git a/main.py b/main.py index 1ad8072..3da3ace 100644 --- a/main.py +++ b/main.py @@ -1,126 +1,126 @@ -import os - -import redis -from fastapi import FastAPI, HTTPException, Request - -from models import ItemPayload - -app = FastAPI() - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) - - -@app.get("/") -def home(request: Request) -> dict[str, str]: - url: str = ( - f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}/" - if os.getenv("CODESPACE_NAME") - else str(request.base_url) - ) - return { - "message": f"Navigate to the following URL to access the Swagger UI: {url}docs" - } - - -# Route to add an item -@app.post("/items/{item_name}/{quantity}") -def add_item(item_name: str, quantity: int) -> dict[str, ItemPayload]: - if quantity <= 0: - raise HTTPException(status_code=400, detail="Quantity must be greater than 0.") - - # Check if item already exists - item_id_str: str | None = redis_client.hget("item_name_to_id", item_name) - - if item_id_str is not None: - item_id = int(item_id_str) - quantity = redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity) - else: - # Generate an id for the item - item_id: int = redis_client.incr("item_ids") - redis_client.hset( - f"item_id:{item_id}", - mapping={ - "item_id": item_id, - "item_name": item_name, - "quantity": quantity, - }, - ) - # Create a set so we can search by name too - redis_client.hset("item_name_to_id", item_name, item_id) - - return { - "item": ItemPayload(item_id=item_id, item_name=item_name, quantity=quantity) - } - - -# Route to list a specific item by id but using Redis -@app.get("/items/{item_id}") -def list_item(item_id: int) -> dict[str, dict[str, str]]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - return {"item": redis_client.hgetall(f"item_id:{item_id}")} - - -@app.get("/items") -def list_items() -> dict[str, list[ItemPayload]]: - items: list[ItemPayload] = [] - stored_items: dict[str, str] = redis_client.hgetall("item_name_to_id") - - for name, id_str in stored_items.items(): - item_id: int = int(id_str) - - item_name_str: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - if item_name_str is not None: - item_name: str = item_name_str - else: - continue # skip this item if it has no name - - item_quantity_str: str | None = redis_client.hget( - f"item_id:{item_id}", "quantity" - ) - if item_quantity_str is not None: - item_quantity: int = int(item_quantity_str) - else: - item_quantity = 0 - - items.append( - ItemPayload(item_id=item_id, item_name=item_name, quantity=item_quantity) - ) - - return {"items": items} - - -# Route to delete a specific item by id but using Redis -@app.delete("/items/{item_id}") -def delete_item(item_id: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - - -# Route to remove some quantity of a specific item by id but using Redis -@app.delete("/items/{item_id}/{quantity}") -def remove_quantity(item_id: int, quantity: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - - item_quantity: str | None = redis_client.hget(f"item_id:{item_id}", "quantity") - - # if quantity to be removed is higher or equal to item's quantity, delete the item - if item_quantity is None: - existing_quantity: int = 0 - else: - existing_quantity: int = int(item_quantity) - if existing_quantity <= quantity: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - else: - redis_client.hincrby(f"item_id:{item_id}", "quantity", -quantity) - return {"result": f"{quantity} items removed."} +import os + +import redis +from fastapi import FastAPI, HTTPException, Request + +from models import ItemPayload + +app = FastAPI() + +redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) + + +@app.get("/") +def home(request: Request) -> dict[str, str]: + url: str = ( + f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}/" + if os.getenv("CODESPACE_NAME") + else str(request.base_url) + ) + return { + "message": f"Navigate to the following URL to access the Swagger UI: {url}docs" + } + + +# Route to add an item +@app.post("/items/{item_name}/{quantity}") +def add_item(item_name: str, quantity: int) -> dict[str, ItemPayload]: + if quantity <= 0: + raise HTTPException(status_code=400, detail="Quantity must be greater than 0.") + + # Check if item already exists + item_id_str: str | None = redis_client.hget("item_name_to_id", item_name) + + if item_id_str is not None: + item_id = int(item_id_str) + quantity = redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity) + else: + # Generate an id for the item + item_id: int = redis_client.incr("item_ids") + redis_client.hset( + f"item_id:{item_id}", + mapping={ + "item_id": item_id, + "item_name": item_name, + "quantity": quantity, + }, + ) + # Create a set so we can search by name too + redis_client.hset("item_name_to_id", item_name, item_id) + + return { + "item": ItemPayload(item_id=item_id, item_name=item_name, quantity=quantity) + } + + +# Route to list a specific item by id but using Redis +@app.get("/items/{item_id}") +def list_item(item_id: int) -> dict[str, dict[str, str]]: + if not redis_client.hexists(f"item_id:{item_id}", "item_id"): + raise HTTPException(status_code=404, detail="Item not found.") + else: + return {"item": redis_client.hgetall(f"item_id:{item_id}")} + + +@app.get("/items") +def list_items() -> dict[str, list[ItemPayload]]: + items: list[ItemPayload] = [] + stored_items: dict[str, str] = redis_client.hgetall("item_name_to_id") + + for name, id_str in stored_items.items(): + item_id: int = int(id_str) + + item_name_str: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") + if item_name_str is not None: + item_name: str = item_name_str + else: + continue # skip this item if it has no name + + item_quantity_str: str | None = redis_client.hget( + f"item_id:{item_id}", "quantity" + ) + if item_quantity_str is not None: + item_quantity: int = int(item_quantity_str) + else: + item_quantity = 0 + + items.append( + ItemPayload(item_id=item_id, item_name=item_name, quantity=item_quantity) + ) + + return {"items": items} + + +# Route to delete a specific item by id but using Redis +@app.delete("/items/{item_id}") +def delete_item(item_id: int) -> dict[str, str]: + if not redis_client.hexists(f"item_id:{item_id}", "item_id"): + raise HTTPException(status_code=404, detail="Item not found.") + else: + item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") + redis_client.hdel("item_name_to_id", f"{item_name}") + redis_client.delete(f"item_id:{item_id}") + return {"result": "Item deleted."} + + +# Route to remove some quantity of a specific item by id but using Redis +@app.delete("/items/{item_id}/{quantity}") +def remove_quantity(item_id: int, quantity: int) -> dict[str, str]: + if not redis_client.hexists(f"item_id:{item_id}", "item_id"): + raise HTTPException(status_code=404, detail="Item not found.") + + item_quantity: str | None = redis_client.hget(f"item_id:{item_id}", "quantity") + + # if quantity to be removed is higher or equal to item's quantity, delete the item + if item_quantity is None: + existing_quantity: int = 0 + else: + existing_quantity: int = int(item_quantity) + if existing_quantity <= quantity: + item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") + redis_client.hdel("item_name_to_id", f"{item_name}") + redis_client.delete(f"item_id:{item_id}") + return {"result": "Item deleted."} + else: + redis_client.hincrby(f"item_id:{item_id}", "quantity", -quantity) + return {"result": f"{quantity} items removed."} diff --git a/models.py b/models.py index bba7954..6d6a40c 100644 --- a/models.py +++ b/models.py @@ -1,9 +1,9 @@ -from typing import Optional - -from pydantic import BaseModel - - -class ItemPayload(BaseModel): - item_id: Optional[int] - item_name: str - quantity: int +from typing import Optional + +from pydantic import BaseModel + + +class ItemPayload(BaseModel): + item_id: Optional[int] + item_name: str + quantity: int diff --git a/requirements.txt b/requirements.txt index 6ea752e..7631c08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,18 @@ -annotated-types==0.6.0 -anyio==3.7.1 -cffi==1.16.0 -click==8.1.7 -cryptography==41.0.4 -fastapi==0.104.0 -h11==0.14.0 -idna==3.4 -pycparser==2.21 -pydantic==2.4.2 -pydantic-core==2.10.1 -redis==5.0.1 -sniffio==1.3.0 -starlette==0.27.0 -types-pyopenssl==23.3.0.0 -types-redis==4.6.0.7 -typing-extensions==4.8.0 -uvicorn==0.23.2 +annotated-types==0.6.0 +anyio==3.7.1 +cffi==1.16.0 +click==8.1.7 +cryptography==41.0.4 +fastapi==0.104.0 +h11==0.14.0 +idna==3.4 +pycparser==2.21 +pydantic==2.4.2 +pydantic-core==2.10.1 +redis==5.0.1 +sniffio==1.3.0 +starlette==0.27.0 +types-pyopenssl==23.3.0.0 +types-redis==4.6.0.7 +typing-extensions==4.8.0 +uvicorn==0.23.2 From 1f4293d7715aae123fdbccb53a4f3490259c8ad7 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 26 May 2024 22:17:45 +0300 Subject: [PATCH 14/70] squash! --- FUNDING.yml => .github/FUNDING.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename FUNDING.yml => .github/FUNDING.yml (100%) diff --git a/FUNDING.yml b/.github/FUNDING.yml similarity index 100% rename from FUNDING.yml rename to .github/FUNDING.yml From ed8a97f59ff9ccf8f64b48a4dd3edb0e6bd0a15f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 27 May 2024 17:01:30 +0300 Subject: [PATCH 15/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From e5604b314e82d2513250ef97c3c9f8a12c7f6d0a Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 6 Jun 2024 01:33:17 +0300 Subject: [PATCH 16/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 62d5ce87937ee048fb1d918a12b90777cab4dfde Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 8 Jun 2024 07:34:40 +0300 Subject: [PATCH 17/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 4c5aaf788bc841e2c66e7548dd43c74e6db813b8 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 9 Jun 2024 19:19:11 +0300 Subject: [PATCH 18/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 36fd6e1ea657df3df12a45d2b1810900d4319088 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 12 Jun 2024 22:04:57 +0300 Subject: [PATCH 19/70] squash! --- .github/dependabot.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ee3d10a..4242a05 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,14 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase From da31244225d7b4f474bb01c8f675638486af441b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 13 Jun 2024 18:30:04 +0300 Subject: [PATCH 20/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From eff53cf2a7eca0698373d8c873fa44a4311f2e73 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 16 Jun 2024 16:43:33 +0300 Subject: [PATCH 21/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From a6a46dc08ebc907366eeb6c28dcb180a138618bb Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 17 Jun 2024 17:52:37 +0300 Subject: [PATCH 22/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From c3294c146b15f41901b368163c151317da3b2034 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 19 Jun 2024 21:57:37 +0300 Subject: [PATCH 23/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From f511b7f2e5aaa949dd31c692fcbad6e998d98f80 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 27 Jun 2024 10:56:42 +0300 Subject: [PATCH 24/70] squash! --- .github/dependabot.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ee3d10a..4242a05 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,14 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase From ff7c02355a4ef7602f3b2a5874b2fcc71e7df9f4 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 8 Jul 2024 16:15:41 +0300 Subject: [PATCH 25/70] squash! --- CODE_OF_CONDUCT.md | 149 +++++++++++++++++++++++++++++++++++++++++++-- LICENSE | 41 ++++++------- 2 files changed, 163 insertions(+), 27 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f9ba8cf..d35c668 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,9 +1,146 @@ -# Microsoft Open Source Code of Conduct +# Code of Conduct -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +## Our Pledge -Resources: +Welcome to our community! We are committed to creating a welcoming and inclusive +environment for all contributors. As members, contributors, and leaders, we +pledge to make participation in our community a harassment-free experience for +everyone, regardless of: -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +- Age +- Body size +- Visible or invisible disability +- Ethnicity +- Sex characteristics +- Gender identity and expression +- Level of experience +- Education +- Socio-economic status +- Nationality +- Personal appearance +- Race +- Caste +- Color +- Religion +- Sexual identity and orientation + +We promise to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals but for the overall + community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or advances + of any kind +- Trolling, insulting, or derogatory comments, and personal or political + attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, + without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior. They will take appropriate and fair corrective action in +response to any behavior they deem inappropriate, threatening, offensive, or +harmful. This may include removing, editing, or rejecting comments, commits, +code, wiki edits, issues, and other contributions that do not align with this +Code of Conduct. Community leaders will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +Community@PlayForm.Cloud. All complaints will be reviewed and investigated +promptly and fairly. All community leaders are obligated to respect the privacy +and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + +Thank you for being part of our community and helping us create a safe and +respectful environment for everyone! diff --git a/LICENSE b/LICENSE index 62f454e..f236d76 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,20 @@ -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2023-2024 PlayForm + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 60ea69ca7c4a53a7132a76fbbbb6e0cbac25c2e1 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 9 Jul 2024 22:09:15 +0300 Subject: [PATCH 26/70] squash! --- .github/workflows/Dependabot.yml | 4 ++-- .github/workflows/GitHub.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml index e6091e5..387fece 100644 --- a/.github/workflows/Dependabot.yml +++ b/.github/workflows/Dependabot.yml @@ -20,7 +20,7 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - - uses: dependabot/fetch-metadata@v2.1.0 + - uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" @@ -35,7 +35,7 @@ jobs: if: ${{ github.actor == 'dependabot[bot]' }} steps: - - uses: dependabot/fetch-metadata@v2.1.0 + - uses: dependabot/fetch-metadata@v2.2.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml index 5e814e3..7b1e399 100644 --- a/.github/workflows/GitHub.yml +++ b/.github/workflows/GitHub.yml @@ -48,6 +48,7 @@ jobs: STNOUPGRADE: 1 STRIPE_CLI_TELEMETRY_OPTOUT: 1 TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 steps: - uses: pozil/auto-assign-issue@v2.0.0 From 2f77302dc20351aaaa76a623350e055dc634ef0a Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 12 Jul 2024 02:08:17 +0300 Subject: [PATCH 27/70] squash! --- .github/FUNDING.yml | 1 - .github/dependabot.yml | 14 --- .github/workflows/Dependabot.yml | 45 -------- .github/workflows/GitHub.yml | 58 ---------- .github/workflows/test-application.yml | 33 ------ .gitignore | 106 ------------------ CODE_OF_CONDUCT.md | 146 ------------------------- LICENSE | 20 ---- README.md | 48 -------- SECURITY.md | 41 ------- SUPPORT.md | 25 ----- flushdb.py | 9 -- main.py | 126 --------------------- models.py | 9 -- requirements.txt | 18 --- 15 files changed, 699 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .gitignore delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 SECURITY.md delete mode 100644 SUPPORT.md delete mode 100644 flushdb.py delete mode 100644 main.py delete mode 100644 models.py delete mode 100644 requirements.txt diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 12f5195..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -open_collective: code-editor-land diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 7b1e399..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f75400b..0000000 --- a/.gitignore +++ /dev/null @@ -1,106 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -settings.json \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index d35c668..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,146 +0,0 @@ -# Code of Conduct - -## Our Pledge - -Welcome to our community! We are committed to creating a welcoming and inclusive -environment for all contributors. As members, contributors, and leaders, we -pledge to make participation in our community a harassment-free experience for -everyone, regardless of: - -- Age -- Body size -- Visible or invisible disability -- Ethnicity -- Sex characteristics -- Gender identity and expression -- Level of experience -- Education -- Socio-economic status -- Nationality -- Personal appearance -- Race -- Caste -- Color -- Religion -- Sexual identity and orientation - -We promise to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals but for the overall - community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or advances - of any kind -- Trolling, insulting, or derogatory comments, and personal or political - attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, - without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior. They will take appropriate and fair corrective action in -response to any behavior they deem inappropriate, threatening, offensive, or -harmful. This may include removing, editing, or rejecting comments, commits, -code, wiki edits, issues, and other contributions that do not align with this -Code of Conduct. Community leaders will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -Community@PlayForm.Cloud. All complaints will be reviewed and investigated -promptly and fairly. All community leaders are obligated to respect the privacy -and security of the reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations - -Thank you for being part of our community and helping us create a safe and -respectful environment for everyone! diff --git a/LICENSE b/LICENSE deleted file mode 100644 index f236d76..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -MIT License - -Copyright (c) 2023-2024 PlayForm - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 7c991dd..0000000 --- a/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Python/FastAPI Tutorial for Visual Studio Code -This sample contains the completed program from the tutorial: [FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). Immediate steps are not included. - -## Run the app using GitHub Codespaces -[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments that work how and where you want it to. To learn how to set up a GitHub Codespace for this repository, check the [documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to start the debugger and run the application. - -Once it's ready, you will see a notification with a button `Open in the Browser`. Clicking the button will open your application on the browser. You can then add `/docs` to the end of the URL to access the Swagger UI and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your operating system. To get started, first clone this project on your machine and then open it in VS Code (**File** > **Open Folder...**). - -### Windows -To run this app locally in VS Code on Windows, you can use either [WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers -1. Make sure you have [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL -1. Make sure you have [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing -Contributions to the sample are welcome! When submitting changes, also consider submitting matching changes to the tutorial, the source file for which is [tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - -## Additional details - -* This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -* For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -* Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index b3c89ef..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). - - diff --git a/SUPPORT.md b/SUPPORT.md deleted file mode 100644 index 291d4d4..0000000 --- a/SUPPORT.md +++ /dev/null @@ -1,25 +0,0 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? - -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. - -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. diff --git a/flushdb.py b/flushdb.py deleted file mode 100644 index 65442ad..0000000 --- a/flushdb.py +++ /dev/null @@ -1,9 +0,0 @@ -""" -This module is used to interact with a Redis database. - -WARNING: This script will flush the entire Redis database. Use with caution. -""" -import redis - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) -redis_client.flushdb() diff --git a/main.py b/main.py deleted file mode 100644 index 1ad8072..0000000 --- a/main.py +++ /dev/null @@ -1,126 +0,0 @@ -import os - -import redis -from fastapi import FastAPI, HTTPException, Request - -from models import ItemPayload - -app = FastAPI() - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) - - -@app.get("/") -def home(request: Request) -> dict[str, str]: - url: str = ( - f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}/" - if os.getenv("CODESPACE_NAME") - else str(request.base_url) - ) - return { - "message": f"Navigate to the following URL to access the Swagger UI: {url}docs" - } - - -# Route to add an item -@app.post("/items/{item_name}/{quantity}") -def add_item(item_name: str, quantity: int) -> dict[str, ItemPayload]: - if quantity <= 0: - raise HTTPException(status_code=400, detail="Quantity must be greater than 0.") - - # Check if item already exists - item_id_str: str | None = redis_client.hget("item_name_to_id", item_name) - - if item_id_str is not None: - item_id = int(item_id_str) - quantity = redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity) - else: - # Generate an id for the item - item_id: int = redis_client.incr("item_ids") - redis_client.hset( - f"item_id:{item_id}", - mapping={ - "item_id": item_id, - "item_name": item_name, - "quantity": quantity, - }, - ) - # Create a set so we can search by name too - redis_client.hset("item_name_to_id", item_name, item_id) - - return { - "item": ItemPayload(item_id=item_id, item_name=item_name, quantity=quantity) - } - - -# Route to list a specific item by id but using Redis -@app.get("/items/{item_id}") -def list_item(item_id: int) -> dict[str, dict[str, str]]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - return {"item": redis_client.hgetall(f"item_id:{item_id}")} - - -@app.get("/items") -def list_items() -> dict[str, list[ItemPayload]]: - items: list[ItemPayload] = [] - stored_items: dict[str, str] = redis_client.hgetall("item_name_to_id") - - for name, id_str in stored_items.items(): - item_id: int = int(id_str) - - item_name_str: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - if item_name_str is not None: - item_name: str = item_name_str - else: - continue # skip this item if it has no name - - item_quantity_str: str | None = redis_client.hget( - f"item_id:{item_id}", "quantity" - ) - if item_quantity_str is not None: - item_quantity: int = int(item_quantity_str) - else: - item_quantity = 0 - - items.append( - ItemPayload(item_id=item_id, item_name=item_name, quantity=item_quantity) - ) - - return {"items": items} - - -# Route to delete a specific item by id but using Redis -@app.delete("/items/{item_id}") -def delete_item(item_id: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - - -# Route to remove some quantity of a specific item by id but using Redis -@app.delete("/items/{item_id}/{quantity}") -def remove_quantity(item_id: int, quantity: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - - item_quantity: str | None = redis_client.hget(f"item_id:{item_id}", "quantity") - - # if quantity to be removed is higher or equal to item's quantity, delete the item - if item_quantity is None: - existing_quantity: int = 0 - else: - existing_quantity: int = int(item_quantity) - if existing_quantity <= quantity: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - else: - redis_client.hincrby(f"item_id:{item_id}", "quantity", -quantity) - return {"result": f"{quantity} items removed."} diff --git a/models.py b/models.py deleted file mode 100644 index bba7954..0000000 --- a/models.py +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Optional - -from pydantic import BaseModel - - -class ItemPayload(BaseModel): - item_id: Optional[int] - item_name: str - quantity: int diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6ea752e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -annotated-types==0.6.0 -anyio==3.7.1 -cffi==1.16.0 -click==8.1.7 -cryptography==41.0.4 -fastapi==0.104.0 -h11==0.14.0 -idna==3.4 -pycparser==2.21 -pydantic==2.4.2 -pydantic-core==2.10.1 -redis==5.0.1 -sniffio==1.3.0 -starlette==0.27.0 -types-pyopenssl==23.3.0.0 -types-redis==4.6.0.7 -typing-extensions==4.8.0 -uvicorn==0.23.2 From ff4d4032f6b8f54ec5d7a799c04526669640ae48 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 13 Jul 2024 03:25:41 +0300 Subject: [PATCH 28/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 11d2ec01b1507251ee9e3ee1351ff8f7c70222b4 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 14 Jul 2024 03:14:31 +0300 Subject: [PATCH 29/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From f0b9d608798c0ad89552ece8ef5b168a713b4957 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 14 Jul 2024 16:38:31 +0300 Subject: [PATCH 30/70] squash! --- .devcontainer/devcontainer.json | 31 ------------------------------- .vscode/launch.json | 19 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 96f30e441c4f06f2b26df32c8e8e4f2ec646103f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 22 Jul 2024 19:02:28 +0300 Subject: [PATCH 31/70] --- .github/dependabot.yml | 20 +++++++---- .github/workflows/Dependabot.yml | 45 +++++++++++++++++++++++++ .github/workflows/GitHub.yml | 58 ++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ee3d10a..4242a05 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,14 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..387fece --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..7b1e399 --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,58 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From 65bcc9380299d5b38f4dc08c8cc1e453bbe24d02 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 23 Jul 2024 11:37:23 +0300 Subject: [PATCH 32/70] --- .github/dependabot.yml | 14 -------- .github/workflows/Dependabot.yml | 45 ------------------------- .github/workflows/GitHub.yml | 58 -------------------------------- 3 files changed, 117 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 7b1e399..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 From 6ce49a09761e7b8fb01767ab6e659afe7094357e Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 25 Jul 2024 14:07:11 +0300 Subject: [PATCH 33/70] --- .github/workflows/test-application.yml | 33 -------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .github/workflows/test-application.yml diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - From 562b6c85d2e86c34119a8b8f71918635c503b5a0 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 28 Jul 2024 00:51:36 +0300 Subject: [PATCH 34/70] --- CODE_OF_CONDUCT.md | 10 +++--- README.md | 82 ++++++++++++++++++++++++++++++++++------------ SECURITY.md | 51 +++++++++++++++++++--------- SUPPORT.md | 35 ++++++++++++-------- flushdb.py | 1 + 5 files changed, 125 insertions(+), 54 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f9ba8cf..bb1fb9a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,9 +1,11 @@ # Microsoft Open Source Code of Conduct -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Resources: -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with + questions or concerns diff --git a/README.md b/README.md index 7c991dd..11ca4bf 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,88 @@ # Python/FastAPI Tutorial for Visual Studio Code -This sample contains the completed program from the tutorial: [FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). Immediate steps are not included. + +This sample contains the completed program from the tutorial: +[FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). +Immediate steps are not included. ## Run the app using GitHub Codespaces -[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments that work how and where you want it to. To learn how to set up a GitHub Codespace for this repository, check the [documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). -Once you open this repository in GitHub Codespaces, you can press **F5** to start the debugger and run the application. +[GitHub Codespaces](https://github.com/features/codespaces) provides +cloud-powered development environments that work how and where you want it to. +To learn how to set up a GitHub Codespace for this repository, check the +[documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). + +Once you open this repository in GitHub Codespaces, you can press **F5** to +start the debugger and run the application. -Once it's ready, you will see a notification with a button `Open in the Browser`. Clicking the button will open your application on the browser. You can then add `/docs` to the end of the URL to access the Swagger UI and interact with the application! +Once it's ready, you will see a notification with a button +`Open in the Browser`. Clicking the button will open your application on the +browser. You can then add `/docs` to the end of the URL to access the Swagger UI +and interact with the application! ## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your operating system. To get started, first clone this project on your machine and then open it in VS Code (**File** > **Open Folder...**). + +There are diffent ways you can run this app locally in VS Code depending on your +operating system. To get started, first clone this project on your machine and +then open it in VS Code (**File** > **Open Folder...**). ### Windows -To run this app locally in VS Code on Windows, you can use either [WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for Linux) or [Docker](https://www.docker.com/products/docker-desktop). + +To run this app locally in VS Code on Windows, you can use either +[WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for +Linux) or [Docker](https://www.docker.com/products/docker-desktop). #### Docker Containers -1. Make sure you have [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "Dev Container: Reopen in Container" command. + +1. Make sure you have + [Docker installed](https://www.docker.com/products/docker-desktop) +1. Install the + [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "Dev Container: Reopen in Container" command. 1. Press **F5** to debug your application! #### WSL -1. Make sure you have [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "WSL: Reopen Folder in WSL" command + +1. Make sure you have + [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) +1. Install the + [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) + for VS Code +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "WSL: Reopen Folder in WSL" command 1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. ### macOS / Linux -1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code +1. Install the + [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) + for VS Code 1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the `requirements.txt` file to install the dependencies. +1. Select `Venv`, the latest available version of Python and then the + `requirements.txt` file to install the dependencies. 1. Press **F5** to run your application! ## Contributing -Contributions to the sample are welcome! When submitting changes, also consider submitting matching changes to the tutorial, the source file for which is [tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). -Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. +Contributions to the sample are welcome! When submitting changes, also consider +submitting matching changes to the tutorial, the source file for which is +[tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). + +Most contributions require you to agree to a Contributor License Agreement (CLA) +declaring that you have the right to, and actually do, grant us the rights to +use your contribution. For details, visit https://cla.microsoft.com. -When you submit a pull request, a CLA-bot automatically determines whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. +When you submit a pull request, a CLA-bot automatically determines whether you +need to provide a CLA and decorate the PR appropriately (e.g., label, comment). +Simply follow the instructions provided by the bot. You will only need to do +this once across all repos using our CLA. ## Additional details -* This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -* For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -* Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +- This project has adopted the + [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +- For more information see the + [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) + or +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any + additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md index b3c89ef..27d107b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,33 +2,53 @@ ## Security -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). +Microsoft takes the security of our software products and services seriously, +which includes all source code repositories managed through our GitHub +organizations, which include [Microsoft](https://github.com/Microsoft), +[Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), +[AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. +If you believe you have found a security vulnerability in any Microsoft-owned +repository that meets +[Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), +please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). +Instead, please report them to the Microsoft Security Response Center (MSRC) at +[https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). +If you prefer to submit without logging in, send email to +[secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your +message with our PGP key; please download it from the +[Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). +You should receive a response within 24 hours. If for some reason you do not, +please follow up via email to ensure we received your original message. +Additional information can be found at +[microsoft.com/msrc](https://www.microsoft.com/msrc). -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: +Please include the requested information listed below (as much as you can +provide) to help us better understand the nature and scope of the possible +issue: - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue +- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, + etc.) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code (if possible) +- Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. +If you are reporting for a bug bounty, more complete reports can contribute to a +higher bounty award. Please visit our +[Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for +more details about our active programs. ## Preferred Languages @@ -36,6 +56,7 @@ We prefer all communications to be in English. ## Policy -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). +Microsoft follows the principle of +[Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). diff --git a/SUPPORT.md b/SUPPORT.md index 291d4d4..6f3dce3 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,25 +1,32 @@ # TODO: The maintainer of this repo has not yet edited this file -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this +product/project? -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. +- **No CSS support:** Fill out this template with information about how to + file issues and get help. +- **Yes CSS support:** Fill out an intake form at + [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work + with/help you to determine next steps. +- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will + help you decide. -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* +_Then remove this first heading from this SUPPORT.MD file before publishing your +repo._ # Support -## How to file issues and get help +## How to file issues and get help -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. +This project uses GitHub Issues to track bugs and feature requests. Please +search the existing issues before filing new issues to avoid duplicates. For new +issues, file your bug or feature request as a new Issue. -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. +For help and questions about using this project, please **REPO MAINTAINER: +INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. +COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**. -## Microsoft Support Policy +## Microsoft Support Policy -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. +Support for this **PROJECT or PRODUCT** is limited to the resources listed +above. diff --git a/flushdb.py b/flushdb.py index 65442ad..dd1da37 100644 --- a/flushdb.py +++ b/flushdb.py @@ -3,6 +3,7 @@ WARNING: This script will flush the entire Redis database. Use with caution. """ + import redis redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) From afc8e0393807d8d4f8e6eb4f00e3475945e1f77b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 28 Jul 2024 14:09:30 +0300 Subject: [PATCH 35/70] --- LICENSE | 42 ++++---- README.md | 176 ++++++++++++++++----------------- SUPPORT.md | 64 ++++++------ main.py | 252 +++++++++++++++++++++++------------------------ models.py | 18 ++-- requirements.txt | 36 +++---- 6 files changed, 294 insertions(+), 294 deletions(-) diff --git a/LICENSE b/LICENSE index 62f454e..115963d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 11ca4bf..4fdcd81 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,88 @@ -# Python/FastAPI Tutorial for Visual Studio Code - -This sample contains the completed program from the tutorial: -[FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). -Immediate steps are not included. - -## Run the app using GitHub Codespaces - -[GitHub Codespaces](https://github.com/features/codespaces) provides -cloud-powered development environments that work how and where you want it to. -To learn how to set up a GitHub Codespace for this repository, check the -[documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to -start the debugger and run the application. - -Once it's ready, you will see a notification with a button -`Open in the Browser`. Clicking the button will open your application on the -browser. You can then add `/docs` to the end of the URL to access the Swagger UI -and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your -operating system. To get started, first clone this project on your machine and -then open it in VS Code (**File** > **Open Folder...**). - -### Windows - -To run this app locally in VS Code on Windows, you can use either -[WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for -Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers - -1. Make sure you have - [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the - [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and - run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL - -1. Make sure you have - [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the - [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) - for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and - run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the - [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the - `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing - -Contributions to the sample are welcome! When submitting changes, also consider -submitting matching changes to the tutorial, the source file for which is -[tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) -declaring that you have the right to, and actually do, grant us the rights to -use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you -need to provide a CLA and decorate the PR appropriately (e.g., label, comment). -Simply follow the instructions provided by the bot. You will only need to do -this once across all repos using our CLA. - -## Additional details - -- This project has adopted the - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -- For more information see the - [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) - or -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any - additional questions or comments. +# Python/FastAPI Tutorial for Visual Studio Code + +This sample contains the completed program from the tutorial: +[FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). +Immediate steps are not included. + +## Run the app using GitHub Codespaces + +[GitHub Codespaces](https://github.com/features/codespaces) provides +cloud-powered development environments that work how and where you want it to. +To learn how to set up a GitHub Codespace for this repository, check the +[documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). + +Once you open this repository in GitHub Codespaces, you can press **F5** to +start the debugger and run the application. + +Once it's ready, you will see a notification with a button +`Open in the Browser`. Clicking the button will open your application on the +browser. You can then add `/docs` to the end of the URL to access the Swagger UI +and interact with the application! + +## Run the app locally in VS Code + +There are diffent ways you can run this app locally in VS Code depending on your +operating system. To get started, first clone this project on your machine and +then open it in VS Code (**File** > **Open Folder...**). + +### Windows + +To run this app locally in VS Code on Windows, you can use either +[WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for +Linux) or [Docker](https://www.docker.com/products/docker-desktop). + +#### Docker Containers + +1. Make sure you have + [Docker installed](https://www.docker.com/products/docker-desktop) +1. Install the + [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "Dev Container: Reopen in Container" command. +1. Press **F5** to debug your application! + +#### WSL + +1. Make sure you have + [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) +1. Install the + [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) + for VS Code +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "WSL: Reopen Folder in WSL" command +1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. + +### macOS / Linux + +1. Install the + [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) + for VS Code +1. Run the "Python: Create Environment" command in the Command Palette +1. Select `Venv`, the latest available version of Python and then the + `requirements.txt` file to install the dependencies. +1. Press **F5** to run your application! + +## Contributing + +Contributions to the sample are welcome! When submitting changes, also consider +submitting matching changes to the tutorial, the source file for which is +[tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). + +Most contributions require you to agree to a Contributor License Agreement (CLA) +declaring that you have the right to, and actually do, grant us the rights to +use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot automatically determines whether you +need to provide a CLA and decorate the PR appropriately (e.g., label, comment). +Simply follow the instructions provided by the bot. You will only need to do +this once across all repos using our CLA. + +## Additional details + +- This project has adopted the + [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +- For more information see the + [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) + or +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any + additional questions or comments. diff --git a/SUPPORT.md b/SUPPORT.md index 6f3dce3..4b5b614 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,32 +1,32 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this -product/project? - -- **No CSS support:** Fill out this template with information about how to - file issues and get help. -- **Yes CSS support:** Fill out an intake form at - [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work - with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will - help you decide. - -_Then remove this first heading from this SUPPORT.MD file before publishing your -repo._ - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please -search the existing issues before filing new issues to avoid duplicates. For new -issues, file your bug or feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: -INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. -COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed -above. +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this +product/project? + +- **No CSS support:** Fill out this template with information about how to + file issues and get help. +- **Yes CSS support:** Fill out an intake form at + [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work + with/help you to determine next steps. +- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will + help you decide. + +_Then remove this first heading from this SUPPORT.MD file before publishing your +repo._ + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please +search the existing issues before filing new issues to avoid duplicates. For new +issues, file your bug or feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: +INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. +COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed +above. diff --git a/main.py b/main.py index 1ad8072..3da3ace 100644 --- a/main.py +++ b/main.py @@ -1,126 +1,126 @@ -import os - -import redis -from fastapi import FastAPI, HTTPException, Request - -from models import ItemPayload - -app = FastAPI() - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) - - -@app.get("/") -def home(request: Request) -> dict[str, str]: - url: str = ( - f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}/" - if os.getenv("CODESPACE_NAME") - else str(request.base_url) - ) - return { - "message": f"Navigate to the following URL to access the Swagger UI: {url}docs" - } - - -# Route to add an item -@app.post("/items/{item_name}/{quantity}") -def add_item(item_name: str, quantity: int) -> dict[str, ItemPayload]: - if quantity <= 0: - raise HTTPException(status_code=400, detail="Quantity must be greater than 0.") - - # Check if item already exists - item_id_str: str | None = redis_client.hget("item_name_to_id", item_name) - - if item_id_str is not None: - item_id = int(item_id_str) - quantity = redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity) - else: - # Generate an id for the item - item_id: int = redis_client.incr("item_ids") - redis_client.hset( - f"item_id:{item_id}", - mapping={ - "item_id": item_id, - "item_name": item_name, - "quantity": quantity, - }, - ) - # Create a set so we can search by name too - redis_client.hset("item_name_to_id", item_name, item_id) - - return { - "item": ItemPayload(item_id=item_id, item_name=item_name, quantity=quantity) - } - - -# Route to list a specific item by id but using Redis -@app.get("/items/{item_id}") -def list_item(item_id: int) -> dict[str, dict[str, str]]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - return {"item": redis_client.hgetall(f"item_id:{item_id}")} - - -@app.get("/items") -def list_items() -> dict[str, list[ItemPayload]]: - items: list[ItemPayload] = [] - stored_items: dict[str, str] = redis_client.hgetall("item_name_to_id") - - for name, id_str in stored_items.items(): - item_id: int = int(id_str) - - item_name_str: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - if item_name_str is not None: - item_name: str = item_name_str - else: - continue # skip this item if it has no name - - item_quantity_str: str | None = redis_client.hget( - f"item_id:{item_id}", "quantity" - ) - if item_quantity_str is not None: - item_quantity: int = int(item_quantity_str) - else: - item_quantity = 0 - - items.append( - ItemPayload(item_id=item_id, item_name=item_name, quantity=item_quantity) - ) - - return {"items": items} - - -# Route to delete a specific item by id but using Redis -@app.delete("/items/{item_id}") -def delete_item(item_id: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - - -# Route to remove some quantity of a specific item by id but using Redis -@app.delete("/items/{item_id}/{quantity}") -def remove_quantity(item_id: int, quantity: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - - item_quantity: str | None = redis_client.hget(f"item_id:{item_id}", "quantity") - - # if quantity to be removed is higher or equal to item's quantity, delete the item - if item_quantity is None: - existing_quantity: int = 0 - else: - existing_quantity: int = int(item_quantity) - if existing_quantity <= quantity: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - else: - redis_client.hincrby(f"item_id:{item_id}", "quantity", -quantity) - return {"result": f"{quantity} items removed."} +import os + +import redis +from fastapi import FastAPI, HTTPException, Request + +from models import ItemPayload + +app = FastAPI() + +redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) + + +@app.get("/") +def home(request: Request) -> dict[str, str]: + url: str = ( + f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}/" + if os.getenv("CODESPACE_NAME") + else str(request.base_url) + ) + return { + "message": f"Navigate to the following URL to access the Swagger UI: {url}docs" + } + + +# Route to add an item +@app.post("/items/{item_name}/{quantity}") +def add_item(item_name: str, quantity: int) -> dict[str, ItemPayload]: + if quantity <= 0: + raise HTTPException(status_code=400, detail="Quantity must be greater than 0.") + + # Check if item already exists + item_id_str: str | None = redis_client.hget("item_name_to_id", item_name) + + if item_id_str is not None: + item_id = int(item_id_str) + quantity = redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity) + else: + # Generate an id for the item + item_id: int = redis_client.incr("item_ids") + redis_client.hset( + f"item_id:{item_id}", + mapping={ + "item_id": item_id, + "item_name": item_name, + "quantity": quantity, + }, + ) + # Create a set so we can search by name too + redis_client.hset("item_name_to_id", item_name, item_id) + + return { + "item": ItemPayload(item_id=item_id, item_name=item_name, quantity=quantity) + } + + +# Route to list a specific item by id but using Redis +@app.get("/items/{item_id}") +def list_item(item_id: int) -> dict[str, dict[str, str]]: + if not redis_client.hexists(f"item_id:{item_id}", "item_id"): + raise HTTPException(status_code=404, detail="Item not found.") + else: + return {"item": redis_client.hgetall(f"item_id:{item_id}")} + + +@app.get("/items") +def list_items() -> dict[str, list[ItemPayload]]: + items: list[ItemPayload] = [] + stored_items: dict[str, str] = redis_client.hgetall("item_name_to_id") + + for name, id_str in stored_items.items(): + item_id: int = int(id_str) + + item_name_str: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") + if item_name_str is not None: + item_name: str = item_name_str + else: + continue # skip this item if it has no name + + item_quantity_str: str | None = redis_client.hget( + f"item_id:{item_id}", "quantity" + ) + if item_quantity_str is not None: + item_quantity: int = int(item_quantity_str) + else: + item_quantity = 0 + + items.append( + ItemPayload(item_id=item_id, item_name=item_name, quantity=item_quantity) + ) + + return {"items": items} + + +# Route to delete a specific item by id but using Redis +@app.delete("/items/{item_id}") +def delete_item(item_id: int) -> dict[str, str]: + if not redis_client.hexists(f"item_id:{item_id}", "item_id"): + raise HTTPException(status_code=404, detail="Item not found.") + else: + item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") + redis_client.hdel("item_name_to_id", f"{item_name}") + redis_client.delete(f"item_id:{item_id}") + return {"result": "Item deleted."} + + +# Route to remove some quantity of a specific item by id but using Redis +@app.delete("/items/{item_id}/{quantity}") +def remove_quantity(item_id: int, quantity: int) -> dict[str, str]: + if not redis_client.hexists(f"item_id:{item_id}", "item_id"): + raise HTTPException(status_code=404, detail="Item not found.") + + item_quantity: str | None = redis_client.hget(f"item_id:{item_id}", "quantity") + + # if quantity to be removed is higher or equal to item's quantity, delete the item + if item_quantity is None: + existing_quantity: int = 0 + else: + existing_quantity: int = int(item_quantity) + if existing_quantity <= quantity: + item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") + redis_client.hdel("item_name_to_id", f"{item_name}") + redis_client.delete(f"item_id:{item_id}") + return {"result": "Item deleted."} + else: + redis_client.hincrby(f"item_id:{item_id}", "quantity", -quantity) + return {"result": f"{quantity} items removed."} diff --git a/models.py b/models.py index bba7954..6d6a40c 100644 --- a/models.py +++ b/models.py @@ -1,9 +1,9 @@ -from typing import Optional - -from pydantic import BaseModel - - -class ItemPayload(BaseModel): - item_id: Optional[int] - item_name: str - quantity: int +from typing import Optional + +from pydantic import BaseModel + + +class ItemPayload(BaseModel): + item_id: Optional[int] + item_name: str + quantity: int diff --git a/requirements.txt b/requirements.txt index 6ea752e..7631c08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,18 @@ -annotated-types==0.6.0 -anyio==3.7.1 -cffi==1.16.0 -click==8.1.7 -cryptography==41.0.4 -fastapi==0.104.0 -h11==0.14.0 -idna==3.4 -pycparser==2.21 -pydantic==2.4.2 -pydantic-core==2.10.1 -redis==5.0.1 -sniffio==1.3.0 -starlette==0.27.0 -types-pyopenssl==23.3.0.0 -types-redis==4.6.0.7 -typing-extensions==4.8.0 -uvicorn==0.23.2 +annotated-types==0.6.0 +anyio==3.7.1 +cffi==1.16.0 +click==8.1.7 +cryptography==41.0.4 +fastapi==0.104.0 +h11==0.14.0 +idna==3.4 +pycparser==2.21 +pydantic==2.4.2 +pydantic-core==2.10.1 +redis==5.0.1 +sniffio==1.3.0 +starlette==0.27.0 +types-pyopenssl==23.3.0.0 +types-redis==4.6.0.7 +typing-extensions==4.8.0 +uvicorn==0.23.2 From abdcf681a448a6c77b0ef437998461b0ba42d593 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 22 Aug 2024 03:02:15 +0300 Subject: [PATCH 36/70] --- .github/dependabot.yml | 14 ++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++++++++++++++ .github/workflows/GitHub.yml | 58 ++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4242a05 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..387fece --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..7b1e399 --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,58 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From 69eec4e9668c6a8b36f3c002faa673b643ce58fe Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 24 Aug 2024 10:23:24 +0300 Subject: [PATCH 37/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 3e307f6e0108533fc686ae6f4220baa715a42a87 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 25 Aug 2024 01:51:30 +0300 Subject: [PATCH 38/70] --- .github/dependabot.yml | 14 -------- .github/workflows/Dependabot.yml | 45 ------------------------- .github/workflows/GitHub.yml | 58 -------------------------------- 3 files changed, 117 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 7b1e399..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 From 1e39f230745105cc1c226f2f8314ee2ec4fec538 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 27 Aug 2024 11:22:50 +0300 Subject: [PATCH 39/70] --- .github/dependabot.yml | 14 ++++++++ .github/workflows/Dependabot.yml | 45 +++++++++++++++++++++++++ .github/workflows/GitHub.yml | 58 ++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4242a05 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..387fece --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..7b1e399 --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,58 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From 623637574160eaeede0124e22ffccd28a5697c4b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 28 Aug 2024 09:26:41 +0300 Subject: [PATCH 40/70] --- .github/dependabot.yml | 14 -------- .github/workflows/Dependabot.yml | 45 ------------------------- .github/workflows/GitHub.yml | 58 -------------------------------- 3 files changed, 117 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 7b1e399..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 From f4734575184c927230950886cf5de008db3cad1e Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 30 Aug 2024 09:53:45 +0300 Subject: [PATCH 41/70] --- .gitignore | 106 -------------------------------------- CODE_OF_CONDUCT.md | 11 ---- LICENSE | 21 -------- README.md | 88 ------------------------------- SECURITY.md | 62 ---------------------- SUPPORT.md | 32 ------------ flushdb.py | 10 ---- main.py | 126 --------------------------------------------- models.py | 9 ---- requirements.txt | 18 ------- 10 files changed, 483 deletions(-) delete mode 100644 .gitignore delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 SECURITY.md delete mode 100644 SUPPORT.md delete mode 100644 flushdb.py delete mode 100644 main.py delete mode 100644 models.py delete mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f75400b..0000000 --- a/.gitignore +++ /dev/null @@ -1,106 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -settings.json \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index bb1fb9a..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,11 +0,0 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the -[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with - questions or concerns diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 115963d..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 4fdcd81..0000000 --- a/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Python/FastAPI Tutorial for Visual Studio Code - -This sample contains the completed program from the tutorial: -[FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). -Immediate steps are not included. - -## Run the app using GitHub Codespaces - -[GitHub Codespaces](https://github.com/features/codespaces) provides -cloud-powered development environments that work how and where you want it to. -To learn how to set up a GitHub Codespace for this repository, check the -[documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to -start the debugger and run the application. - -Once it's ready, you will see a notification with a button -`Open in the Browser`. Clicking the button will open your application on the -browser. You can then add `/docs` to the end of the URL to access the Swagger UI -and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your -operating system. To get started, first clone this project on your machine and -then open it in VS Code (**File** > **Open Folder...**). - -### Windows - -To run this app locally in VS Code on Windows, you can use either -[WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for -Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers - -1. Make sure you have - [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the - [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and - run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL - -1. Make sure you have - [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the - [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) - for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and - run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the - [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the - `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing - -Contributions to the sample are welcome! When submitting changes, also consider -submitting matching changes to the tutorial, the source file for which is -[tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) -declaring that you have the right to, and actually do, grant us the rights to -use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you -need to provide a CLA and decorate the PR appropriately (e.g., label, comment). -Simply follow the instructions provided by the bot. You will only need to do -this once across all repos using our CLA. - -## Additional details - -- This project has adopted the - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -- For more information see the - [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) - or -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any - additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 27d107b..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,62 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, -which includes all source code repositories managed through our GitHub -organizations, which include [Microsoft](https://github.com/Microsoft), -[Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), -[AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). - -If you believe you have found a security vulnerability in any Microsoft-owned -repository that meets -[Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), -please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at -[https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). - -If you prefer to submit without logging in, send email to -[secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your -message with our PGP key; please download it from the -[Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). - -You should receive a response within 24 hours. If for some reason you do not, -please follow up via email to ensure we received your original message. -Additional information can be found at -[microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can -provide) to help us better understand the nature and scope of the possible -issue: - -- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, - etc.) -- Full paths of source file(s) related to the manifestation of the issue -- The location of the affected source code (tag/branch/commit or direct URL) -- Any special configuration required to reproduce the issue -- Step-by-step instructions to reproduce the issue -- Proof-of-concept or exploit code (if possible) -- Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a -higher bounty award. Please visit our -[Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for -more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of -[Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). - - diff --git a/SUPPORT.md b/SUPPORT.md deleted file mode 100644 index 4b5b614..0000000 --- a/SUPPORT.md +++ /dev/null @@ -1,32 +0,0 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this -product/project? - -- **No CSS support:** Fill out this template with information about how to - file issues and get help. -- **Yes CSS support:** Fill out an intake form at - [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work - with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will - help you decide. - -_Then remove this first heading from this SUPPORT.MD file before publishing your -repo._ - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please -search the existing issues before filing new issues to avoid duplicates. For new -issues, file your bug or feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: -INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. -COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed -above. diff --git a/flushdb.py b/flushdb.py deleted file mode 100644 index dd1da37..0000000 --- a/flushdb.py +++ /dev/null @@ -1,10 +0,0 @@ -""" -This module is used to interact with a Redis database. - -WARNING: This script will flush the entire Redis database. Use with caution. -""" - -import redis - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) -redis_client.flushdb() diff --git a/main.py b/main.py deleted file mode 100644 index 3da3ace..0000000 --- a/main.py +++ /dev/null @@ -1,126 +0,0 @@ -import os - -import redis -from fastapi import FastAPI, HTTPException, Request - -from models import ItemPayload - -app = FastAPI() - -redis_client = redis.StrictRedis(host="0.0.0.0", port=6379, db=0, decode_responses=True) - - -@app.get("/") -def home(request: Request) -> dict[str, str]: - url: str = ( - f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}/" - if os.getenv("CODESPACE_NAME") - else str(request.base_url) - ) - return { - "message": f"Navigate to the following URL to access the Swagger UI: {url}docs" - } - - -# Route to add an item -@app.post("/items/{item_name}/{quantity}") -def add_item(item_name: str, quantity: int) -> dict[str, ItemPayload]: - if quantity <= 0: - raise HTTPException(status_code=400, detail="Quantity must be greater than 0.") - - # Check if item already exists - item_id_str: str | None = redis_client.hget("item_name_to_id", item_name) - - if item_id_str is not None: - item_id = int(item_id_str) - quantity = redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity) - else: - # Generate an id for the item - item_id: int = redis_client.incr("item_ids") - redis_client.hset( - f"item_id:{item_id}", - mapping={ - "item_id": item_id, - "item_name": item_name, - "quantity": quantity, - }, - ) - # Create a set so we can search by name too - redis_client.hset("item_name_to_id", item_name, item_id) - - return { - "item": ItemPayload(item_id=item_id, item_name=item_name, quantity=quantity) - } - - -# Route to list a specific item by id but using Redis -@app.get("/items/{item_id}") -def list_item(item_id: int) -> dict[str, dict[str, str]]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - return {"item": redis_client.hgetall(f"item_id:{item_id}")} - - -@app.get("/items") -def list_items() -> dict[str, list[ItemPayload]]: - items: list[ItemPayload] = [] - stored_items: dict[str, str] = redis_client.hgetall("item_name_to_id") - - for name, id_str in stored_items.items(): - item_id: int = int(id_str) - - item_name_str: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - if item_name_str is not None: - item_name: str = item_name_str - else: - continue # skip this item if it has no name - - item_quantity_str: str | None = redis_client.hget( - f"item_id:{item_id}", "quantity" - ) - if item_quantity_str is not None: - item_quantity: int = int(item_quantity_str) - else: - item_quantity = 0 - - items.append( - ItemPayload(item_id=item_id, item_name=item_name, quantity=item_quantity) - ) - - return {"items": items} - - -# Route to delete a specific item by id but using Redis -@app.delete("/items/{item_id}") -def delete_item(item_id: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - else: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - - -# Route to remove some quantity of a specific item by id but using Redis -@app.delete("/items/{item_id}/{quantity}") -def remove_quantity(item_id: int, quantity: int) -> dict[str, str]: - if not redis_client.hexists(f"item_id:{item_id}", "item_id"): - raise HTTPException(status_code=404, detail="Item not found.") - - item_quantity: str | None = redis_client.hget(f"item_id:{item_id}", "quantity") - - # if quantity to be removed is higher or equal to item's quantity, delete the item - if item_quantity is None: - existing_quantity: int = 0 - else: - existing_quantity: int = int(item_quantity) - if existing_quantity <= quantity: - item_name: str | None = redis_client.hget(f"item_id:{item_id}", "item_name") - redis_client.hdel("item_name_to_id", f"{item_name}") - redis_client.delete(f"item_id:{item_id}") - return {"result": "Item deleted."} - else: - redis_client.hincrby(f"item_id:{item_id}", "quantity", -quantity) - return {"result": f"{quantity} items removed."} diff --git a/models.py b/models.py deleted file mode 100644 index 6d6a40c..0000000 --- a/models.py +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Optional - -from pydantic import BaseModel - - -class ItemPayload(BaseModel): - item_id: Optional[int] - item_name: str - quantity: int diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7631c08..0000000 --- a/requirements.txt +++ /dev/null @@ -1,18 +0,0 @@ -annotated-types==0.6.0 -anyio==3.7.1 -cffi==1.16.0 -click==8.1.7 -cryptography==41.0.4 -fastapi==0.104.0 -h11==0.14.0 -idna==3.4 -pycparser==2.21 -pydantic==2.4.2 -pydantic-core==2.10.1 -redis==5.0.1 -sniffio==1.3.0 -starlette==0.27.0 -types-pyopenssl==23.3.0.0 -types-redis==4.6.0.7 -typing-extensions==4.8.0 -uvicorn==0.23.2 From d6dc46d86736ddfc20f0d9ee420fa3cdb2d151ab Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 10 Sep 2024 03:21:17 +0300 Subject: [PATCH 42/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 6e7984a8d1dd8e8b6777f4ea30f115048f59d7bd Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 11 Sep 2024 00:55:54 +0300 Subject: [PATCH 43/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From e0ebd7b93b9ce1a7f87f2d3adc247aa278c45db4 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 12 Sep 2024 04:56:32 +0300 Subject: [PATCH 44/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 3ab6a84e63db5f55f0ce3b6a605ec84ef3d4e5eb Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 12 Sep 2024 14:07:14 +0300 Subject: [PATCH 45/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 9cdf4a01e6df68ba1993ada7e9a490f9044d66d8 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sat, 14 Sep 2024 09:26:29 +0300 Subject: [PATCH 46/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 2c5fa52ef148a75ae406402fda856504ab29261c Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 16 Sep 2024 11:36:35 +0300 Subject: [PATCH 47/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 981911ed614a5144a565d456811931fbb163c7ca Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 18 Sep 2024 11:51:53 +0300 Subject: [PATCH 48/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 187cf48175011c4fa11b1d8d629b1ad4e0e18714 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 18 Sep 2024 13:29:39 +0300 Subject: [PATCH 49/70] --- .gitignore | 189 +++++++++++++++++++++++------------------------------ 1 file changed, 83 insertions(+), 106 deletions(-) diff --git a/.gitignore b/.gitignore index f75400b..ce3f811 100644 --- a/.gitignore +++ b/.gitignore @@ -1,106 +1,83 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -settings.json \ No newline at end of file +__pycache__/ +*.py[cod] +*$py.class + +*.so + +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +*.manifest +*.spec + +pip-log.txt +pip-delete-this-directory.txt + +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +*.mo +*.pot + +*.log +local_settings.py +db.sqlite3 + +instance/ +.webassets-cache + +.scrapy + +docs/_build/ + +target/ + +.ipynb_checkpoints + +.python-version + +celerybeat-schedule + +*.sage.py + +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +.spyderproject +.spyproject + +.ropeproject + +/site + +.mypy_cache/ + +settings.json From 2defcd582c887f8dbfe37676d7051c146b069378 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 19 Sep 2024 13:36:13 +0300 Subject: [PATCH 50/70] --- .gitignore | 189 +++++++++++++++++++++++------------------------------ 1 file changed, 83 insertions(+), 106 deletions(-) diff --git a/.gitignore b/.gitignore index f75400b..ce3f811 100644 --- a/.gitignore +++ b/.gitignore @@ -1,106 +1,83 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -settings.json \ No newline at end of file +__pycache__/ +*.py[cod] +*$py.class + +*.so + +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +*.manifest +*.spec + +pip-log.txt +pip-delete-this-directory.txt + +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +*.mo +*.pot + +*.log +local_settings.py +db.sqlite3 + +instance/ +.webassets-cache + +.scrapy + +docs/_build/ + +target/ + +.ipynb_checkpoints + +.python-version + +celerybeat-schedule + +*.sage.py + +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +.spyderproject +.spyproject + +.ropeproject + +/site + +.mypy_cache/ + +settings.json From 968dda11be0cf283d88b7b79d919180fc3faa6b3 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 19 Sep 2024 17:53:04 +0300 Subject: [PATCH 51/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 57469dbe8e43a10316e7dbb857575f063351036d Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 20 Sep 2024 15:43:53 +0300 Subject: [PATCH 52/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From afbe9a5a25cd770b53168edae795db6a61f022fc Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 20 Sep 2024 18:09:56 +0300 Subject: [PATCH 53/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 47478461b4fc6f6e66e87aa532ad9f1cd20f35df Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 20 Sep 2024 20:05:04 +0300 Subject: [PATCH 54/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From c2c71fc7dd63b86fba022709183c200f42954093 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 20 Sep 2024 20:50:55 +0300 Subject: [PATCH 55/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From bb1089a541a19c980acbc2dc9098f3d674c0c938 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 3 Oct 2024 05:47:16 +0300 Subject: [PATCH 56/70] --- .devcontainer/devcontainer.json | 31 ------------------------ .github/dependabot.yml | 6 ----- .github/workflows/test-application.yml | 33 -------------------------- .vscode/launch.json | 19 --------------- 4 files changed, 89 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file From 2774a0a8eecfda69e3f9f846ef7480cb2675bef1 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 4 Oct 2024 09:10:23 +0300 Subject: [PATCH 57/70] --- LICENSE | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/LICENSE b/LICENSE index 62f454e..115963d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 35379872191dc4e9277e8516743080578e7e63a0 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 6 Oct 2024 00:04:41 +0300 Subject: [PATCH 58/70] --- CODE_OF_CONDUCT.md | 10 ++-- README.md | 136 +++++++++++++++++++++++++++++---------------- SECURITY.md | 51 ++++++++++++----- SUPPORT.md | 57 ++++++++++--------- 4 files changed, 162 insertions(+), 92 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f9ba8cf..bb1fb9a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,9 +1,11 @@ # Microsoft Open Source Code of Conduct -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Resources: -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with + questions or concerns diff --git a/README.md b/README.md index 7c991dd..4fdcd81 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,88 @@ -# Python/FastAPI Tutorial for Visual Studio Code -This sample contains the completed program from the tutorial: [FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). Immediate steps are not included. - -## Run the app using GitHub Codespaces -[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments that work how and where you want it to. To learn how to set up a GitHub Codespace for this repository, check the [documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to start the debugger and run the application. - -Once it's ready, you will see a notification with a button `Open in the Browser`. Clicking the button will open your application on the browser. You can then add `/docs` to the end of the URL to access the Swagger UI and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your operating system. To get started, first clone this project on your machine and then open it in VS Code (**File** > **Open Folder...**). - -### Windows -To run this app locally in VS Code on Windows, you can use either [WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers -1. Make sure you have [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL -1. Make sure you have [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing -Contributions to the sample are welcome! When submitting changes, also consider submitting matching changes to the tutorial, the source file for which is [tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - -## Additional details - -* This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -* For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -* Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +# Python/FastAPI Tutorial for Visual Studio Code + +This sample contains the completed program from the tutorial: +[FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). +Immediate steps are not included. + +## Run the app using GitHub Codespaces + +[GitHub Codespaces](https://github.com/features/codespaces) provides +cloud-powered development environments that work how and where you want it to. +To learn how to set up a GitHub Codespace for this repository, check the +[documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). + +Once you open this repository in GitHub Codespaces, you can press **F5** to +start the debugger and run the application. + +Once it's ready, you will see a notification with a button +`Open in the Browser`. Clicking the button will open your application on the +browser. You can then add `/docs` to the end of the URL to access the Swagger UI +and interact with the application! + +## Run the app locally in VS Code + +There are diffent ways you can run this app locally in VS Code depending on your +operating system. To get started, first clone this project on your machine and +then open it in VS Code (**File** > **Open Folder...**). + +### Windows + +To run this app locally in VS Code on Windows, you can use either +[WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for +Linux) or [Docker](https://www.docker.com/products/docker-desktop). + +#### Docker Containers + +1. Make sure you have + [Docker installed](https://www.docker.com/products/docker-desktop) +1. Install the + [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "Dev Container: Reopen in Container" command. +1. Press **F5** to debug your application! + +#### WSL + +1. Make sure you have + [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) +1. Install the + [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) + for VS Code +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and + run the "WSL: Reopen Folder in WSL" command +1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. + +### macOS / Linux + +1. Install the + [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) + for VS Code +1. Run the "Python: Create Environment" command in the Command Palette +1. Select `Venv`, the latest available version of Python and then the + `requirements.txt` file to install the dependencies. +1. Press **F5** to run your application! + +## Contributing + +Contributions to the sample are welcome! When submitting changes, also consider +submitting matching changes to the tutorial, the source file for which is +[tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). + +Most contributions require you to agree to a Contributor License Agreement (CLA) +declaring that you have the right to, and actually do, grant us the rights to +use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot automatically determines whether you +need to provide a CLA and decorate the PR appropriately (e.g., label, comment). +Simply follow the instructions provided by the bot. You will only need to do +this once across all repos using our CLA. + +## Additional details + +- This project has adopted the + [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +- For more information see the + [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) + or +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any + additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md index b3c89ef..27d107b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,33 +2,53 @@ ## Security -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). +Microsoft takes the security of our software products and services seriously, +which includes all source code repositories managed through our GitHub +organizations, which include [Microsoft](https://github.com/Microsoft), +[Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), +[AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. +If you believe you have found a security vulnerability in any Microsoft-owned +repository that meets +[Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), +please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). +Instead, please report them to the Microsoft Security Response Center (MSRC) at +[https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). +If you prefer to submit without logging in, send email to +[secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your +message with our PGP key; please download it from the +[Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). +You should receive a response within 24 hours. If for some reason you do not, +please follow up via email to ensure we received your original message. +Additional information can be found at +[microsoft.com/msrc](https://www.microsoft.com/msrc). -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: +Please include the requested information listed below (as much as you can +provide) to help us better understand the nature and scope of the possible +issue: - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue +- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, + etc.) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code (if possible) +- Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. +If you are reporting for a bug bounty, more complete reports can contribute to a +higher bounty award. Please visit our +[Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for +more details about our active programs. ## Preferred Languages @@ -36,6 +56,7 @@ We prefer all communications to be in English. ## Policy -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). +Microsoft follows the principle of +[Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). diff --git a/SUPPORT.md b/SUPPORT.md index 291d4d4..4b5b614 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,25 +1,32 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? - -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. - -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this +product/project? + +- **No CSS support:** Fill out this template with information about how to + file issues and get help. +- **Yes CSS support:** Fill out an intake form at + [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work + with/help you to determine next steps. +- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will + help you decide. + +_Then remove this first heading from this SUPPORT.MD file before publishing your +repo._ + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please +search the existing issues before filing new issues to avoid duplicates. For new +issues, file your bug or feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: +INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. +COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed +above. From 50b42344218289ad10ac25ac8fd9633b184945e4 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Sun, 6 Oct 2024 12:37:47 +0300 Subject: [PATCH 59/70] --- README.md | 88 ------------------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index 4fdcd81..0000000 --- a/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Python/FastAPI Tutorial for Visual Studio Code - -This sample contains the completed program from the tutorial: -[FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). -Immediate steps are not included. - -## Run the app using GitHub Codespaces - -[GitHub Codespaces](https://github.com/features/codespaces) provides -cloud-powered development environments that work how and where you want it to. -To learn how to set up a GitHub Codespace for this repository, check the -[documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to -start the debugger and run the application. - -Once it's ready, you will see a notification with a button -`Open in the Browser`. Clicking the button will open your application on the -browser. You can then add `/docs` to the end of the URL to access the Swagger UI -and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your -operating system. To get started, first clone this project on your machine and -then open it in VS Code (**File** > **Open Folder...**). - -### Windows - -To run this app locally in VS Code on Windows, you can use either -[WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for -Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers - -1. Make sure you have - [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the - [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and - run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL - -1. Make sure you have - [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the - [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) - for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and - run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the - [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the - `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing - -Contributions to the sample are welcome! When submitting changes, also consider -submitting matching changes to the tutorial, the source file for which is -[tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) -declaring that you have the right to, and actually do, grant us the rights to -use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you -need to provide a CLA and decorate the PR appropriately (e.g., label, comment). -Simply follow the instructions provided by the bot. You will only need to do -this once across all repos using our CLA. - -## Additional details - -- This project has adopted the - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -- For more information see the - [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) - or -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any - additional questions or comments. From cc7d71569b3f3f3cdec59a208f166ee1eef3a626 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 7 Oct 2024 20:22:36 +0300 Subject: [PATCH 60/70] --- LICENSE | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 127 insertions(+), 12 deletions(-) diff --git a/LICENSE b/LICENSE index 115963d..c78b164 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,136 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator and +subsequent owner(s) (each and all, an "owner") of an original work of authorship +and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific works +("Commons") that the public can reliably and without fear of later claims of +infringement build upon, modify, incorporate in other works, reuse and +redistribute as freely as possible in any form whatsoever and for any purposes, +including without limitation commercial purposes. These owners may contribute to +the Commons to promote the ideal of a free culture and the further production of +creative, cultural and scientific works, or to gain reputation or greater +distribution for their Work in part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any expectation of +additional consideration or compensation, the person associating CC0 with a Work +(the "Affirmer"), to the extent that he or she is an owner of Copyright and +Related Rights in the Work, voluntarily elects to apply CC0 to the Work and +publicly distribute the Work under its terms, with knowledge of his or her +Copyright and Related Rights in the Work and the meaning and intended legal +effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be + protected by copyright and related or neighboring rights ("Copyright and + Related Rights"). Copyright and Related Rights include, but are not limited + to, the following: + +i. the right to reproduce, adapt, distribute, perform, display, communicate, and +translate a Work; ii. moral rights retained by the original author(s) and/or +performer(s); iii. publicity and privacy rights pertaining to a person's image +or likeness depicted in a Work; iv. rights protecting against unfair competition +in regards to a Work, subject to the limitations in paragraph 4(a), below; v. +rights protecting the extraction, dissemination, use and reuse of data in a +Work; vi. database rights (such as those arising under Directive 96/9/EC of the +European Parliament and of the Council of 11 March 1996 on the legal protection +of databases, and under any national implementation thereof, including any +amended or successor version of such directive); and vii. other similar, +equivalent or corresponding rights throughout the world based on applicable law +or treaty, and any national implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention of, + applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and + unconditionally waives, abandons, and surrenders all of Affirmer's Copyright + and Related Rights and associated claims and causes of action, whether now + known or unknown (including existing as well as future claims and causes of + action), in the Work (i) in all territories worldwide, (ii) for the maximum + duration provided by applicable law or treaty (including future time + extensions), (iii) in any current or future medium and for any number of + copies, and (iv) for any purpose whatsoever, including without limitation + commercial, advertising or promotional purposes (the "Waiver"). Affirmer + makes the Waiver for the benefit of each member of the public at large and to + the detriment of Affirmer's heirs and successors, fully intending that such + Waiver shall not be subject to revocation, rescission, cancellation, + termination, or any other legal or equitable action to disrupt the quiet + enjoyment of the Work by the public as contemplated by Affirmer's express . + +3. Public License Fallback. Should any part of the Waiver for any reason be + judged legally invalid or ineffective under applicable law, then the Waiver + shall be preserved to the maximum extent permitted taking into account + Affirmer's express . In addition, to the extent the Waiver is so judged + Affirmer hereby grants to each affected person a royalty-free, non + transferable, non sublicensable, non exclusive, irrevocable and unconditional + license to exercise Affirmer's Copyright and Related Rights in the Work (i) + in all territories worldwide, (ii) for the maximum duration provided by + applicable law or treaty (including future time extensions), (iii) in any + current or future medium and for any number of copies, and (iv) for any + purpose whatsoever, including without limitation commercial, advertising or + promotional purposes (the "License"). The License shall be deemed effective + as of the date CC0 was applied by Affirmer to the Work. Should any part of + the License for any reason be judged legally invalid or ineffective under + applicable law, such partial invalidity or ineffectiveness shall not + invalidate the remainder of the License, and in such case Affirmer hereby + affirms that he or she will not (i) exercise any of his or her remaining + Copyright and Related Rights in the Work or (ii) assert any associated claims + and causes of action with respect to the Work, in either case contrary to + +4. Limitations and Disclaimers. + +a. No trademark or patent rights held by Affirmer are waived, abandoned, +surrendered, licensed or otherwise affected by this document. b. Affirmer offers +the Work as-is and makes no representations or warranties of any kind concerning +the Work, express, implied, statutory or otherwise, including without limitation +warranties of title, merchantability, fitness for a particular purpose, non +infringement, or the absence of latent or other defects, accuracy, or the +present or absence of errors, whether or not discoverable, all to the greatest +extent permissible under applicable law. c. Affirmer disclaims responsibility +for clearing rights of other persons that may apply to the Work or any use +thereof, including without limitation any person's Copyright and Related Rights +in the Work. Further, Affirmer disclaims responsibility for obtaining any +necessary consents, permissions or other rights required for any use of the +Work. d. Affirmer understands and acknowledges that Creative Commons is not a +party to this document and has no duty or obligation with respect to this CC0 or +use of the Work. + +--- + +Note: The above license applies only to the modifications made by PlayForm to +the original work. The original work is licensed under the following licenses +and is subject to its terms and conditions: + MIT License Copyright (c) 2023 Microsoft -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From b1bcf7dd31b39ea352e0acb339d2b26617b9b686 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 7 Oct 2024 20:32:28 +0300 Subject: [PATCH 61/70] --- CODE_OF_CONDUCT.md | 11 -------- SECURITY.md | 62 ---------------------------------------------- 2 files changed, 73 deletions(-) delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 SECURITY.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index bb1fb9a..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,11 +0,0 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the -[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with - questions or concerns diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 27d107b..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,62 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, -which includes all source code repositories managed through our GitHub -organizations, which include [Microsoft](https://github.com/Microsoft), -[Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), -[AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). - -If you believe you have found a security vulnerability in any Microsoft-owned -repository that meets -[Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), -please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at -[https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). - -If you prefer to submit without logging in, send email to -[secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your -message with our PGP key; please download it from the -[Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). - -You should receive a response within 24 hours. If for some reason you do not, -please follow up via email to ensure we received your original message. -Additional information can be found at -[microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can -provide) to help us better understand the nature and scope of the possible -issue: - -- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, - etc.) -- Full paths of source file(s) related to the manifestation of the issue -- The location of the affected source code (tag/branch/commit or direct URL) -- Any special configuration required to reproduce the issue -- Step-by-step instructions to reproduce the issue -- Proof-of-concept or exploit code (if possible) -- Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a -higher bounty award. Please visit our -[Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for -more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of -[Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). - - From 1a8f9b2163db7b4dd64647a0312a07e0bde90ef6 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 7 Oct 2024 22:43:14 +0300 Subject: [PATCH 62/70] --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index c78b164..c5cbfef 100644 --- a/LICENSE +++ b/LICENSE @@ -112,7 +112,7 @@ use of the Work. Note: The above license applies only to the modifications made by PlayForm to the original work. The original work is licensed under the following licenses -and is subject to its terms and conditions: +and is subject to their terms and conditions: MIT License From 3dc70e9003516f4c65ed334488afce18d9ebe9da Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 8 Oct 2024 14:51:31 +0300 Subject: [PATCH 63/70] --- .devcontainer/devcontainer.json | 31 +++++ .github/dependabot.yml | 6 + .github/workflows/test-application.yml | 33 ++++++ .vscode/launch.json | 19 +++ CODE_OF_CONDUCT.md | 9 ++ LICENSE | 157 ++++--------------------- README.md | 48 ++++++++ SECURITY.md | 41 +++++++ SUPPORT.md | 57 ++++----- 9 files changed, 233 insertions(+), 168 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test-application.yml create mode 100644 .vscode/launch.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 README.md create mode 100644 SECURITY.md diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..dd7a996 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", + "features": { + "ghcr.io/itsmechlark/features/redis-server:1": {} + }, + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip3 install --user -r requirements.txt", + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "esbenp.prettier-vscode", + "ms-python.black-formatter", + "charliermarsh.ruff", + "ms-python.debugpy" + ] + } + } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ee3d10a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml new file mode 100644 index 0000000..0b99df1 --- /dev/null +++ b/.github/workflows/test-application.yml @@ -0,0 +1,33 @@ +name: Test Application + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + env: + PORT: 8000 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Start the app + run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & + + - name: Sleep for 1 minute + run: sleep 60 + + - name: Stop the app + run: pkill -f 'uvicorn main:app' + diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c5bd5d0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,19 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python Debugger: FastAPI", + "type": "debugpy", + "request": "launch", + "module": "uvicorn", + "args": [ + "main:app", + "--reload" + ], + "jinja": true + } + ] +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..f9ba8cf --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/LICENSE b/LICENSE index c5cbfef..62f454e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,136 +1,21 @@ -Creative Commons Legal Code - -CC0 1.0 Universal - - CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE - LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN - ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS - INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES - REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS - PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM - THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED - HEREUNDER. - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator and -subsequent owner(s) (each and all, an "owner") of an original work of authorship -and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for the -purpose of contributing to a commons of creative, cultural and scientific works -("Commons") that the public can reliably and without fear of later claims of -infringement build upon, modify, incorporate in other works, reuse and -redistribute as freely as possible in any form whatsoever and for any purposes, -including without limitation commercial purposes. These owners may contribute to -the Commons to promote the ideal of a free culture and the further production of -creative, cultural and scientific works, or to gain reputation or greater -distribution for their Work in part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any expectation of -additional consideration or compensation, the person associating CC0 with a Work -(the "Affirmer"), to the extent that he or she is an owner of Copyright and -Related Rights in the Work, voluntarily elects to apply CC0 to the Work and -publicly distribute the Work under its terms, with knowledge of his or her -Copyright and Related Rights in the Work and the meaning and intended legal -effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be - protected by copyright and related or neighboring rights ("Copyright and - Related Rights"). Copyright and Related Rights include, but are not limited - to, the following: - -i. the right to reproduce, adapt, distribute, perform, display, communicate, and -translate a Work; ii. moral rights retained by the original author(s) and/or -performer(s); iii. publicity and privacy rights pertaining to a person's image -or likeness depicted in a Work; iv. rights protecting against unfair competition -in regards to a Work, subject to the limitations in paragraph 4(a), below; v. -rights protecting the extraction, dissemination, use and reuse of data in a -Work; vi. database rights (such as those arising under Directive 96/9/EC of the -European Parliament and of the Council of 11 March 1996 on the legal protection -of databases, and under any national implementation thereof, including any -amended or successor version of such directive); and vii. other similar, -equivalent or corresponding rights throughout the world based on applicable law -or treaty, and any national implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention of, - applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and - unconditionally waives, abandons, and surrenders all of Affirmer's Copyright - and Related Rights and associated claims and causes of action, whether now - known or unknown (including existing as well as future claims and causes of - action), in the Work (i) in all territories worldwide, (ii) for the maximum - duration provided by applicable law or treaty (including future time - extensions), (iii) in any current or future medium and for any number of - copies, and (iv) for any purpose whatsoever, including without limitation - commercial, advertising or promotional purposes (the "Waiver"). Affirmer - makes the Waiver for the benefit of each member of the public at large and to - the detriment of Affirmer's heirs and successors, fully intending that such - Waiver shall not be subject to revocation, rescission, cancellation, - termination, or any other legal or equitable action to disrupt the quiet - enjoyment of the Work by the public as contemplated by Affirmer's express . - -3. Public License Fallback. Should any part of the Waiver for any reason be - judged legally invalid or ineffective under applicable law, then the Waiver - shall be preserved to the maximum extent permitted taking into account - Affirmer's express . In addition, to the extent the Waiver is so judged - Affirmer hereby grants to each affected person a royalty-free, non - transferable, non sublicensable, non exclusive, irrevocable and unconditional - license to exercise Affirmer's Copyright and Related Rights in the Work (i) - in all territories worldwide, (ii) for the maximum duration provided by - applicable law or treaty (including future time extensions), (iii) in any - current or future medium and for any number of copies, and (iv) for any - purpose whatsoever, including without limitation commercial, advertising or - promotional purposes (the "License"). The License shall be deemed effective - as of the date CC0 was applied by Affirmer to the Work. Should any part of - the License for any reason be judged legally invalid or ineffective under - applicable law, such partial invalidity or ineffectiveness shall not - invalidate the remainder of the License, and in such case Affirmer hereby - affirms that he or she will not (i) exercise any of his or her remaining - Copyright and Related Rights in the Work or (ii) assert any associated claims - and causes of action with respect to the Work, in either case contrary to - -4. Limitations and Disclaimers. - -a. No trademark or patent rights held by Affirmer are waived, abandoned, -surrendered, licensed or otherwise affected by this document. b. Affirmer offers -the Work as-is and makes no representations or warranties of any kind concerning -the Work, express, implied, statutory or otherwise, including without limitation -warranties of title, merchantability, fitness for a particular purpose, non -infringement, or the absence of latent or other defects, accuracy, or the -present or absence of errors, whether or not discoverable, all to the greatest -extent permissible under applicable law. c. Affirmer disclaims responsibility -for clearing rights of other persons that may apply to the Work or any use -thereof, including without limitation any person's Copyright and Related Rights -in the Work. Further, Affirmer disclaims responsibility for obtaining any -necessary consents, permissions or other rights required for any use of the -Work. d. Affirmer understands and acknowledges that Creative Commons is not a -party to this document and has no duty or obligation with respect to this CC0 or -use of the Work. - ---- - -Note: The above license applies only to the modifications made by PlayForm to -the original work. The original work is licensed under the following licenses -and is subject to their terms and conditions: - -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +MIT License + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7c991dd --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# Python/FastAPI Tutorial for Visual Studio Code +This sample contains the completed program from the tutorial: [FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). Immediate steps are not included. + +## Run the app using GitHub Codespaces +[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments that work how and where you want it to. To learn how to set up a GitHub Codespace for this repository, check the [documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). + +Once you open this repository in GitHub Codespaces, you can press **F5** to start the debugger and run the application. + +Once it's ready, you will see a notification with a button `Open in the Browser`. Clicking the button will open your application on the browser. You can then add `/docs` to the end of the URL to access the Swagger UI and interact with the application! + +## Run the app locally in VS Code + +There are diffent ways you can run this app locally in VS Code depending on your operating system. To get started, first clone this project on your machine and then open it in VS Code (**File** > **Open Folder...**). + +### Windows +To run this app locally in VS Code on Windows, you can use either [WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for Linux) or [Docker](https://www.docker.com/products/docker-desktop). + +#### Docker Containers +1. Make sure you have [Docker installed](https://www.docker.com/products/docker-desktop) +1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "Dev Container: Reopen in Container" command. +1. Press **F5** to debug your application! + +#### WSL +1. Make sure you have [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) +1. Install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for VS Code +1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "WSL: Reopen Folder in WSL" command +1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. + +### macOS / Linux + +1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code +1. Run the "Python: Create Environment" command in the Command Palette +1. Select `Venv`, the latest available version of Python and then the `requirements.txt` file to install the dependencies. +1. Press **F5** to run your application! + +## Contributing +Contributions to the sample are welcome! When submitting changes, also consider submitting matching changes to the tutorial, the source file for which is [tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). + +Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot automatically determines whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +## Additional details + +* This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +* For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +* Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..b3c89ef --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). + + diff --git a/SUPPORT.md b/SUPPORT.md index 4b5b614..291d4d4 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,32 +1,25 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this -product/project? - -- **No CSS support:** Fill out this template with information about how to - file issues and get help. -- **Yes CSS support:** Fill out an intake form at - [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work - with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will - help you decide. - -_Then remove this first heading from this SUPPORT.MD file before publishing your -repo._ - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please -search the existing issues before filing new issues to avoid duplicates. For new -issues, file your bug or feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: -INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. -COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed -above. +# TODO: The maintainer of this repo has not yet edited this file + +**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? + +- **No CSS support:** Fill out this template with information about how to file issues and get help. +- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. +- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. + +*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* + +# Support + +## How to file issues and get help + +This project uses GitHub Issues to track bugs and feature requests. Please search the existing +issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE +FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER +CHANNEL. WHERE WILL YOU HELP PEOPLE?**. + +## Microsoft Support Policy + +Support for this **PROJECT or PRODUCT** is limited to the resources listed above. From 7d1407463a6605136b9fb04453e40aa0fab41439 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 8 Oct 2024 15:13:01 +0300 Subject: [PATCH 64/70] --- .devcontainer/devcontainer.json | 31 ----------------- .github/dependabot.yml | 6 ---- .github/workflows/test-application.yml | 33 ------------------ .vscode/launch.json | 19 ---------- CODE_OF_CONDUCT.md | 9 ----- README.md | 48 -------------------------- SECURITY.md | 41 ---------------------- SUPPORT.md | 25 -------------- 8 files changed, 212 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/test-application.yml delete mode 100644 .vscode/launch.json delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 README.md delete mode 100644 SECURITY.md delete mode 100644 SUPPORT.md diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index dd7a996..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,31 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "Python 3", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", - "features": { - "ghcr.io/itsmechlark/features/redis-server:1": {} - }, - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "esbenp.prettier-vscode", - "ms-python.black-formatter", - "charliermarsh.ruff", - "ms-python.debugpy" - ] - } - } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index ee3d10a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/.github/workflows/test-application.yml b/.github/workflows/test-application.yml deleted file mode 100644 index 0b99df1..0000000 --- a/.github/workflows/test-application.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test Application - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - env: - PORT: 8000 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Start the app - run: uvicorn main:app --host 0.0.0.0 --port ${{ env.PORT }} & - - - name: Sleep for 1 minute - run: sleep 60 - - - name: Stop the app - run: pkill -f 'uvicorn main:app' - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index c5bd5d0..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python Debugger: FastAPI", - "type": "debugpy", - "request": "launch", - "module": "uvicorn", - "args": [ - "main:app", - "--reload" - ], - "jinja": true - } - ] -} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index f9ba8cf..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,9 +0,0 @@ -# Microsoft Open Source Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). - -Resources: - -- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) -- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/README.md b/README.md deleted file mode 100644 index 7c991dd..0000000 --- a/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Python/FastAPI Tutorial for Visual Studio Code -This sample contains the completed program from the tutorial: [FastAPI in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-fastapi). Immediate steps are not included. - -## Run the app using GitHub Codespaces -[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments that work how and where you want it to. To learn how to set up a GitHub Codespace for this repository, check the [documentation](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). - -Once you open this repository in GitHub Codespaces, you can press **F5** to start the debugger and run the application. - -Once it's ready, you will see a notification with a button `Open in the Browser`. Clicking the button will open your application on the browser. You can then add `/docs` to the end of the URL to access the Swagger UI and interact with the application! - -## Run the app locally in VS Code - -There are diffent ways you can run this app locally in VS Code depending on your operating system. To get started, first clone this project on your machine and then open it in VS Code (**File** > **Open Folder...**). - -### Windows -To run this app locally in VS Code on Windows, you can use either [WSL](https://learn.microsoft.com/en-us/windows/wsl/) (Windows Subsystem for Linux) or [Docker](https://www.docker.com/products/docker-desktop). - -#### Docker Containers -1. Make sure you have [Docker installed](https://www.docker.com/products/docker-desktop) -1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "Dev Container: Reopen in Container" command. -1. Press **F5** to debug your application! - -#### WSL -1. Make sure you have [WSL installed](https://learn.microsoft.com/en-us/windows/wsl/) -1. Install the [WSL extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) for VS Code -1. Open the Command Palette in VS Code (**View** > **Command Palette...**) and run the "WSL: Reopen Folder in WSL" command -1. Follow the remaining steps for [macOS/Linux](#macos--linux) below. - -### macOS / Linux - -1. Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code -1. Run the "Python: Create Environment" command in the Command Palette -1. Select `Venv`, the latest available version of Python and then the `requirements.txt` file to install the dependencies. -1. Press **F5** to run your application! - -## Contributing -Contributions to the sample are welcome! When submitting changes, also consider submitting matching changes to the tutorial, the source file for which is [tutorial-fastapi.md](https://github.com/Microsoft/vscode-docs/blob/master/docs/python/tutorial-fastapi.md). - -Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot automatically determines whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - -## Additional details - -* This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -* For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -* Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index b3c89ef..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd). - - diff --git a/SUPPORT.md b/SUPPORT.md deleted file mode 100644 index 291d4d4..0000000 --- a/SUPPORT.md +++ /dev/null @@ -1,25 +0,0 @@ -# TODO: The maintainer of this repo has not yet edited this file - -**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? - -- **No CSS support:** Fill out this template with information about how to file issues and get help. -- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. -- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. - -*Then remove this first heading from this SUPPORT.MD file before publishing your repo.* - -# Support - -## How to file issues and get help - -This project uses GitHub Issues to track bugs and feature requests. Please search the existing -issues before filing new issues to avoid duplicates. For new issues, file your bug or -feature request as a new Issue. - -For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE -FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER -CHANNEL. WHERE WILL YOU HELP PEOPLE?**. - -## Microsoft Support Policy - -Support for this **PROJECT or PRODUCT** is limited to the resources listed above. From c74c4de74b2980fe544fd312bd89b769bb5f5bf8 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 8 Oct 2024 18:56:05 +0300 Subject: [PATCH 65/70] --- .github/dependabot.yml | 14 ++++++++ .github/workflows/Dependabot.yml | 45 ++++++++++++++++++++++++ .github/workflows/GitHub.yml | 59 ++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4242a05 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..387fece --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..161ef34 --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,59 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + VCPKG_DISABLE_METRICS: 1 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From 78ba854af75897eb129346f4f9f18997665cfa49 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 9 Oct 2024 15:03:18 +0300 Subject: [PATCH 66/70] --- .github/dependabot.yml | 14 -------- .github/workflows/Dependabot.yml | 45 ------------------------ .github/workflows/GitHub.yml | 59 -------------------------------- 3 files changed, 118 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 161ef34..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - VCPKG_DISABLE_METRICS: 1 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 From 01b6fe130982b243a29d94ef560e546761e5487b Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 9 Oct 2024 19:23:22 +0300 Subject: [PATCH 67/70] --- .github/dependabot.yml | 14 ++++++++ .github/workflows/Dependabot.yml | 45 ++++++++++++++++++++++++ .github/workflows/GitHub.yml | 59 ++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/Dependabot.yml create mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4242a05 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +enable-beta-ecosystems: true + +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml new file mode 100644 index 0000000..387fece --- /dev/null +++ b/.github/workflows/Dependabot.yml @@ -0,0 +1,45 @@ +name: Dependabot + +concurrency: + group: Dependabot-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + security-events: write + contents: write + pull-requests: write + +on: + workflow_dispatch: + pull_request: + +jobs: + Approve: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + Merge: + runs-on: ubuntu-latest + + if: ${{ github.actor == 'dependabot[bot]' }} + + steps: + - uses: dependabot/fetch-metadata@v2.2.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml new file mode 100644 index 0000000..161ef34 --- /dev/null +++ b/.github/workflows/GitHub.yml @@ -0,0 +1,59 @@ +name: GitHub + +concurrency: + group: GitHub-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + issues: write + pull-requests: write + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + Assign: + runs-on: ubuntu-latest + + env: + ADBLOCK: true + ASTRO_TELEMETRY_DISABLED: 1 + AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 + AZURE_CORE_COLLECT_TELEMETRY: 0 + CHOOSENIM_NO_ANALYTICS: 1 + DIEZ_DO_NOT_TRACK: 1 + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 + DO_NOT_TRACK: 1 + ET_NO_TELEMETRY: 1 + GATSBY_TELEMETRY_DISABLED: 1 + GATSBY_TELEMETRY_OPTOUT: 1 + GATSBY_TELEMETRY_OPT_OUT: 1 + GRIT_TELEMETRY_DISABLED: 1 + HASURA_GRAPHQL_ENABLE_TELEMETRY: false + HINT_TELEMETRY: off + HOMEBREW_NO_ANALYTICS: 1 + INFLUXD_REPORTING_DISABLED: true + ITERATIVE_DO_NOT_TRACK: 1 + NEXT_TELEMETRY_DEBUG: 1 + NEXT_TELEMETRY_DISABLED: 1 + NG_CLI_ANALYTICS: false + NUXT_TELEMETRY_DISABLED: 1 + PIN_DO_NOT_TRACK: 1 + POWERSHELL_TELEMETRY_OPTOUT: 1 + SAM_CLI_TELEMETRY: 0 + STNOUPGRADE: 1 + STRIPE_CLI_TELEMETRY_OPTOUT: 1 + TELEMETRY_DISABLED: 1 + TERRAFORM_TELEMETRY: 0 + VCPKG_DISABLE_METRICS: 1 + + steps: + - uses: pozil/auto-assign-issue@v2.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + assignees: NikolaRHristov + numOfAssignee: 1 From ac9dbc4a67911b46f161d73c01ca965d2519b509 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Thu, 10 Oct 2024 12:21:36 +0300 Subject: [PATCH 68/70] --- .github/dependabot.yml | 14 -------- .github/workflows/Dependabot.yml | 45 ------------------------ .github/workflows/GitHub.yml | 59 -------------------------------- 3 files changed, 118 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/Dependabot.yml delete mode 100644 .github/workflows/GitHub.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 4242a05..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -enable-beta-ecosystems: true - -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - versioning-strategy: increase diff --git a/.github/workflows/Dependabot.yml b/.github/workflows/Dependabot.yml deleted file mode 100644 index 387fece..0000000 --- a/.github/workflows/Dependabot.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Dependabot - -concurrency: - group: Dependabot-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - security-events: write - contents: write - pull-requests: write - -on: - workflow_dispatch: - pull_request: - -jobs: - Approve: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - Merge: - runs-on: ubuntu-latest - - if: ${{ github.actor == 'dependabot[bot]' }} - - steps: - - uses: dependabot/fetch-metadata@v2.2.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/GitHub.yml b/.github/workflows/GitHub.yml deleted file mode 100644 index 161ef34..0000000 --- a/.github/workflows/GitHub.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: GitHub - -concurrency: - group: GitHub-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - issues: write - pull-requests: write - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - Assign: - runs-on: ubuntu-latest - - env: - ADBLOCK: true - ASTRO_TELEMETRY_DISABLED: 1 - AUTOMATEDLAB_TELEMETRY_OPTOUT: 1 - AZURE_CORE_COLLECT_TELEMETRY: 0 - CHOOSENIM_NO_ANALYTICS: 1 - DIEZ_DO_NOT_TRACK: 1 - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_INTERACTIVE_CLI_TELEMETRY_OPTOUT: 1 - DO_NOT_TRACK: 1 - ET_NO_TELEMETRY: 1 - GATSBY_TELEMETRY_DISABLED: 1 - GATSBY_TELEMETRY_OPTOUT: 1 - GATSBY_TELEMETRY_OPT_OUT: 1 - GRIT_TELEMETRY_DISABLED: 1 - HASURA_GRAPHQL_ENABLE_TELEMETRY: false - HINT_TELEMETRY: off - HOMEBREW_NO_ANALYTICS: 1 - INFLUXD_REPORTING_DISABLED: true - ITERATIVE_DO_NOT_TRACK: 1 - NEXT_TELEMETRY_DEBUG: 1 - NEXT_TELEMETRY_DISABLED: 1 - NG_CLI_ANALYTICS: false - NUXT_TELEMETRY_DISABLED: 1 - PIN_DO_NOT_TRACK: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 - SAM_CLI_TELEMETRY: 0 - STNOUPGRADE: 1 - STRIPE_CLI_TELEMETRY_OPTOUT: 1 - TELEMETRY_DISABLED: 1 - TERRAFORM_TELEMETRY: 0 - VCPKG_DISABLE_METRICS: 1 - - steps: - - uses: pozil/auto-assign-issue@v2.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - assignees: NikolaRHristov - numOfAssignee: 1 From 81406c67a3c38f3e55b080fd3ecb90cebb11354f Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 15 Oct 2024 02:21:35 +0300 Subject: [PATCH 69/70] --- LICENSE | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/LICENSE b/LICENSE index 62f454e..43bbdf2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,20 @@ -MIT License - -Copyright (c) 2023 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2023 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From b01ba8f7ae9ce7546615d510da3d72f7afaec15f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:56:00 +0000 Subject: [PATCH 70/70] Bump starlette from 0.27.0 to 0.40.0 Bumps [starlette](https://github.com/encode/starlette) from 0.27.0 to 0.40.0. - [Release notes](https://github.com/encode/starlette/releases) - [Changelog](https://github.com/encode/starlette/blob/master/docs/release-notes.md) - [Commits](https://github.com/encode/starlette/compare/0.27.0...0.40.0) --- updated-dependencies: - dependency-name: starlette dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6ea752e..80246f2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ pydantic==2.4.2 pydantic-core==2.10.1 redis==5.0.1 sniffio==1.3.0 -starlette==0.27.0 +starlette==0.40.0 types-pyopenssl==23.3.0.0 types-redis==4.6.0.7 typing-extensions==4.8.0