Skip to content

Commit

Permalink
Generate scitokens.conf files even for public namespaces, to support …
Browse files Browse the repository at this point in the history
…public read/auth write (SOFTWARE-5727)
  • Loading branch information
matyasselmeci committed Oct 30, 2023
1 parent 329a048 commit 09ee64c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/stashcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,6 @@ def generate_cache_scitokens(global_data: GlobalData, fqdn: str, suppress_errors

for vo_name, stashcache_obj in vos_data.stashcache_by_vo_name.items():
for namespace in stashcache_obj.namespaces.values(): # type: Namespace
if namespace.is_public():
continue
if not namespace_allows_cache_resource(namespace, cache_resource):
continue
if not resource_allows_namespace(cache_resource, namespace):
Expand Down Expand Up @@ -486,8 +484,6 @@ def generate_origin_scitokens(global_data: GlobalData, fqdn: str, suppress_error

for vo_name, stashcache_obj in vos_data.stashcache_by_vo_name.items():
for namespace in stashcache_obj.namespaces.values():
if namespace.is_public():
continue
if not namespace_allows_origin_resource(namespace, origin_resource):
continue
if not resource_allows_namespace(origin_resource, namespace):
Expand Down Expand Up @@ -562,7 +558,7 @@ def _namespace_dict(ns: Namespace):
nsdict = {
"path": ns.path,
"readhttps": not ns.is_public(),
"usetokenonread": any(isinstance(a, SciTokenAuth) for a in ns.authz_list),
"usetokenonread": not ns.is_public() and any(isinstance(a, SciTokenAuth) for a in ns.authz_list),
"writebackhost": ns.writeback,
"dirlisthost": ns.dirlist,
"caches": [],
Expand Down

0 comments on commit 09ee64c

Please sign in to comment.