Repository: rucio/rucio

Issue:
Implement http-srm protocol
Motivation
----------
Some sites want to be able to enable HTTP as File Transfer Protocol instead of GridFTP. We need to implement a new http-srm protocol and add it to the list of compatible protocol for HTTP(S)/DAV(S)




Discussion:

Resolving patch:
diff --git a/lib/rucio/common/constants.py b/lib/rucio/common/constants.py
--- a/lib/rucio/common/constants.py
+++ b/lib/rucio/common/constants.py
@@ -6,7 +6,7 @@
 #
 # Authors:
 # - Vincent Garonne, <vincent.garonne@cern.ch>, 2013
-# - Cedric Serfon, <cedric.serfon@cern.ch>, 2015-2019
+# - Cedric Serfon, <cedric.serfon@cern.ch>, 2015-2021
 # - Mario Lassnig, <mario.lassnig@cern.ch>, 2018
 #
 # PY3K COMPATIBLE
@@ -29,12 +29,13 @@
 
 SCHEME_MAP = {'srm': ['srm', 'gsiftp'],
               'gsiftp': ['srm', 'gsiftp'],
-              'https': ['https', 'davs', 's3'],
-              'davs': ['https', 'davs', 's3'],
+              'https': ['https', 'davs', 's3', 'srm+https'],
+              'davs': ['https', 'davs', 's3', 'srm+https'],
               'root': ['root'],
-              's3': ['https', 'davs', 's3']}
+              's3': ['https', 'davs', 's3', 'srm+https'],
+              'srm+https': ['https', 'davs', 's3', 'srm+https']}
 
-SUPPORTED_PROTOCOLS = ['gsiftp', 'srm', 'root', 'davs', 'http', 'https', 'file', 's3', 's3+rucio', 's3+https', 'storm']
+SUPPORTED_PROTOCOLS = ['gsiftp', 'srm', 'root', 'davs', 'http', 'https', 'file', 's3', 's3+rucio', 's3+https', 'storm', 'srm+https']
 
 FTS_STATE = namedtuple('FTS_STATE', ['SUBMITTED', 'READY', 'ACTIVE', 'FAILED', 'FINISHED', 'FINISHEDDIRTY',
                                      'CANCELED'])('SUBMITTED', 'READY', 'ACTIVE', 'FAILED', 'FINISHED', 'FINISHEDDIRTY',
diff --git a/lib/rucio/core/transfer.py b/lib/rucio/core/transfer.py
--- a/lib/rucio/core/transfer.py
+++ b/lib/rucio/core/transfer.py
@@ -18,7 +18,7 @@
 # - Martin Barisits <martin.barisits@cern.ch>, 2017-2021
 # - Vincent Garonne <vincent.garonne@cern.ch>, 2017
 # - Igor Mandrichenko <rucio@fermicloud055.fnal.gov>, 2018
-# - Cedric Serfon <cedric.serfon@cern.ch>, 2018-2020
+# - Cedric Serfon <cedric.serfon@cern.ch>, 2018-2021
 # - dciangot <diego.ciangottini@cern.ch>, 2018
 # - Robert Illingworth <illingwo@fnal.gov>, 2018-2019
 # - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2018
@@ -864,6 +864,11 @@ def get_transfer_requests_and_source_replicas(total_workers=0, worker_number=0,
                     source_url = re.sub('davs', 's3s', source_url)
                     source_url = re.sub('https', 's3s', source_url)
 
+                if source_protocol == 'https+srm':
+                    source_url = re.sub('srm', 'https+srm', source_url)
+                if destination_protocol == 'https+srm':
+                    dest_url = re.sub('srm', 'https+srm', dest_url)
+
                 use_ipv4 = rse_attrs[source_rse_id].get('use_ipv4', False) or rse_attrs[dest_rse_id].get('use_ipv4', False)
 
                 # IV - get external_host + strict_copy + archive timeout
@@ -1002,6 +1007,11 @@ def get_transfer_requests_and_source_replicas(total_workers=0, worker_number=0,
                     source_url = re.sub('davs', 's3s', source_url)
                     source_url = re.sub('https', 's3s', source_url)
 
+                if source_protocol == 'https+srm':
+                    source_url = re.sub('srm', 'https+srm', source_url)
+                if destination_protocol == 'https+srm':
+                    dest_url = re.sub('srm', 'https+srm', dest_url)
+
                 # III - The transfer queued previously is a multihop, but this one is direct.
                 # Reset the sources, remove the multihop flag
                 if transfers[req_id].get('multihop', False):


Test patch: