Commit 1ade1e3d authored by Joao Pedro Lopes's avatar Joao Pedro Lopes
Browse files

FTS-1731: Match with FTS-REST v3.10.1

 The following commits have been migrated with this contribution:

  - fts-rest@c82e96dc
  - fts-rest@dcbe8b8a
  - fts-rest@103fe48d
  - fts-rest@1ef56c91
parent 439f2613
Pipeline #3115889 passed with stages
in 11 minutes and 54 seconds
......@@ -324,8 +324,10 @@ class JobSubmitter(Base):
params[k] = v
# JSONify metadata
params["job_metadata"] = _metadata(params["job_metadata"])
params["file_metadata"] = _metadata(params["file_metadata"])
if params["job_metadata"] is not None:
params["job_metadata"] = _metadata(params["job_metadata"])
if params["file_metadata"] is not None:
params["file_metadata"] = _metadata(params["file_metadata"])
return params
def _prepare_options(self):
......
......@@ -124,7 +124,10 @@ class IAMTokenRefresher(Thread):
for credential in credentials:
try:
credential = oidc_manager.refresh_access_token(credential)
log.debug("OK refresh_access_token")
log.debug(
"OK refresh_access_token (exp=%s)"
% str(credential.termination_time)
)
Session.merge(credential)
Session.commit()
except Exception as ex:
......
......@@ -90,6 +90,8 @@ def validate_url(url):
def metadata(data):
if isinstance(data, dict):
return data
try:
return json.loads(data)
except:
......
......@@ -572,11 +572,9 @@ class ResourceProvider(Provider):
def get_authorization(self):
"""Get authorization object representing status of authentication."""
log.info("get_authorization")
auth = self.authorization_class()
header = self.get_authorization_header()
if not header or not header.split:
log.info("no header")
return auth
header = header.split()
if len(header) > 1 and header[0] == "Bearer":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment