From ee0ab374a21e31e7676a900da5c6429fcd5f0cc1 Mon Sep 17 00:00:00 2001 From: Kyle Tran Date: Fri, 25 Oct 2024 19:59:26 -0700 Subject: [PATCH] test --- README.md | 46 +------------------------- fishsense-database | 2 +- fishsense_services/routes/usr/login.py | 7 ++-- 3 files changed, 5 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 80c200e..1908ee9 100644 --- a/README.md +++ b/README.md @@ -1,45 +1 @@ -# python-repo-example -Example Python Package Repository. This repository serves as an example of how to set up a Python repository for UCSD Engineers for Exploration. - -## .vscode -This folder should contain at least a `launch.json` file that provides entry points into the package. This could be entry points to example programs, typical debug entry points, etc. Ideally, this will also contain a `settings.json` with folder specific VS Code settings. - -## Python Packages -Almost all code should be organized into packages. This facilitates easy code reuse. See https://packaging.python.org/en/latest/ for more information on how to use packages in Python. - -## tests -Tests should ideally be kept in an isolated folder. This example uses `pytest`, see https://docs.pytest.org/en/7.0.x/ for information on how to use `pytest`. - -## .gitignore -This is an important file to put into your `git` repositories. This helps prevent `git` from including unnecessary files into the version control system, such as generated files, environment files, or log files. - -## Jupyter Notebooks -Jupyter Notebooks are a great way to add interactive reports or documentation. There is an example here. - -## *.code-workspace -This is created by going to `File`->`Save Workspace As` in VS Code. This allows us to easily open the same development environment across computers and operating systems. Use this as the root of your development environment. - -You'll also notice here that there are some recommended extensions. This allows everyone on your team to have a consistent toolchain for how to interact with your code. See https://code.visualstudio.com/docs/editor/extension-marketplace#_workspace-recommended-extensions for instructions for how to configure these. - -## README.md -This is a critical file to include. This should be an introduction to your repository. It should be a birds-eye view of what your repo is and how to use it, with links to the appropriate lower-level documentation. - -## setup.py -This is the original way to package Python projects, which we probably still prefer. However, in general, if you can, you should probably start using the newer packaging tools (`pyproject.toml`) - -See https://packaging.python.org/en/latest/tutorials/packaging-projects/ and https://docs.python.org/3/distutils/setupscript.html for more information about each tool. - -## Installing for developers -Developers should do the following: -``` -# Create a virtual environment -python -m venv .venv - -# Activate the virtual environment -.venv/Scripts/activate.ps1 # for Windows PowerShell -.venv/Scripts/activate.bat # for Windows Command Prompt -source .venv/bin/activate # for bash - -# Install in developer mode -python -m pip install -e .[dev] -``` +git clone with --recurse-submodules \ No newline at end of file diff --git a/fishsense-database b/fishsense-database index 8bb558b..754a5f6 160000 --- a/fishsense-database +++ b/fishsense-database @@ -1 +1 @@ -Subproject commit 8bb558bbdc158f0491d70a540bdbdf6fa8c4adff +Subproject commit 754a5f6ba55ac02e79bac3d47462f0e5126d09d7 diff --git a/fishsense_services/routes/usr/login.py b/fishsense_services/routes/usr/login.py index 5f3f85a..b81b805 100644 --- a/fishsense_services/routes/usr/login.py +++ b/fishsense_services/routes/usr/login.py @@ -1,9 +1,8 @@ from os import abort from typing import Dict -from urllib import request -from fastapi import APIRouter +from fastapi import APIRouter, Request from google.auth.transport import requests from google.oauth2 import id_token @@ -13,12 +12,12 @@ login_router = APIRouter() - +# possible routes: reset passwrod, need to check if there is account associated with it @login_router.post("/api/login") def verify_token(): try: - token: Dict[str, str] = request.json + token: Dict[str, str] = Request.json idinfo = id_token.verify_oauth2_token( token["credential"], requests.Request(), CLIENT_ID )