health check to /health, updated testing of /health, cleaned up extraneous debug logging

This commit is contained in:
David Kennedy 2024-02-07 13:08:26 -05:00
parent 7b64929d60
commit 2a676260c6
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
6 changed files with 39 additions and 20 deletions

View file

@ -27,7 +27,6 @@ class Client(oic.Client):
"""Step 1: Configure the OpenID Connect client."""
logger.debug("Initializing the OpenID Connect client...")
try:
logger.debug("__init__ first try")
provider = settings.OIDC_PROVIDERS[op]
verify_ssl = getattr(settings, "OIDC_VERIFY_SSL", True)
except Exception as err:
@ -36,7 +35,6 @@ class Client(oic.Client):
raise o_e.InternalError()
try:
logger.debug("__init__ second try")
# prepare private key for authentication method of private_key_jwt
key_bundle = keyio.KeyBundle()
rsa_key = importKey(provider["client_registration"]["sp_private_key"])
@ -53,7 +51,6 @@ class Client(oic.Client):
raise o_e.InternalError()
try:
logger.debug("__init__ third try")
# create the oic client instance
super().__init__(
client_id=None,
@ -73,7 +70,6 @@ class Client(oic.Client):
raise o_e.InternalError()
try:
logger.debug("__init__ fourth try")
# discover and store the provider (OP) urls, etc
self.provider_config(provider["srv_discovery_url"])
self.store_registration_info(RegistrationResponse(**provider["client_registration"]))
@ -84,7 +80,6 @@ class Client(oic.Client):
provider["srv_discovery_url"],
)
raise o_e.InternalError()
logger.debug("__init__ finished initializing")
def create_authn_request(
self,

View file

@ -16,7 +16,6 @@ from registrar.models import User
logger = logging.getLogger(__name__)
try:
logger.debug("oidc views initializing provider")
# Initialize provider using pyOICD
OP = getattr(settings, "OIDC_ACTIVE_PROVIDER")
CLIENT = Client(OP)
@ -56,7 +55,6 @@ def error_page(request, error):
def openid(request):
"""Redirect the user to an authentication provider (OP)."""
logger.debug("in openid")
# If the session reset because of a server restart, attempt to login again
request.session["acr_value"] = CLIENT.get_default_acr_value()
@ -70,7 +68,6 @@ def openid(request):
def login_callback(request):
"""Analyze the token returned by the authentication provider (OP)."""
logger.debug("in login_callback")
try:
query = parse_qs(request.GET.urlencode())
userinfo = CLIENT.callback(query, request.session)