-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed fastapi-auth0 in favor of a custom solution with better control
- Loading branch information
1 parent
ce8eff5
commit 2606f29
Showing
26 changed files
with
485 additions
and
61 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
alembic/versions/7a37c4da2a88_added_roles_to_user_table_and_removed_.py
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""added roles to user table and removed LONGTEXT to pass sqlite tests | ||
Revision ID: 7a37c4da2a88 | ||
Revises: 8d2203595f7e | ||
Create Date: 2023-09-21 17:06:50.116644 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '7a37c4da2a88' | ||
down_revision = '8d2203595f7e' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('user', sa.Column('roles', sa.JSON(), nullable=False)) | ||
op.alter_column('website_keywordcorpus', 'corpus', | ||
existing_type=mysql.LONGTEXT(), | ||
type_=sa.Text(length=4000000000), | ||
existing_nullable=False) | ||
op.alter_column('website_keywordcorpus', 'rawtext', | ||
existing_type=mysql.LONGTEXT(), | ||
type_=sa.Text(length=4000000000), | ||
existing_nullable=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('website_keywordcorpus', 'rawtext', | ||
existing_type=sa.Text(length=4000000000), | ||
type_=mysql.LONGTEXT(), | ||
existing_nullable=False) | ||
op.alter_column('website_keywordcorpus', 'corpus', | ||
existing_type=sa.Text(length=4000000000), | ||
type_=mysql.LONGTEXT(), | ||
existing_nullable=False) | ||
op.drop_column('user', 'roles') | ||
# ### end Alembic commands ### |
42 changes: 42 additions & 0 deletions
42
alembic/versions/8d2203595f7e_updated_website_keyword_tables_and_.py
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""updated website keyword tables and username in user table | ||
Revision ID: 8d2203595f7e | ||
Revises: 4bb1a741a074 | ||
Create Date: 2023-09-21 16:12:54.683735 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '8d2203595f7e' | ||
down_revision = '4bb1a741a074' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('website_keywordcorpus', 'corpus', | ||
existing_type=mysql.LONGTEXT(), | ||
type_=sa.Text(length=4000000000), | ||
existing_nullable=False) | ||
op.alter_column('website_keywordcorpus', 'rawtext', | ||
existing_type=mysql.LONGTEXT(), | ||
type_=sa.Text(length=4000000000), | ||
existing_nullable=False) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('website_keywordcorpus', 'rawtext', | ||
existing_type=sa.Text(length=4000000000), | ||
type_=mysql.LONGTEXT(), | ||
existing_nullable=False) | ||
op.alter_column('website_keywordcorpus', 'corpus', | ||
existing_type=sa.Text(length=4000000000), | ||
type_=mysql.LONGTEXT(), | ||
existing_nullable=False) | ||
# ### end Alembic commands ### |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from app.core.config import settings | ||
|
||
from .auth0 import ( | ||
Auth0, | ||
Auth0HTTPBearer, | ||
Auth0UnauthenticatedException, | ||
Auth0UnauthorizedException, | ||
Auth0User, | ||
HTTPAuth0Error, | ||
JwksDict, | ||
JwksKeyDict, | ||
OAuth2ImplicitBearer, | ||
) | ||
|
||
auth = Auth0( | ||
domain=settings.AUTH0_DOMAIN, | ||
api_audience=settings.AUTH0_API_AUDIENCE, | ||
scopes=settings.BASE_PRINCIPALS, | ||
) |
Oops, something went wrong.