Skip to content

Commit 1fad435

Browse files
committed
Add SciToken issuer mapping using regex formatting
1 parent 47a1174 commit 1fad435

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

osgtest/tests/test_190_condorce.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,22 @@ def test_02_scitoken_mapping(self):
4242
'HTCondor version does not support SciToken submission')
4343

4444
condorce_version = core.PackageVersion('htcondor-ce')
45-
scitoken_mapping = f'SCITOKENS "https://demo.scitokens.org" {core.options.username}\n'
45+
scitoken_mapping = 'SCITOKENS {issuer} {local_user}\n'
4646

47-
# Write the mapfile to the admin mapfile directory
47+
# Write the mapfile to the admin mapfile directory with the regex format for the issuer
48+
# required by 'CERTIFICATE_MAPFILE_ASSUME_HASH_KEYS = True'
4849
# https://github.com/htcondor/htcondor-ce/pull/425
4950
if condorce_version >= '5.1.0':
51+
match_str = r'/https:\/\/demo.scitokens.org,.*/'
5052
core.config['condor-ce.mapfile'] = '/etc/condor-ce/mapfiles.d/01-osg-test.conf'
5153
else:
54+
match_str = '"https://demo.scitokens.org"'
5255
core.config['condor-ce.mapfile'] = '/etc/condor-ce/condor_mapfile'
5356
mapfile_contents = files.read(core.config['condor-ce.mapfile'], as_single_string=True)
5457
scitoken_mapping += mapfile_contents
5558

5659
files.write(core.config['condor-ce.mapfile'],
57-
scitoken_mapping,
60+
scitoken_mapping.format(issuer=match_str, local_user=core.options.username),
5861
owner='condor-ce',
5962
chmod=0o644)
6063
core.state['condor-ce.wrote-mapfile'] = True

0 commit comments

Comments
 (0)