Commit 2f50d246 authored by Duggan, John's avatar Duggan, John
Browse files

Merge branch '146-fix-nameerror-in-custos_authnz-py' into 'dev'

Fix NameError in custos_authnz.py

Closes #146

See merge request !139
parents 743f8b89 50ab35b8
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@ variables:
  CONTAINER_GALAXY_URL: "${NDIP_DOCKER_REPOSITORY}/${CI_PROJECT_PATH}"
  CONTAINER_GALAXY_BASE_URL: "${CONTAINER_GALAXY_URL}/base"
  CONTAINER_GALAXY_COMMIT_URL: "${CONTAINER_GALAXY_URL}/commit"
  GALAXY_VERSION_PYTHON: 25.1.dev1+ornl
  GALAXY_VERSION_DOCKER: 25.1.dev1.ornl
  GALAXY_VERSION_PYTHON: 25.1.dev2+ornl
  GALAXY_VERSION_DOCKER: 25.1.dev2.ornl

# This import is for the func_rse_docker_* functions
before_script:
+1 −2
Original line number Diff line number Diff line
@@ -168,7 +168,6 @@ class OIDCAuthnzBase(IdentityProvider):
        custos_authnz_token.refresh_expiration_time = processed_token["refresh_expiration_time"]

        sa_session.add(custos_authnz_token)
        with transaction(sa_session):
        sa_session.commit()

        log.debug(
+14 −7
Original line number Diff line number Diff line
@@ -230,12 +230,20 @@ class PSAAuthnz(IdentityProvider):
        return False

    def _try_to_locate_refresh_token_expiration(self, extra_data):
        try:
            # Azure provides the number of seconds to expiration in the extra_data
            return (
                extra_data.get("expires", None)
                or extra_data.get("expires_in", None)
                or extra_data["refresh_token"].get("expires", None)
                or extra_data["refresh_token"].get("expires_in", None)
            )
        except Exception:
            # Keycloak provides an expiration timestamp in the id token
            decoded_id_token = jwt.decode(
                extra_data["id_token"], options={"verify_signature": False}
            )
            return decoded_id_token.get("exp") - decoded_id_token.get("auth_time")

    def authenticate(self, trans, idphint=None):
        on_the_fly_config(trans.sa_session)
@@ -299,7 +307,6 @@ class PSAAuthnz(IdentityProvider):
            if self.config.get("well_known_oidc_config_uri", None)
            else self._get_well_known_uri_from_url(self.config["provider"])
        )
        well_known_oidc_config = None
        try:
            well_known_oidc_config = requests.get(
                well_known_oidc_config_uri,