Commit 5a8dad01 authored by Mihai Patrascoiu's avatar Mihai Patrascoiu
Browse files

Merge branch 'develop' for release 3.10.1

parents d85420fb 092d3a3f
Pipeline #2311852 passed with stage
in 2 minutes and 13 seconds
......@@ -59,16 +59,30 @@ The endpoint to use corresponds to the FTS instance REST server and it must have
`https://<host>:<port>`
for instance https://fts3.cern.ch:8446
Example: https://fts3.cern.ch:8446
If you are using a proxy certificate, you can either specify only user_certificate, or point both parameters
to the proxy.
user_certificate and user_key can be safely omitted, and the program will use the values
defined in the environment variables `X509_USER_PROXY` or `X509_USER_CERT + X509_USER_KEY`.
The user_certificate and user_key parameters can be safely omitted, and the program will use
the values defined in the `X509_USER_PROXY` or `X509_USER_CERT + X509_USER_KEY` environment variables.
If verify is False, the server certificate will not be verified.
#### get_endpoint_info
The `Context` object provides a method `get_endpoint_info()` to retrieve information
about the endpoint, after it has passed validation. This method returns a dictionary
with relevant information about the endpoint:
- url: the endpoint URL string
- delegation: `{major, minor, patch}` delegation version dictionary
- core: `{major, minor, patch}` FTS server version dictionary
- api: `{major, minor, patch}` REST API version dictionary
- schema: `{major, minor, patch}` schema version dictionary
Note: the same info can be obtained via a GET request
to the `https://<host>:<port>/` address of the FTS REST endpoint
### whoami
Queries the server to see how does it see us
......
......@@ -4,7 +4,7 @@
%{!?nosetest_path: %global nosetest_path "/tmp"}
Name: fts-rest
Version: 3.10.0
Version: 3.10.1
Release: 1%{?dist}
BuildArch: noarch
Summary: FTS3 Rest Interface
......@@ -350,6 +350,9 @@ EOF
%changelog
* Fri Feb 12 2021 Mihai Patrascoiu <mihai.patrascoiu@cern.ch> - 3.10.1-1
- New bugfix release
* Mon Dec 07 2020 Mihai Patrascoiu <mihai.patrascoiu@cern.ch> - 3.10.0-1
- New Minor release
- OIDC Tokens Integration
......
......@@ -64,7 +64,7 @@ base_dir = os.path.dirname(__file__)
setup(
name='fts3-rest',
version='3.10.0',
version='3.10.1',
description='FTS3 Python Libraries',
long_description='FTS3 Python Libraries',
author='FTS3 Developers',
......
......@@ -220,8 +220,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):
......
......@@ -28,7 +28,7 @@ from fts3rest.lib.base import BaseController, Session
from fts3rest.lib.helpers import jsonify
from fts3rest.lib import api
API_VERSION = dict(major=3, minor=10, patch=0)
API_VERSION = dict(major=3, minor=10, patch=1)
def _get_fts_core_version():
......
......@@ -99,7 +99,7 @@ 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:
......
......@@ -20,6 +20,7 @@ import time
import types
import uuid
import pylons
import json
from datetime import datetime
from urlparse import urlparse,parse_qsl, ParseResult
......@@ -102,6 +103,8 @@ def _validate_url(url):
raise ValueError('Missing host (%s)' % url.geturl())
def _metadata(data):
if isinstance(data, dict):
return data
try:
return json.loads(data)
except:
......
......@@ -576,11 +576,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