[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Copying Token attributes



Hello John,

Il 21/03/22 22:23, John M Knoeller ha scritto:

Is the intent here to cause expressions to be evaluated?


The intent is to have AuthToken* attributes in the routed job
just like x509* attributes, which are copied by default.


Â

You might try this

Â

JOB_ROUTER_TRANSFORM_CopyTokenAttrs @=jrt
ÂREQUIREMENTS AuthTokenSubject =!= undefined
ÂEVALSET AuthTokenId $(MY.AuthTokenId)
ÂEVALSET AuthTokenIssuer $(MY.AuthTokenIssuer)
ÂEVALSET AuthTokenSubject $(MY.AuthTokenSubject)
@jrt

Â

This is weird: only renamed target attribute is set, however with a wrong value:

JOB_ROUTER_TRANSFORM_CopyTokenAttrs @=jrt
 REQUIREMENTS MY.AuthTokenSubject =!= undefined
 EVALSET AuthTokenId $(MY.AuthTokenId)
 EVALSET AuthTokenIssuer $(MY.AuthTokenIssuer)
 EVALSET RAuthTokenSubject $(MY.AuthTokenSubject)
 EVALSET AuthTokenIssuer $(MY.AuthTokenIssuer)
@jrt


[root@ce01t-htc config.d]# condor_ce_q 13110. -af routedtojobid
18035.0
[root@ce01t-htc config.d]# condor_q -l 18035.0 | grep Tok
RAuthTokenSubject = 9662
SciTokensFile = "/tmp/bt_u23031"
[root@ce01t-htc config.d]#

The real subject is 36 chars long, an 9662 is just the first "digit only" part: "sub": "9662c0b5-31a1-....

Stefano



Â

for instance, if the job has

Â

ÂAuthTokenSubject = strcat(Owner," subject")
Owner = "bob"

Â

before the transform, then the transform will expand to

Â

Â...
EVALSET AuthTokenSubject strcat(Owner,"foo")


And will have

Â

ÂAuthTokenSubject = "bob subject"

Â

after the transform

Â

-tj

Â

From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of Stefano Dal Pra
Sent: Monday, March 21, 2022 5:29 AM
To: htcondor-users <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] Copying Token attributes

Â

Hello,

I'm using the following JOB_ROUTER_PRE_ROUTE_TRANSFORM in a HTCondor-CE to copy the AuthToken* attributes
into the Classad of the routedjob:

JOB_ROUTER_TRANSFORM_CopyTokenAttrs @=jrt
ÂREQUIREMENTS MY.AuthTokenSubject =!= undefined
ÂEVALSET RAuthTokenId AuthTokenId Â
ÂEVALSET RAuthTokenIssuer AuthTokenIssuer Â
ÂEVALSET RAuthTokenSubject AuthTokenSubject Â
ÂEVALSET RAuthTokenIssuer AuthTokenIssuer Â
@jrt

Note the capital R in RAuthTokenId and the others. Fact is that i wasn't able to just copy the attribute with
its original name, so i had to alter the attribute names.

All the attempts i made did fail:
EVALSET AuthTokenSubject AuthTokenSubject
Â
EVALSET AuthTokenSubject MY.AuthTokenSubject

EVALSET TARGET.AuthTokenSubject MY.AuthTokenSubject

EVALSET TARGET.AuthTokenSubject AuthTokenSubject

Is there any way to keep the original name?
Thanks
Stefano


_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/