-
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.
python3 hhnb version with general improvements
- Loading branch information
Showing
609 changed files
with
90,870 additions
and
82,100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
*.log | ||
*.pyc | ||
*.swp | ||
*.swo | ||
*.swn | ||
*.log | ||
.idea/ | ||
.vscode/ | ||
|
||
*/migrations/ | ||
|
||
*/migrations/ | ||
|
||
packages | ||
venvbspg | ||
letsencrypt | ||
media | ||
db.sqlite3 | ||
bower_components | ||
bspg/debug.py | ||
bspg/bspg_keys | ||
static_pool | ||
sitemap | ||
static/sitemap | ||
efelg_access.log | ||
hhnb_access.log | ||
|
||
|
||
hh_neuron_builder/config/dev_conf.py | ||
hh_neuron_builder/config/prod_conf.py |
0
ACKNOWLEDGEMENTS.txt → ACKNOWLEDGEMENTS
100644 → 100755
File renamed without changes.
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
0
bsp_monitor/__init__.py → auth/__init__.py
100644 → 100755
File renamed without changes.
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,33 @@ | ||
from mozilla_django_oidc.auth import OIDCAuthenticationBackend, SuspiciousOperation, LOGGER | ||
from hhnb.models import MyUser as User | ||
|
||
|
||
class MyOIDCBackend(OIDCAuthenticationBackend): | ||
|
||
def get_or_create_user(self, access_token, id_token, payload): | ||
print('[MyOIDCBackend] get_or_create_user() called.') | ||
|
||
user_info = self.get_userinfo(access_token, id_token, payload) | ||
|
||
email = user_info.get('email') | ||
username = user_info.get('preferred_username') | ||
|
||
claims_verified = self.verify_claims(user_info) | ||
if not claims_verified: | ||
msg = 'Claims verification failed' | ||
raise SuspiciousOperation(msg) | ||
|
||
# email based filtering | ||
# users = self.filter_users_by_claims(user_info) | ||
try: | ||
return User.objects.get(email=email, username=username) | ||
except User.DoesNotExist: | ||
user = User( | ||
username=user_info.get('preferred_username'), | ||
email=user_info.get('email'), | ||
first_name=user_info.get('given_name', ''), | ||
last_name=user_info.get('family_name', ''), | ||
name=user_info.get('name', '') | ||
) | ||
user.save() | ||
return user |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.