mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
automatically encrypt/decrypt main_oauth2application.client_secret
see: https://github.com/ansible/awx/issues/1416
This commit is contained in:
@@ -9,6 +9,9 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
# Django OAuth Toolkit
|
||||
from oauth2_provider.models import AbstractApplication, AbstractAccessToken
|
||||
from oauth2_provider.generators import generate_client_secret
|
||||
|
||||
from awx.main.fields import OAuth2ClientSecretField
|
||||
|
||||
|
||||
DATA_URI_RE = re.compile(r'.*') # FIXME
|
||||
@@ -39,6 +42,10 @@ class OAuth2Application(AbstractApplication):
|
||||
null=True,
|
||||
)
|
||||
|
||||
client_secret = OAuth2ClientSecretField(
|
||||
max_length=1024, blank=True, default=generate_client_secret, db_index=True
|
||||
)
|
||||
|
||||
|
||||
class OAuth2AccessToken(AbstractAccessToken):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user