Browse Source

Experiment with monkey patch

pull/172/head
Michael Olund 5 years ago
parent
commit
85ad0565c8
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      edivorce/settings/openshift.py

+ 11
- 1
edivorce/settings/openshift.py View File

@ -1,3 +1,4 @@
from mozilla_django_oidc import utils
from .base import * from .base import *
@ -72,7 +73,7 @@ if DEPLOYMENT_TYPE == 'dev':
OIDC_OP_AUTHORIZATION_ENDPOINT = 'http://localhost:8081/auth/realms/justice/protocol/openid-connect/auth' OIDC_OP_AUTHORIZATION_ENDPOINT = 'http://localhost:8081/auth/realms/justice/protocol/openid-connect/auth'
OIDC_OP_TOKEN_ENDPOINT = 'http://localhost:8081/auth/realms/justice/protocol/openid-connect/token' OIDC_OP_TOKEN_ENDPOINT = 'http://localhost:8081/auth/realms/justice/protocol/openid-connect/token'
OIDC_OP_USER_ENDPOINT = 'http://localhost:8081/auth/realms/justice/protocol/openid-connect/userinfo' OIDC_OP_USER_ENDPOINT = 'http://localhost:8081/auth/realms/justice/protocol/openid-connect/userinfo'
OIDC_RP_CLIENT_ID = 'edivorce-app'
OIDC_RP_CLIENT_ID = 'edivorce-dev'
# end of temporary settings # end of temporary settings
if DEPLOYMENT_TYPE == 'test': if DEPLOYMENT_TYPE == 'test':
@ -144,3 +145,12 @@ REDIS_PASSWORD = os.getenv('REDIS_PASSWORD', '')
# Keycloak OpenID Connect settings # Keycloak OpenID Connect settings
LOGIN_REDIRECT_URL = PROXY_URL_PREFIX + '/signin' LOGIN_REDIRECT_URL = PROXY_URL_PREFIX + '/signin'
LOGOUT_REDIRECT_URL = PROXY_URL_PREFIX LOGOUT_REDIRECT_URL = PROXY_URL_PREFIX
def monkey_absolutify(request, path):
return PROXY_BASE_URL + path
# monkey-patching mozilla_django_oidc.utils.absolutify so it doesn't
# return urls prefixed with 'http://edivorce-django:8080' on OpenShift
utils.absolutify = monkey_absolutify

Loading…
Cancel
Save