Add Swift support to FTS-REST
Changes including:
- added authentication to Openstack Keystone for Swift. There are two ways for setting credentials (OS tokens) for Swift:
- Manually set OS tokens through CLI
- FTS fetch OS tokens from the Keystone server using OIDC access tokens
- added command-line options
--os-token
(OPTIONAL),--os-project-id
(MANDATORY) for submitting Swift transfers. - added
fts_swift_token_refresh_daemon
for refreshing OS tokens. - added
CSSwift.py
for handling possible requests from WebFTS, e.g., list contents and set OS tokens for Swift.
DB change:
- added column
os_project_id
int_job
. - added column
keystone_url
andkeystone_idp
int_cloudStorage
. - new table
t_cloudCredentialCache
.
Some comments:
- Since
t_cloudCredentialCache
has no DB relation witht_cloudStorageUser
, extra checks on the user are performed before setting cloud credentials. Although logically there should be a one-to-many relationship betweent_cloudStorageUser
andt_cloudCredentialCache
, it doesn't make sense to me to addvo
tot_cloudCredentialCache
to form a composite foreign key withcloudStorage_name
anduser_dn
becausevo
has no use for the table. - Any cloud storage user would be able to indirectly alter
t_cloudCredentialCache
because this is linked to transfers. However, this exposes risks that users might add an arbitrary number of rows in the table, so I added an extra check before adding/setting the row to see if the added credentials are valid. - Please add the required python packages (keystoneauth1 and python-keystoneclient) to the docker image so that the pipeline can work.
- At the time being, you can submit Swift transfer with:
fts-rest-transfer-submit -s https://<fts> --access-token $tok swifts://<source> swifts://<dest> --os-project-id "<source_project_id>:<dest_project_id>" --os-token "<project_id>:<corresponding_os_token>"
After we have FENIX AAI properly set up, you can submit the transfer without specifying --os-token
.