Skip to content

Commit

Permalink
In authnz manager, user_id can be string & should be casted to int.
Browse files Browse the repository at this point in the history
  • Loading branch information
VJalili committed Oct 11, 2018
1 parent b3a1291 commit 6825172
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/galaxy/authnz/managers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@

import copy
import importlib
import json
import logging
import os
import random
import string
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ParseError

Expand All @@ -13,6 +17,7 @@

from galaxy import exceptions
from galaxy import model
from galaxy.util.object_wrapper import SafeStringWrapper
from .psa_authnz import (
BACKENDS_NAME,
on_the_fly_config,
Expand Down Expand Up @@ -176,6 +181,8 @@ def try_get_authz_config(sa_session, user_id, authz_id):
:rtype : model.CloudAuthz
:return: a cloudauthz configuration.
"""
if isinstance(user_id, SafeStringWrapper):
user_id = int(user_id)
qres = sa_session.query(model.CloudAuthz).get(authz_id)
if qres is None:
raise exceptions.ObjectNotFound("An authorization configuration with given ID not found.")
Expand Down Expand Up @@ -260,6 +267,8 @@ def get_cloud_access_credentials(self, cloudauthz, sa_session, user_id, request=
resource provider. See CloudAuthz (https://github.com/galaxyproject/cloudauthz)
for details on the content of this dictionary.
"""
if isinstance(user_id, SafeStringWrapper):
user_id = int(user_id)
config = self._extend_cloudauthz_config(cloudauthz, request, sa_session, user_id)
try:
ca = CloudAuthz()
Expand Down

0 comments on commit 6825172

Please sign in to comment.