# Propagation improvement
* fixes documentation and variable names on oauth token revocation * introduces private key for propagation * changes key usage in decryption of propagated user data from oauth_client_id to private propagation key
This commit is contained in:
@@ -16,7 +16,7 @@ from django.utils.decorators import method_decorator
|
||||
from django.views import View
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
from konova.sub_settings.sso_settings import OAUTH_CLIENT_ID
|
||||
from konova.sub_settings.sso_settings import PROPAGATION_SECRET
|
||||
from user.models import User
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class PropagateUserView(View):
|
||||
# Decrypt
|
||||
encrypted_body = request.body
|
||||
_hash = hashlib.md5()
|
||||
_hash.update(OAUTH_CLIENT_ID.encode("utf-8"))
|
||||
_hash.update(PROPAGATION_SECRET.encode("utf-8"))
|
||||
key = base64.urlsafe_b64encode(_hash.hexdigest().encode("utf-8"))
|
||||
fernet = Fernet(key)
|
||||
body = fernet.decrypt(encrypted_body).decode("utf-8")
|
||||
|
||||
Reference in New Issue
Block a user