-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from northpowered/36-bug-config-file-arg-for-c…
…li-not-working Refactoring and bugfixes
- Loading branch information
Showing
60 changed files
with
946 additions
and
769 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,18 @@ | |
dsn: str = "postgresql://test:[email protected]:5432/test?sslmode=disable" | ||
|
||
engine = PostgresEngine( | ||
config={ | ||
'dsn':dsn, | ||
} | ||
) | ||
config={ | ||
'dsn': dsn, | ||
} | ||
) | ||
username: str = 'test3' | ||
database_name = 'test' | ||
asyncio.run(engine.run_ddl(f"create user {username} with password '{username}'")) | ||
asyncio.run(engine.run_ddl(f"grant all on database {database_name} to {username};")) | ||
asyncio.run(engine.run_ddl( | ||
f"create user {username} with password '{username}'")) | ||
asyncio.run(engine.run_ddl( | ||
f"grant all on database {database_name} to {username};")) | ||
asyncio.run(engine.run_ddl(f"grant all on schema public to {username};")) | ||
asyncio.run(engine.run_ddl(f"grant ALL ON ALL tables in schema public TO {username};")) | ||
asyncio.run(engine.run_ddl( | ||
f"grant ALL ON ALL tables in schema public TO {username};")) | ||
asyncio.run(engine.run_ddl(f"alter database test owner to {username};")) | ||
asyncio.run(engine.run_ddl(f"alter schema public owner to {username};")) | ||
asyncio.run(engine.run_ddl(f"alter schema public owner to {username};")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "fastapi-boilerplate" | ||
version = "1.8.0" | ||
version = "1.1.2" | ||
description = "" | ||
authors = ["northpowered <[email protected]>"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .models import Sessions | ||
from .models import Sessions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,30 @@ | ||
from utils.api_versioning import APIRouter, APIVersion | ||
from . import endpoints | ||
from .jwt import oauth2_scheme | ||
from .schemas import ( | ||
Token | ||
) | ||
from fastapi.security import OAuth2PasswordRequestForm | ||
from accounting.schemas import UserRead | ||
from fastapi import Depends | ||
auth_router = APIRouter( | ||
prefix="/auth", | ||
tags=["AAA->Authentication"], | ||
responses={ | ||
404: {"description": "URL not found"}, | ||
400: {"description": "Bad request"} | ||
}, | ||
#version=APIVersion(1) | ||
}, | ||
) | ||
|
||
auth_router.add_api_route( | ||
'/token', | ||
endpoints.login_for_access_token, | ||
'/token', | ||
endpoints.login_for_access_token, | ||
response_model=Token, | ||
summary='Authenticate via JWT Bearer scheme', | ||
methods=['post'], | ||
#dependencies=[Depends(OAuth2PasswordRequestForm)] | ||
) | ||
summary='Authenticate via JWT Bearer scheme', | ||
methods=['post'] | ||
) | ||
|
||
auth_router.add_api_route( | ||
'/me', | ||
endpoints.get_current_user, | ||
'/me', | ||
endpoints.get_current_user, | ||
response_model=UserRead, | ||
summary='Get current user', | ||
summary='Get current user', | ||
methods=['get'] | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from pydantic import BaseModel | ||
|
||
|
||
class Token(BaseModel): | ||
"""READ model for obtaining JWT""" | ||
access_token: str | ||
|
Oops, something went wrong.