Rename setting.
This commit is contained in:
parent
4021441c76
commit
197818566d
6 changed files with 20 additions and 20 deletions
|
@ -148,7 +148,7 @@ class AuthorizeEndpoint(object):
|
|||
Return None.
|
||||
"""
|
||||
expires_at = timezone.now() + timedelta(
|
||||
days=settings.get('OIDC_USER_CONSENT_EXPIRE'))
|
||||
days=settings.get('OIDC_SKIP_CONSENT_EXPIRE'))
|
||||
|
||||
uc, created = UserConsent.objects.get_or_create(
|
||||
user=self.request.user,
|
||||
|
|
|
@ -61,26 +61,26 @@ class DefaultSettings(object):
|
|||
return default_sub_generator
|
||||
|
||||
@property
|
||||
def OIDC_TOKEN_EXPIRE(self):
|
||||
"""
|
||||
OPTIONAL.
|
||||
"""
|
||||
return 60*60
|
||||
|
||||
@property
|
||||
def OIDC_USER_CONSENT_ENABLE(self):
|
||||
def OIDC_SKIP_CONSENT_ENABLE(self):
|
||||
"""
|
||||
OPTIONAL.
|
||||
"""
|
||||
return True
|
||||
|
||||
@property
|
||||
def OIDC_USER_CONSENT_EXPIRE(self):
|
||||
def OIDC_SKIP_CONSENT_EXPIRE(self):
|
||||
"""
|
||||
OPTIONAL.
|
||||
"""
|
||||
return 30*3
|
||||
|
||||
@property
|
||||
def OIDC_TOKEN_EXPIRE(self):
|
||||
"""
|
||||
OPTIONAL.
|
||||
"""
|
||||
return 60*60
|
||||
|
||||
default_settings = DefaultSettings()
|
||||
|
||||
|
||||
|
|
|
@ -244,10 +244,10 @@ class AuthorizationCodeFlowTestCase(TestCase):
|
|||
|
||||
# Ensure user consent skip is enabled.
|
||||
OIDC_AFTER_USERLOGIN_HOOK = settings.default_settings.OIDC_AFTER_USERLOGIN_HOOK
|
||||
OIDC_USER_CONSENT_ENABLE = settings.default_settings.OIDC_USER_CONSENT_ENABLE
|
||||
OIDC_SKIP_CONSENT_ENABLE = settings.default_settings.OIDC_SKIP_CONSENT_ENABLE
|
||||
with self.settings(
|
||||
OIDC_AFTER_USERLOGIN_HOOK=OIDC_AFTER_USERLOGIN_HOOK,
|
||||
OIDC_USER_CONSENT_ENABLE=OIDC_USER_CONSENT_ENABLE):
|
||||
OIDC_SKIP_CONSENT_ENABLE=OIDC_SKIP_CONSENT_ENABLE):
|
||||
response = AuthorizeView.as_view()(request)
|
||||
|
||||
is_code_ok = is_code_valid(url=response['Location'],
|
||||
|
|
|
@ -34,7 +34,7 @@ class AuthorizeView(View):
|
|||
if hook_resp:
|
||||
return hook_resp
|
||||
|
||||
if settings.get('OIDC_USER_CONSENT_ENABLE'):
|
||||
if settings.get('OIDC_SKIP_CONSENT_ENABLE'):
|
||||
# Check if user previously give consent.
|
||||
if authorize.client_has_user_consent():
|
||||
uri = authorize.create_response_uri()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue