Skip to content

Commit

Permalink
Export flask_pyoidc module directly for easier imports. (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
zamzterz authored Oct 18, 2019
1 parent 087c7b5 commit 5fb8da9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ To add authentication to one of your endpoints use the `oidc_auth` decorator:
import flask
from flask import Flask, jsonify

from flask_pyoidc import OIDCAuthentication
from flask_pyoidc.provider_configuration import ProviderConfiguration
from flask_pyoidc.user_session import UserSession
from flask_pyoidc.flask_pyoidc import OIDCAuthentication

app = Flask(__name__)
config = ProviderConfiguration(...)
Expand All @@ -147,8 +147,8 @@ provider):
To allow users to login with multiple different providers, configure all of them in the `OIDCAuthentication`
constructor and specify which one to use by name for each endpoint:
```python
from flask_pyoidc import OIDCAuthentication
from flask_pyoidc.provider_configuration import ProviderConfiguration
from flask_pyoidc.flask_pyoidc import OIDCAuthentication

app = Flask(__name__)
auth = OIDCAuthentication({'provider1': ProviderConfiguration(...), 'provider2': ProviderConfiguration(...)}, app)
Expand Down
3 changes: 1 addition & 2 deletions example/app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import datetime

import flask
import logging
from flask import Flask, jsonify

from flask_pyoidc.flask_pyoidc import OIDCAuthentication
from flask_pyoidc import OIDCAuthentication
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata
from flask_pyoidc.user_session import UserSession

Expand Down
1 change: 1 addition & 0 deletions src/flask_pyoidc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .flask_pyoidc import OIDCAuthentication
2 changes: 1 addition & 1 deletion tests/test_flask_pyoidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from unittest.mock import MagicMock, patch
from urllib.parse import parse_qsl, urlparse, urlencode

from flask_pyoidc.flask_pyoidc import OIDCAuthentication
from flask_pyoidc import OIDCAuthentication
from flask_pyoidc.provider_configuration import ProviderConfiguration, ProviderMetadata, ClientMetadata, \
ClientRegistrationInfo
from flask_pyoidc.user_session import UserSession
Expand Down

0 comments on commit 5fb8da9

Please sign in to comment.