rucio 35.7.0__py3-none-any.whl → 37.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rucio might be problematic. Click here for more details.
- rucio/alembicrevision.py +1 -1
- rucio/{daemons/c3po/collectors → cli}/__init__.py +1 -0
- rucio/cli/account.py +216 -0
- rucio-35.7.0.data/scripts/rucio → rucio/cli/bin_legacy/rucio.py +769 -486
- rucio-35.7.0.data/scripts/rucio-admin → rucio/cli/bin_legacy/rucio_admin.py +476 -423
- rucio/cli/command.py +272 -0
- rucio/cli/config.py +72 -0
- rucio/cli/did.py +191 -0
- rucio/cli/download.py +128 -0
- rucio/cli/lifetime_exception.py +33 -0
- rucio/cli/replica.py +162 -0
- rucio/cli/rse.py +293 -0
- rucio/cli/rule.py +158 -0
- rucio/cli/scope.py +40 -0
- rucio/cli/subscription.py +73 -0
- rucio/cli/upload.py +60 -0
- rucio/cli/utils.py +226 -0
- rucio/client/accountclient.py +0 -1
- rucio/client/baseclient.py +33 -24
- rucio/client/client.py +45 -1
- rucio/client/didclient.py +5 -3
- rucio/client/downloadclient.py +6 -8
- rucio/client/replicaclient.py +0 -2
- rucio/client/richclient.py +317 -0
- rucio/client/rseclient.py +4 -4
- rucio/client/uploadclient.py +26 -12
- rucio/common/bittorrent.py +234 -0
- rucio/common/cache.py +66 -29
- rucio/common/checksum.py +168 -0
- rucio/common/client.py +122 -0
- rucio/common/config.py +22 -35
- rucio/common/constants.py +61 -3
- rucio/common/didtype.py +72 -24
- rucio/common/dumper/__init__.py +45 -38
- rucio/common/dumper/consistency.py +75 -30
- rucio/common/dumper/data_models.py +63 -19
- rucio/common/dumper/path_parsing.py +19 -8
- rucio/common/exception.py +65 -8
- rucio/common/extra.py +5 -10
- rucio/common/logging.py +13 -13
- rucio/common/pcache.py +8 -7
- rucio/common/plugins.py +59 -27
- rucio/common/policy.py +12 -3
- rucio/common/schema/__init__.py +84 -34
- rucio/common/schema/generic.py +0 -17
- rucio/common/schema/generic_multi_vo.py +0 -17
- rucio/common/test_rucio_server.py +12 -6
- rucio/common/types.py +132 -52
- rucio/common/utils.py +93 -643
- rucio/core/account_limit.py +14 -12
- rucio/core/authentication.py +2 -2
- rucio/core/config.py +23 -42
- rucio/core/credential.py +14 -15
- rucio/core/did.py +5 -1
- rucio/core/did_meta_plugins/elasticsearch_meta.py +407 -0
- rucio/core/did_meta_plugins/filter_engine.py +62 -3
- rucio/core/did_meta_plugins/json_meta.py +2 -2
- rucio/core/did_meta_plugins/mongo_meta.py +43 -30
- rucio/core/did_meta_plugins/postgres_meta.py +75 -39
- rucio/core/identity.py +6 -5
- rucio/core/importer.py +4 -3
- rucio/core/lifetime_exception.py +2 -2
- rucio/core/lock.py +8 -7
- rucio/core/message.py +6 -0
- rucio/core/monitor.py +30 -29
- rucio/core/naming_convention.py +2 -2
- rucio/core/nongrid_trace.py +2 -2
- rucio/core/oidc.py +11 -9
- rucio/core/permission/__init__.py +79 -37
- rucio/core/permission/generic.py +1 -7
- rucio/core/permission/generic_multi_vo.py +1 -7
- rucio/core/quarantined_replica.py +4 -3
- rucio/core/replica.py +464 -139
- rucio/core/replica_sorter.py +55 -59
- rucio/core/request.py +34 -32
- rucio/core/rse.py +301 -97
- rucio/core/rse_counter.py +1 -2
- rucio/core/rse_expression_parser.py +7 -7
- rucio/core/rse_selector.py +9 -7
- rucio/core/rule.py +41 -40
- rucio/core/rule_grouping.py +42 -40
- rucio/core/scope.py +5 -4
- rucio/core/subscription.py +26 -28
- rucio/core/topology.py +11 -11
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +29 -15
- rucio/core/volatile_replica.py +4 -3
- rucio/daemons/atropos/atropos.py +1 -1
- rucio/daemons/auditor/__init__.py +2 -2
- rucio/daemons/auditor/srmdumps.py +6 -6
- rucio/daemons/automatix/automatix.py +32 -21
- rucio/daemons/badreplicas/necromancer.py +2 -2
- rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/common.py +15 -25
- rucio/daemons/conveyor/finisher.py +2 -2
- rucio/daemons/conveyor/poller.py +18 -28
- rucio/daemons/conveyor/receiver.py +2 -2
- rucio/daemons/conveyor/stager.py +1 -0
- rucio/daemons/conveyor/submitter.py +3 -3
- rucio/daemons/hermes/hermes.py +91 -30
- rucio/daemons/judge/evaluator.py +2 -2
- rucio/daemons/oauthmanager/oauthmanager.py +3 -3
- rucio/daemons/reaper/dark_reaper.py +7 -3
- rucio/daemons/reaper/reaper.py +12 -16
- rucio/daemons/rsedecommissioner/config.py +1 -1
- rucio/daemons/rsedecommissioner/profiles/generic.py +5 -4
- rucio/daemons/rsedecommissioner/profiles/types.py +7 -6
- rucio/daemons/rsedecommissioner/rse_decommissioner.py +1 -1
- rucio/daemons/storage/consistency/actions.py +8 -6
- rucio/daemons/tracer/kronos.py +4 -4
- rucio/db/sqla/constants.py +5 -0
- rucio/db/sqla/migrate_repo/versions/1677d4d803c8_split_rse_availability_into_multiple.py +4 -4
- rucio/db/sqla/migrate_repo/versions/30d5206e9cad_increase_oauthrequest_redirect_msg_.py +37 -0
- rucio/db/sqla/models.py +157 -154
- rucio/db/sqla/session.py +58 -27
- rucio/db/sqla/types.py +2 -2
- rucio/db/sqla/util.py +2 -2
- rucio/gateway/account.py +18 -12
- rucio/gateway/account_limit.py +137 -60
- rucio/gateway/authentication.py +18 -12
- rucio/gateway/config.py +30 -20
- rucio/gateway/credential.py +9 -10
- rucio/gateway/did.py +70 -53
- rucio/gateway/dirac.py +6 -4
- rucio/gateway/exporter.py +3 -2
- rucio/gateway/heartbeat.py +6 -4
- rucio/gateway/identity.py +36 -51
- rucio/gateway/importer.py +3 -2
- rucio/gateway/lifetime_exception.py +3 -2
- rucio/gateway/meta_conventions.py +17 -6
- rucio/gateway/permission.py +4 -1
- rucio/gateway/quarantined_replica.py +3 -2
- rucio/gateway/replica.py +31 -22
- rucio/gateway/request.py +27 -18
- rucio/gateway/rse.py +69 -37
- rucio/gateway/rule.py +46 -26
- rucio/gateway/scope.py +3 -2
- rucio/gateway/subscription.py +14 -11
- rucio/gateway/vo.py +12 -8
- rucio/rse/__init__.py +3 -3
- rucio/rse/protocols/bittorrent.py +11 -1
- rucio/rse/protocols/cache.py +0 -11
- rucio/rse/protocols/dummy.py +0 -11
- rucio/rse/protocols/gfal.py +14 -9
- rucio/rse/protocols/globus.py +1 -1
- rucio/rse/protocols/http_cache.py +1 -1
- rucio/rse/protocols/posix.py +2 -2
- rucio/rse/protocols/protocol.py +84 -317
- rucio/rse/protocols/rclone.py +2 -1
- rucio/rse/protocols/rfio.py +10 -1
- rucio/rse/protocols/ssh.py +2 -1
- rucio/rse/protocols/storm.py +2 -13
- rucio/rse/protocols/webdav.py +74 -30
- rucio/rse/protocols/xrootd.py +2 -1
- rucio/rse/rsemanager.py +170 -53
- rucio/rse/translation.py +260 -0
- rucio/tests/common.py +23 -13
- rucio/tests/common_server.py +26 -9
- rucio/transfertool/bittorrent.py +15 -14
- rucio/transfertool/bittorrent_driver.py +5 -7
- rucio/transfertool/bittorrent_driver_qbittorrent.py +9 -8
- rucio/transfertool/fts3.py +20 -16
- rucio/transfertool/mock.py +2 -3
- rucio/vcsversion.py +4 -4
- rucio/version.py +7 -0
- rucio/web/rest/flaskapi/v1/accounts.py +17 -3
- rucio/web/rest/flaskapi/v1/auth.py +5 -5
- rucio/web/rest/flaskapi/v1/credentials.py +3 -2
- rucio/web/rest/flaskapi/v1/dids.py +21 -15
- rucio/web/rest/flaskapi/v1/identities.py +33 -9
- rucio/web/rest/flaskapi/v1/redirect.py +5 -4
- rucio/web/rest/flaskapi/v1/replicas.py +12 -8
- rucio/web/rest/flaskapi/v1/rses.py +15 -4
- rucio/web/rest/flaskapi/v1/traces.py +56 -19
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/alembic.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/alembic_offline.ini.template +1 -1
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +3 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio.cfg.template +3 -19
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +1 -18
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/requirements.server.txt +97 -68
- rucio-37.0.0.data/scripts/rucio +133 -0
- rucio-37.0.0.data/scripts/rucio-admin +97 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-atropos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-auditor +2 -1
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-automatix +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-cache-client +17 -10
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-receiver +1 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-kronos +1 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-minos +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-minos-temporary-expiration +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-necromancer +2 -2
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-reaper +6 -6
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-transmogrifier +2 -2
- rucio-37.0.0.dist-info/METADATA +92 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/RECORD +237 -243
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/licenses/AUTHORS.rst +3 -0
- rucio/common/schema/atlas.py +0 -413
- rucio/common/schema/belleii.py +0 -408
- rucio/common/schema/domatpc.py +0 -401
- rucio/common/schema/escape.py +0 -426
- rucio/common/schema/icecube.py +0 -406
- rucio/core/permission/atlas.py +0 -1348
- rucio/core/permission/belleii.py +0 -1077
- rucio/core/permission/escape.py +0 -1078
- rucio/daemons/c3po/algorithms/__init__.py +0 -13
- rucio/daemons/c3po/algorithms/simple.py +0 -134
- rucio/daemons/c3po/algorithms/t2_free_space.py +0 -128
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop.py +0 -130
- rucio/daemons/c3po/algorithms/t2_free_space_only_pop_with_network.py +0 -294
- rucio/daemons/c3po/c3po.py +0 -371
- rucio/daemons/c3po/collectors/agis.py +0 -108
- rucio/daemons/c3po/collectors/free_space.py +0 -81
- rucio/daemons/c3po/collectors/jedi_did.py +0 -57
- rucio/daemons/c3po/collectors/mock_did.py +0 -51
- rucio/daemons/c3po/collectors/network_metrics.py +0 -71
- rucio/daemons/c3po/collectors/workload.py +0 -112
- rucio/daemons/c3po/utils/__init__.py +0 -13
- rucio/daemons/c3po/utils/dataset_cache.py +0 -50
- rucio/daemons/c3po/utils/expiring_dataset_cache.py +0 -56
- rucio/daemons/c3po/utils/expiring_list.py +0 -62
- rucio/daemons/c3po/utils/popularity.py +0 -85
- rucio/daemons/c3po/utils/timeseries.py +0 -89
- rucio/rse/protocols/gsiftp.py +0 -92
- rucio-35.7.0.data/scripts/rucio-c3po +0 -85
- rucio-35.7.0.dist-info/METADATA +0 -72
- /rucio/{daemons/c3po → cli/bin_legacy}/__init__.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-account +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-rse +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-throttler +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-dumper +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-follower +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-hermes +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-cleaner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-replica-recoverer +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-undertaker +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/WHEEL +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/top_level.txt +0 -0
rucio/gateway/rse.py
CHANGED
|
@@ -30,11 +30,27 @@ if TYPE_CHECKING:
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
@transactional_session
|
|
33
|
-
def add_rse(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
def add_rse(
|
|
34
|
+
rse,
|
|
35
|
+
issuer,
|
|
36
|
+
vo='def',
|
|
37
|
+
deterministic=True,
|
|
38
|
+
volatile=False,
|
|
39
|
+
city=None,
|
|
40
|
+
region_code=None,
|
|
41
|
+
country_name=None,
|
|
42
|
+
continent=None,
|
|
43
|
+
time_zone=None,
|
|
44
|
+
ISP=None, # noqa: N803
|
|
45
|
+
staging_area=False,
|
|
46
|
+
rse_type=None,
|
|
47
|
+
latitude=None,
|
|
48
|
+
longitude=None,
|
|
49
|
+
ASN=None, # noqa: N803
|
|
50
|
+
availability_read: "Optional[bool]" = None,
|
|
51
|
+
availability_write: "Optional[bool]" = None,
|
|
52
|
+
availability_delete: "Optional[bool]" = None, *, session: "Session"
|
|
53
|
+
):
|
|
38
54
|
"""
|
|
39
55
|
Creates a new Rucio Storage Element(RSE).
|
|
40
56
|
|
|
@@ -61,8 +77,9 @@ def add_rse(rse, issuer, vo='def', deterministic=True, volatile=False, city=None
|
|
|
61
77
|
"""
|
|
62
78
|
validate_schema(name='rse', obj=rse, vo=vo)
|
|
63
79
|
kwargs = {'rse': rse}
|
|
64
|
-
|
|
65
|
-
|
|
80
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='add_rse', kwargs=kwargs, session=session)
|
|
81
|
+
if not auth_result.allowed:
|
|
82
|
+
raise exception.AccessDenied('Account %s can not add RSE. %s' % (issuer, auth_result.message))
|
|
66
83
|
|
|
67
84
|
return rse_module.add_rse(rse, vo=vo, deterministic=deterministic, volatile=volatile, city=city,
|
|
68
85
|
region_code=region_code, country_name=country_name, staging_area=staging_area,
|
|
@@ -102,8 +119,9 @@ def del_rse(rse, issuer, vo='def', *, session: "Session"):
|
|
|
102
119
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
103
120
|
|
|
104
121
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='del_rse', kwargs=kwargs, session=session)
|
|
123
|
+
if not auth_result.allowed:
|
|
124
|
+
raise exception.AccessDenied('Account %s can not delete RSE. %s' % (issuer, auth_result.message))
|
|
107
125
|
|
|
108
126
|
return rse_module.del_rse(rse_id, session=session)
|
|
109
127
|
|
|
@@ -142,8 +160,9 @@ def del_rse_attribute(rse, key, issuer, vo='def', *, session: "Session"):
|
|
|
142
160
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
143
161
|
|
|
144
162
|
kwargs = {'rse': rse, 'rse_id': rse_id, 'key': key}
|
|
145
|
-
|
|
146
|
-
|
|
163
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='del_rse_attribute', kwargs=kwargs, session=session)
|
|
164
|
+
if not auth_result.allowed:
|
|
165
|
+
raise exception.AccessDenied('Account %s can not delete RSE attributes. %s' % (issuer, auth_result.message))
|
|
147
166
|
|
|
148
167
|
return rse_module.del_rse_attribute(rse_id=rse_id, key=key, session=session)
|
|
149
168
|
|
|
@@ -164,8 +183,9 @@ def add_rse_attribute(rse, key, value, issuer, vo='def', *, session: "Session"):
|
|
|
164
183
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
165
184
|
|
|
166
185
|
kwargs = {'rse': rse, 'rse_id': rse_id, 'key': key, 'value': value}
|
|
167
|
-
|
|
168
|
-
|
|
186
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='add_rse_attribute', kwargs=kwargs, session=session)
|
|
187
|
+
if not auth_result.allowed:
|
|
188
|
+
raise exception.AccessDenied('Account %s can not add RSE attributes. %s' % (issuer, auth_result.message))
|
|
169
189
|
|
|
170
190
|
return rse_module.add_rse_attribute(rse_id=rse_id, key=key, value=value, session=session)
|
|
171
191
|
|
|
@@ -227,8 +247,9 @@ def add_protocol(rse, issuer, vo='def', *, session: "Session", **data):
|
|
|
227
247
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
228
248
|
|
|
229
249
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
230
|
-
|
|
231
|
-
|
|
250
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='add_protocol', kwargs=kwargs, session=session)
|
|
251
|
+
if not auth_result.allowed:
|
|
252
|
+
raise exception.AccessDenied('Account %s can not add protocols to RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
232
253
|
rse_module.add_protocol(rse_id, data['data'], session=session)
|
|
233
254
|
|
|
234
255
|
|
|
@@ -265,8 +286,9 @@ def del_protocols(rse, scheme, issuer, vo='def', hostname=None, port=None, *, se
|
|
|
265
286
|
"""
|
|
266
287
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
267
288
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
268
|
-
|
|
269
|
-
|
|
289
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='del_protocol', kwargs=kwargs, session=session)
|
|
290
|
+
if not auth_result.allowed:
|
|
291
|
+
raise exception.AccessDenied('Account %s can not delete protocols from RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
270
292
|
rse_module.del_protocols(rse_id=rse_id, scheme=scheme, hostname=hostname, port=port, session=session)
|
|
271
293
|
|
|
272
294
|
|
|
@@ -286,8 +308,9 @@ def update_protocols(rse, scheme, data, issuer, vo='def', hostname=None, port=No
|
|
|
286
308
|
"""
|
|
287
309
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
288
310
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
289
|
-
|
|
290
|
-
|
|
311
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='update_protocol', kwargs=kwargs, session=session)
|
|
312
|
+
if not auth_result.allowed:
|
|
313
|
+
raise exception.AccessDenied('Account %s can not update protocols from RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
291
314
|
rse_module.update_protocols(rse_id=rse_id, scheme=scheme, hostname=hostname, port=port, data=data, session=session)
|
|
292
315
|
|
|
293
316
|
|
|
@@ -310,8 +333,9 @@ def set_rse_usage(rse, source, used, free, issuer, files=None, vo='def', *, sess
|
|
|
310
333
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
311
334
|
|
|
312
335
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
313
|
-
|
|
314
|
-
|
|
336
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='set_rse_usage', kwargs=kwargs, session=session)
|
|
337
|
+
if not auth_result.allowed:
|
|
338
|
+
raise exception.AccessDenied('Account %s can not update RSE usage information for RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
315
339
|
|
|
316
340
|
return rse_module.set_rse_usage(rse_id=rse_id, source=source, used=used, free=free, files=files, session=session)
|
|
317
341
|
|
|
@@ -374,8 +398,9 @@ def set_rse_limits(rse, name, value, issuer, vo='def', *, session: "Session"):
|
|
|
374
398
|
"""
|
|
375
399
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
376
400
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
377
|
-
|
|
378
|
-
|
|
401
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='set_rse_limits', kwargs=kwargs, session=session)
|
|
402
|
+
if not auth_result.allowed:
|
|
403
|
+
raise exception.AccessDenied('Account %s can not update RSE limits for RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
379
404
|
|
|
380
405
|
return rse_module.set_rse_limits(rse_id=rse_id, name=name, value=value, session=session)
|
|
381
406
|
|
|
@@ -395,8 +420,9 @@ def delete_rse_limits(rse, name, issuer, vo='def', *, session: "Session"):
|
|
|
395
420
|
"""
|
|
396
421
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
397
422
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
398
|
-
|
|
399
|
-
|
|
423
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='delete_rse_limits', kwargs=kwargs, session=session)
|
|
424
|
+
if not auth_result.allowed:
|
|
425
|
+
raise exception.AccessDenied('Account %s can not update RSE limits for RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
400
426
|
|
|
401
427
|
return rse_module.delete_rse_limits(rse_id=rse_id, name=name, session=session)
|
|
402
428
|
|
|
@@ -448,8 +474,9 @@ def update_rse(rse, parameters, issuer, vo='def', *, session: "Session"):
|
|
|
448
474
|
"""
|
|
449
475
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
450
476
|
kwargs = {'rse': rse, 'rse_id': rse_id}
|
|
451
|
-
|
|
452
|
-
|
|
477
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='update_rse', kwargs=kwargs, session=session)
|
|
478
|
+
if not auth_result.allowed:
|
|
479
|
+
raise exception.AccessDenied('Account %s can not update RSE. %s' % (issuer, auth_result.message))
|
|
453
480
|
return rse_module.update_rse(rse_id=rse_id, parameters=parameters, session=session)
|
|
454
481
|
|
|
455
482
|
|
|
@@ -466,8 +493,9 @@ def add_distance(source, destination, issuer, vo='def', distance=None, *, sessio
|
|
|
466
493
|
:param session: The database session in use.
|
|
467
494
|
"""
|
|
468
495
|
kwargs = {'source': source, 'destination': destination}
|
|
469
|
-
|
|
470
|
-
|
|
496
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='add_distance', kwargs=kwargs, session=session)
|
|
497
|
+
if not auth_result.allowed:
|
|
498
|
+
raise exception.AccessDenied('Account %s can not add RSE distances. %s' % (issuer, auth_result.message))
|
|
471
499
|
try:
|
|
472
500
|
return distance_module.add_distance(src_rse_id=rse_module.get_rse_id(source, vo=vo, session=session),
|
|
473
501
|
dest_rse_id=rse_module.get_rse_id(destination, vo=vo, session=session),
|
|
@@ -490,8 +518,9 @@ def update_distance(source, destination, distance, issuer, vo='def', *, session:
|
|
|
490
518
|
:param session: The database session to use.
|
|
491
519
|
"""
|
|
492
520
|
kwargs = {'source': source, 'destination': destination}
|
|
493
|
-
|
|
494
|
-
|
|
521
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='update_distance', kwargs=kwargs, session=session)
|
|
522
|
+
if not auth_result.allowed:
|
|
523
|
+
raise exception.AccessDenied('Account %s can not update RSE distances. %s' % (issuer, auth_result.message))
|
|
495
524
|
|
|
496
525
|
return distance_module.update_distances(src_rse_id=rse_module.get_rse_id(source, vo=vo, session=session),
|
|
497
526
|
dest_rse_id=rse_module.get_rse_id(destination, vo=vo, session=session),
|
|
@@ -530,8 +559,9 @@ def delete_distance(source, destination, issuer, vo='def', *, session: "Session"
|
|
|
530
559
|
:param session: The database session in use.
|
|
531
560
|
"""
|
|
532
561
|
kwargs = {'source': source, 'destination': destination}
|
|
533
|
-
|
|
534
|
-
|
|
562
|
+
auth_result = permission.has_permission(issuer=issuer, vo=vo, action='delete_distance', kwargs=kwargs, session=session)
|
|
563
|
+
if not auth_result.allowed:
|
|
564
|
+
raise exception.AccessDenied('Account %s can not update RSE distances. %s' % (issuer, auth_result.message))
|
|
535
565
|
|
|
536
566
|
return distance_module.delete_distances(src_rse_id=rse_module.get_rse_id(source, vo=vo, session=session),
|
|
537
567
|
dest_rse_id=rse_module.get_rse_id(destination, vo=vo, session=session),
|
|
@@ -555,8 +585,9 @@ def add_qos_policy(rse, qos_policy, issuer, vo='def', *, session: "Session"):
|
|
|
555
585
|
|
|
556
586
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
557
587
|
kwargs = {'rse_id': rse_id}
|
|
558
|
-
|
|
559
|
-
|
|
588
|
+
auth_result = permission.has_permission(issuer=issuer, action='add_qos_policy', kwargs=kwargs, session=session)
|
|
589
|
+
if not auth_result.allowed:
|
|
590
|
+
raise exception.AccessDenied('Account %s cannot add QoS policies to RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
560
591
|
|
|
561
592
|
return rse_module.add_qos_policy(rse_id, qos_policy, session=session)
|
|
562
593
|
|
|
@@ -577,8 +608,9 @@ def delete_qos_policy(rse, qos_policy, issuer, vo='def', *, session: "Session"):
|
|
|
577
608
|
|
|
578
609
|
rse_id = rse_module.get_rse_id(rse=rse, vo=vo, session=session)
|
|
579
610
|
kwargs = {'rse_id': rse}
|
|
580
|
-
|
|
581
|
-
|
|
611
|
+
auth_result = permission.has_permission(issuer=issuer, action='delete_qos_policy', kwargs=kwargs, session=session)
|
|
612
|
+
if not auth_result.allowed:
|
|
613
|
+
raise exception.AccessDenied('Account %s cannot delete QoS policies from RSE %s. %s' % (issuer, rse, auth_result.message))
|
|
582
614
|
|
|
583
615
|
return rse_module.delete_qos_policy(rse_id, qos_policy, session=session)
|
|
584
616
|
|
rucio/gateway/rule.py
CHANGED
|
@@ -111,8 +111,9 @@ def add_replication_rule(
|
|
|
111
111
|
|
|
112
112
|
validate_schema(name='rule', obj=kwargs, vo=vo)
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='add_rule', kwargs=kwargs, session=session)
|
|
115
|
+
if not auth_result.allowed:
|
|
116
|
+
raise AccessDenied('Account %s can not add replication rule. %s' % (issuer, auth_result.message))
|
|
116
117
|
|
|
117
118
|
account_internal = InternalAccount(account, vo=vo)
|
|
118
119
|
dids_with_internal_scope = [{'name': d['name'], 'scope': InternalScope(d['scope'], vo=vo)} for d in dids]
|
|
@@ -152,8 +153,10 @@ def get_replication_rule(rule_id: str, issuer: str, vo: str = 'def', *, session:
|
|
|
152
153
|
:param session: The database session in use.
|
|
153
154
|
"""
|
|
154
155
|
kwargs = {'rule_id': rule_id}
|
|
155
|
-
if is_multi_vo(session=session)
|
|
156
|
-
|
|
156
|
+
if is_multi_vo(session=session):
|
|
157
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='access_rule_vo', kwargs=kwargs, session=session)
|
|
158
|
+
if not auth_result.allowed:
|
|
159
|
+
raise AccessDenied('Account %s can not access rules at other VOs. %s' % (issuer, auth_result.message))
|
|
157
160
|
result = rule.get_rule(rule_id, session=session)
|
|
158
161
|
return gateway_update_return_dict(result, session=session)
|
|
159
162
|
|
|
@@ -209,8 +212,10 @@ def list_replication_rule_history(
|
|
|
209
212
|
:param session: The database session in use.
|
|
210
213
|
"""
|
|
211
214
|
kwargs = {'rule_id': rule_id}
|
|
212
|
-
if is_multi_vo(session=session)
|
|
213
|
-
|
|
215
|
+
if is_multi_vo(session=session):
|
|
216
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='access_rule_vo', kwargs=kwargs, session=session)
|
|
217
|
+
if not auth_result.allowed:
|
|
218
|
+
raise AccessDenied('Account %s can not access rules at other VOs. %s' % (issuer, auth_result.message))
|
|
214
219
|
return rule.list_rule_history(rule_id, session=session)
|
|
215
220
|
|
|
216
221
|
|
|
@@ -278,10 +283,13 @@ def delete_replication_rule(
|
|
|
278
283
|
:raises: RuleNotFound, AccessDenied
|
|
279
284
|
"""
|
|
280
285
|
kwargs = {'rule_id': rule_id, 'purge_replicas': purge_replicas}
|
|
281
|
-
if is_multi_vo(session=session)
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
286
|
+
if is_multi_vo(session=session):
|
|
287
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='access_rule_vo', kwargs=kwargs, session=session)
|
|
288
|
+
if not auth_result.allowed:
|
|
289
|
+
raise AccessDenied('Account %s can not access rules at other VOs. %s' % (issuer, auth_result.message))
|
|
290
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='del_rule', kwargs=kwargs)
|
|
291
|
+
if not auth_result.allowed:
|
|
292
|
+
raise AccessDenied('Account %s can not remove this replication rule. %s' % (issuer, auth_result.message))
|
|
285
293
|
rule.delete_rule(rule_id=rule_id, purge_replicas=purge_replicas, soft=True, session=session)
|
|
286
294
|
|
|
287
295
|
|
|
@@ -305,11 +313,14 @@ def update_replication_rule(
|
|
|
305
313
|
:raises: RuleNotFound if no Rule can be found.
|
|
306
314
|
"""
|
|
307
315
|
kwargs = {'rule_id': rule_id, 'options': options}
|
|
308
|
-
if is_multi_vo(session=session)
|
|
309
|
-
|
|
316
|
+
if is_multi_vo(session=session):
|
|
317
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='access_rule_vo', kwargs=kwargs, session=session)
|
|
318
|
+
if not auth_result.allowed:
|
|
319
|
+
raise AccessDenied('Account %s can not access rules at other VOs. %s' % (issuer, auth_result.message))
|
|
310
320
|
if 'approve' in options:
|
|
311
|
-
|
|
312
|
-
|
|
321
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='approve_rule', kwargs=kwargs, session=session)
|
|
322
|
+
if not auth_result.allowed:
|
|
323
|
+
raise AccessDenied('Account %s can not approve/deny this replication rule. %s' % (issuer, auth_result.message))
|
|
313
324
|
|
|
314
325
|
issuer_ia = InternalAccount(issuer, vo=vo)
|
|
315
326
|
if options['approve']:
|
|
@@ -317,8 +328,9 @@ def update_replication_rule(
|
|
|
317
328
|
else:
|
|
318
329
|
rule.deny_rule(rule_id=rule_id, approver=issuer_ia, reason=options.get('comment', None), session=session)
|
|
319
330
|
else:
|
|
320
|
-
|
|
321
|
-
|
|
331
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='update_rule', kwargs=kwargs, session=session)
|
|
332
|
+
if not auth_result.allowed:
|
|
333
|
+
raise AccessDenied('Account %s can not update this replication rule. %s' % (issuer, auth_result.message))
|
|
322
334
|
if 'account' in options:
|
|
323
335
|
options['account'] = InternalAccount(options['account'], vo=vo)
|
|
324
336
|
rule.update_rule(rule_id=rule_id, options=options, session=session)
|
|
@@ -346,10 +358,13 @@ def reduce_replication_rule(
|
|
|
346
358
|
:raises: RuleReplaceFailed, RuleNotFound
|
|
347
359
|
"""
|
|
348
360
|
kwargs = {'rule_id': rule_id, 'copies': copies, 'exclude_expression': exclude_expression}
|
|
349
|
-
if is_multi_vo(session=session)
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
361
|
+
if is_multi_vo(session=session):
|
|
362
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='access_rule_vo', kwargs=kwargs, session=session)
|
|
363
|
+
if not auth_result.allowed:
|
|
364
|
+
raise AccessDenied('Account %s can not access rules at other VOs. %s' % (issuer, auth_result.message))
|
|
365
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='reduce_rule', kwargs=kwargs, session=session)
|
|
366
|
+
if not auth_result.allowed:
|
|
367
|
+
raise AccessDenied('Account %s can not reduce this replication rule. %s' % (issuer, auth_result.message))
|
|
353
368
|
|
|
354
369
|
return rule.reduce_rule(rule_id=rule_id, copies=copies, exclude_expression=exclude_expression, session=session)
|
|
355
370
|
|
|
@@ -371,8 +386,10 @@ def examine_replication_rule(
|
|
|
371
386
|
:param session: The database session in use.
|
|
372
387
|
"""
|
|
373
388
|
kwargs = {'rule_id': rule_id}
|
|
374
|
-
if is_multi_vo(session=session)
|
|
375
|
-
|
|
389
|
+
if is_multi_vo(session=session):
|
|
390
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='access_rule_vo', kwargs=kwargs, session=session)
|
|
391
|
+
if not auth_result.allowed:
|
|
392
|
+
raise AccessDenied('Account %s can not access rules at other VOs. %s' % (issuer, auth_result.message))
|
|
376
393
|
result = rule.examine_rule(rule_id, session=session)
|
|
377
394
|
result = gateway_update_return_dict(result, session=session)
|
|
378
395
|
if 'transfers' in result:
|
|
@@ -409,9 +426,12 @@ def move_replication_rule(
|
|
|
409
426
|
'override': override,
|
|
410
427
|
}
|
|
411
428
|
|
|
412
|
-
if is_multi_vo(session=session)
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
429
|
+
if is_multi_vo(session=session):
|
|
430
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='access_rule_vo', kwargs=kwargs, session=session)
|
|
431
|
+
if not auth_result.allowed:
|
|
432
|
+
raise AccessDenied('Account %s can not access rules at other VOs. %s' % (issuer, auth_result.message))
|
|
433
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='move_rule', kwargs=kwargs, session=session)
|
|
434
|
+
if not auth_result.allowed:
|
|
435
|
+
raise AccessDenied('Account %s can not move this replication rule. %s' % (issuer, auth_result.message))
|
|
416
436
|
|
|
417
437
|
return rule.move_rule(**kwargs, session=session)
|
rucio/gateway/scope.py
CHANGED
|
@@ -68,8 +68,9 @@ def add_scope(
|
|
|
68
68
|
validate_schema(name='scope', obj=scope, vo=vo)
|
|
69
69
|
|
|
70
70
|
kwargs = {'scope': scope, 'account': account}
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
auth_result = rucio.gateway.permission.has_permission(issuer=issuer, vo=vo, action='add_scope', kwargs=kwargs, session=session)
|
|
72
|
+
if not auth_result.allowed:
|
|
73
|
+
raise rucio.common.exception.AccessDenied('Account %s can not add scope. %s' % (issuer, auth_result.message))
|
|
73
74
|
|
|
74
75
|
internal_scope = InternalScope(scope, vo=vo)
|
|
75
76
|
internal_account = InternalAccount(account, vo=vo)
|
rucio/gateway/subscription.py
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
from collections import namedtuple
|
|
16
|
-
from collections.abc import Iterator
|
|
17
16
|
from json import dumps, loads
|
|
18
17
|
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
|
|
19
18
|
|
|
@@ -25,6 +24,8 @@ from rucio.db.sqla.session import read_session, stream_session, transactional_se
|
|
|
25
24
|
from rucio.gateway.permission import has_permission
|
|
26
25
|
|
|
27
26
|
if TYPE_CHECKING:
|
|
27
|
+
from collections.abc import Iterator
|
|
28
|
+
|
|
28
29
|
from sqlalchemy.orm import Session
|
|
29
30
|
|
|
30
31
|
|
|
@@ -65,8 +66,9 @@ def add_subscription(
|
|
|
65
66
|
:param session: The database session in use.
|
|
66
67
|
:returns: subscription_id
|
|
67
68
|
"""
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='add_subscription', kwargs={'account': account}, session=session)
|
|
70
|
+
if not auth_result.allowed:
|
|
71
|
+
raise AccessDenied('Account %s can not add subscription. %s' % (issuer, auth_result.message))
|
|
70
72
|
try:
|
|
71
73
|
if filter_:
|
|
72
74
|
if not isinstance(filter_, dict):
|
|
@@ -120,8 +122,9 @@ def update_subscription(
|
|
|
120
122
|
:param session: The database session in use.
|
|
121
123
|
:raises: SubscriptionNotFound if subscription is not found
|
|
122
124
|
"""
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='update_subscription', kwargs={'account': account}, session=session)
|
|
126
|
+
if not auth_result.allowed:
|
|
127
|
+
raise AccessDenied('Account %s can not update subscription. %s' % (issuer, auth_result.message))
|
|
125
128
|
try:
|
|
126
129
|
if not isinstance(metadata, dict):
|
|
127
130
|
raise TypeError('metadata should be a dict')
|
|
@@ -163,7 +166,7 @@ def list_subscriptions(
|
|
|
163
166
|
vo: str = 'def',
|
|
164
167
|
*,
|
|
165
168
|
session: "Session"
|
|
166
|
-
) -> Iterator[dict[str, Any]]:
|
|
169
|
+
) -> 'Iterator[dict[str, Any]]':
|
|
167
170
|
"""
|
|
168
171
|
Returns a dictionary with the subscription information :
|
|
169
172
|
Examples: ``{'status': 'INACTIVE/ACTIVE/BROKEN', 'last_modified_date': ...}``
|
|
@@ -190,9 +193,9 @@ def list_subscriptions(
|
|
|
190
193
|
if 'filter' in sub:
|
|
191
194
|
fil = loads(sub['filter'])
|
|
192
195
|
if 'account' in fil:
|
|
193
|
-
fil['account'] = [InternalAccount(acc,
|
|
196
|
+
fil['account'] = [InternalAccount(acc, from_external=False).external for acc in fil['account']]
|
|
194
197
|
if 'scope' in fil:
|
|
195
|
-
fil['scope'] = [InternalScope(sco,
|
|
198
|
+
fil['scope'] = [InternalScope(sco, from_external=False).external for sco in fil['scope']]
|
|
196
199
|
sub['filter'] = dumps(fil)
|
|
197
200
|
|
|
198
201
|
yield sub
|
|
@@ -205,7 +208,7 @@ def list_subscription_rule_states(
|
|
|
205
208
|
vo: str = 'def',
|
|
206
209
|
*,
|
|
207
210
|
session: "Session"
|
|
208
|
-
) -> Iterator[SubscriptionRuleState]:
|
|
211
|
+
) -> 'Iterator[SubscriptionRuleState]':
|
|
209
212
|
"""Returns a list of with the number of rules per state for a subscription.
|
|
210
213
|
|
|
211
214
|
:param name: Name of the subscription
|
|
@@ -269,9 +272,9 @@ def get_subscription_by_id(
|
|
|
269
272
|
if 'filter' in sub:
|
|
270
273
|
fil = loads(sub['filter'])
|
|
271
274
|
if 'account' in fil:
|
|
272
|
-
fil['account'] = [InternalAccount(acc,
|
|
275
|
+
fil['account'] = [InternalAccount(acc, from_external=False).external for acc in fil['account']]
|
|
273
276
|
if 'scope' in fil:
|
|
274
|
-
fil['scope'] = [InternalScope(sco,
|
|
277
|
+
fil['scope'] = [InternalScope(sco, from_external=False).external for sco in fil['scope']]
|
|
275
278
|
sub['filter'] = dumps(fil)
|
|
276
279
|
|
|
277
280
|
return sub
|
rucio/gateway/vo.py
CHANGED
|
@@ -44,8 +44,9 @@ def add_vo(new_vo: str, issuer: str, description: Optional[str] = None, email: O
|
|
|
44
44
|
validate_schema('vo', new_vo, vo=vo)
|
|
45
45
|
|
|
46
46
|
kwargs = {}
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
auth_result = has_permission(issuer=issuer, action='add_vo', kwargs=kwargs, vo=vo, session=session)
|
|
48
|
+
if not auth_result.allowed:
|
|
49
|
+
raise exception.AccessDenied('Account {} cannot add a VO. {}'.format(issuer, auth_result.message))
|
|
49
50
|
|
|
50
51
|
vo_core.add_vo(vo=new_vo, description=description, email=email, session=session)
|
|
51
52
|
|
|
@@ -60,8 +61,9 @@ def list_vos(issuer: str, vo: str = 'def', *, session: "Session") -> list[dict[s
|
|
|
60
61
|
:param session: The database session in use.
|
|
61
62
|
'''
|
|
62
63
|
kwargs = {}
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
auth_result = has_permission(issuer=issuer, action='list_vos', kwargs=kwargs, vo=vo, session=session)
|
|
65
|
+
if not auth_result.allowed:
|
|
66
|
+
raise exception.AccessDenied('Account {} cannot list VOs. {}'.format(issuer, auth_result.message))
|
|
65
67
|
|
|
66
68
|
return vo_core.list_vos(session=session)
|
|
67
69
|
|
|
@@ -94,8 +96,9 @@ def recover_vo_root_identity(
|
|
|
94
96
|
"""
|
|
95
97
|
kwargs = {}
|
|
96
98
|
root_vo = vo_core.map_vo(root_vo)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
auth_result = has_permission(issuer=issuer, vo=vo, action='recover_vo_root_identity', kwargs=kwargs, session=session)
|
|
100
|
+
if not auth_result.allowed:
|
|
101
|
+
raise exception.AccessDenied('Account %s can not recover root identity. %s' % (issuer, auth_result.message))
|
|
99
102
|
|
|
100
103
|
account = InternalAccount('root', vo=root_vo)
|
|
101
104
|
|
|
@@ -116,7 +119,8 @@ def update_vo(updated_vo: str, parameters: dict[str, Any], issuer: str, vo: str
|
|
|
116
119
|
"""
|
|
117
120
|
kwargs = {}
|
|
118
121
|
updated_vo = vo_core.map_vo(updated_vo)
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
auth_result = has_permission(issuer=issuer, action='update_vo', kwargs=kwargs, vo=vo, session=session)
|
|
123
|
+
if not auth_result.allowed:
|
|
124
|
+
raise exception.AccessDenied('Account {} cannot update VO. {}'.format(issuer, auth_result.message))
|
|
121
125
|
|
|
122
126
|
return vo_core.update_vo(vo=updated_vo, parameters=parameters, session=session)
|
rucio/rse/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
from dogpile.cache import make_region
|
|
16
16
|
|
|
17
|
-
from rucio.common.
|
|
17
|
+
from rucio.common.client import is_client
|
|
18
18
|
from rucio.rse import rsemanager
|
|
19
19
|
|
|
20
20
|
if is_client():
|
|
@@ -77,7 +77,7 @@ if rsemanager.CLIENT_MODE: # pylint:disable=no-member
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
if rsemanager.SERVER_MODE: # pylint:disable=no-member
|
|
80
|
-
from rucio.common.cache import
|
|
80
|
+
from rucio.common.cache import MemcacheRegion
|
|
81
81
|
from rucio.core.rse import get_rse_id, get_rse_protocols
|
|
82
82
|
from rucio.core.vo import map_vo
|
|
83
83
|
|
|
@@ -92,5 +92,5 @@ if rsemanager.SERVER_MODE: # pylint:disable=no-member
|
|
|
92
92
|
|
|
93
93
|
setattr(rsemanager, '__request_rse_info', tmp_rse_info)
|
|
94
94
|
setattr(rsemanager, '__get_signed_url', get_signed_url_server)
|
|
95
|
-
RSE_REGION =
|
|
95
|
+
RSE_REGION = MemcacheRegion(expiration_time=900)
|
|
96
96
|
setattr(rsemanager, 'RSE_REGION', RSE_REGION)
|
|
@@ -19,8 +19,9 @@ import time
|
|
|
19
19
|
from urllib.parse import parse_qs, urlencode, urlparse
|
|
20
20
|
|
|
21
21
|
from rucio.common import exception
|
|
22
|
+
from rucio.common.bittorrent import construct_torrent
|
|
22
23
|
from rucio.common.extra import import_extras
|
|
23
|
-
from rucio.common.utils import
|
|
24
|
+
from rucio.common.utils import resolve_ip
|
|
24
25
|
from rucio.rse import rsemanager
|
|
25
26
|
from rucio.rse.protocols.protocol import RSEProtocol
|
|
26
27
|
|
|
@@ -182,3 +183,12 @@ class Default(RSEProtocol):
|
|
|
182
183
|
time.sleep(0.25)
|
|
183
184
|
finally:
|
|
184
185
|
ses.remove_torrent(handle)
|
|
186
|
+
|
|
187
|
+
def delete(self, path):
|
|
188
|
+
raise NotImplementedError
|
|
189
|
+
|
|
190
|
+
def put(self, source, target, source_dir, transfer_timeout=None):
|
|
191
|
+
raise NotImplementedError
|
|
192
|
+
|
|
193
|
+
def rename(self, path, new_path):
|
|
194
|
+
raise NotImplementedError
|
rucio/rse/protocols/cache.py
CHANGED
|
@@ -49,17 +49,6 @@ class Default(protocol.RSEProtocol):
|
|
|
49
49
|
"""
|
|
50
50
|
return ''.join([self.rse['scheme'], '://%s' % self.rse['hostname'], path])
|
|
51
51
|
|
|
52
|
-
def exists(self, pfn):
|
|
53
|
-
""" Checks if the requested file is known by the referred RSE.
|
|
54
|
-
|
|
55
|
-
:param pfn: Physical file name
|
|
56
|
-
|
|
57
|
-
:returns: True if the file exists, False if it doesn't
|
|
58
|
-
|
|
59
|
-
:raise ServiceUnavailable
|
|
60
|
-
"""
|
|
61
|
-
raise NotImplementedError
|
|
62
|
-
|
|
63
52
|
def connect(self):
|
|
64
53
|
""" Establishes the actual connection to the referred RSE.
|
|
65
54
|
|
rucio/rse/protocols/dummy.py
CHANGED
|
@@ -38,17 +38,6 @@ class Default(protocol.RSEProtocol):
|
|
|
38
38
|
"""
|
|
39
39
|
return ''.join([self.rse['scheme'], '://%s' % self.rse['hostname'], path])
|
|
40
40
|
|
|
41
|
-
def exists(self, pfn):
|
|
42
|
-
""" Checks if the requested file is known by the referred RSE.
|
|
43
|
-
|
|
44
|
-
:param pfn: Physical file name
|
|
45
|
-
|
|
46
|
-
:returns: True if the file exists, False if it doesn't
|
|
47
|
-
|
|
48
|
-
:raise ServiceUnavailable
|
|
49
|
-
"""
|
|
50
|
-
raise NotImplementedError
|
|
51
|
-
|
|
52
41
|
def connect(self):
|
|
53
42
|
""" Establishes the actual connection to the referred RSE.
|
|
54
43
|
|