Skip to content

Commit

Permalink
bump to UsersHub-authentification-module V3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Aug 8, 2024
1 parent cd3ad11 commit c1c2f55
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
19 changes: 11 additions & 8 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
from app.env import db

from pypnusershub.db.models import Application
from pypnusershub.login_manager import login_manager
from app.utils.errors import handle_unauthenticated_request

from pypnusershub.auth import auth_manager

migrate = Migrate()

Expand Down Expand Up @@ -63,10 +62,18 @@ def create_app():
app.config["URL_REDIRECT"] = "{}/{}".format(app.config["URL_APPLICATION"], "login")
app.secret_key = app.config["SECRET_KEY"]
app.wsgi_app = ProxyFix(app.wsgi_app, x_host=1)
login_manager.init_app(app)
login_manager.login_view = "login.login"
db.init_app(app)
app.config["DB"] = db
providers_config = [
{
"module": "pypnusershub.auth.providers.default.LocalProvider",
"id_provider": "local_provider",
},
]
auth_manager.init_app(
app, prefix="/pypn/auth/", providers_declaration=providers_config
)
auth_manager.home_page = app.config["URL_APPLICATION"]

migrate.init_app(app, db, directory=Path(__file__).absolute().parent / "migrations")

Expand All @@ -92,10 +99,6 @@ def constants_js():
def inject_user():
return dict(user=getattr(g, "user", None))

from pypnusershub import routes

app.register_blueprint(routes.routes, url_prefix="/pypn/auth")

from app.t_roles import route

app.register_blueprint(route.route, url_prefix="/")
Expand Down
2 changes: 1 addition & 1 deletion requirements-dependencies.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pypnusershub>=2.1.4,<3.0.0
pypnusershub>=3.0.0,<4.0.0
6 changes: 3 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ sqlalchemy==1.4.52
# pypnusershub
# utils-flask-sqlalchemy
typing-extensions==4.11.0
# via
# alembic
# sqlalchemy
# via alembic
urllib3==2.2.1
# via requests
utils-flask-sqlalchemy==0.4.1
Expand All @@ -144,5 +142,7 @@ wtforms==3.1.2
# wtforms-components
wtforms-components==0.10.5
# via -r requirements-common.in
xmltodict==0.13.0
# via pypnusershub
zipp==3.18.2
# via importlib-metadata
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ psycopg2==2.9.9
# pypnusershub
pycparser==2.22
# via cffi
pypnusershub==2.1.4
pypnusershub==3.0.0
# via -r requirements-dependencies.in
python-dateutil==2.9.0.post0
# via
Expand All @@ -124,9 +124,7 @@ sqlalchemy==1.4.52
# pypnusershub
# utils-flask-sqlalchemy
typing-extensions==4.11.0
# via
# alembic
# sqlalchemy
# via alembic
urllib3==2.2.1
# via requests
utils-flask-sqlalchemy==0.4.1
Expand All @@ -144,5 +142,7 @@ wtforms==3.1.2
# wtforms-components
wtforms-components==0.10.5
# via -r requirements-common.in
xmltodict==0.13.0
# via pypnusershub
zipp==3.18.2
# via importlib-metadata

0 comments on commit c1c2f55

Please sign in to comment.