Skip to content

Commit 4d34308

Browse files
committed
have htdecodetoken use scitokens-verify stdin when available
1 parent aa0e4db commit 4d34308

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

htdecodetoken

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,16 @@ if [ $? != 0 ]; then
182182
# silently exit if scitokens-verify not found
183183
exit
184184
fi
185-
VERIFYOUT="$($VERIFY $TOKEN)"
185+
# scitokens-verify from scitokens-cpp versions greater than 1.2.0
186+
# accepts token on stdin. That's safer to use so try it first.
187+
# The echo command is a shell builtin so it won't show up even
188+
# temporarily in a ps list.
189+
VERIFYOUT="$(echo $TOKEN | $VERIFY 2>&1)"
186190
RET=$?
191+
if [ $RET != 0 ] && [[ "$VERIFYOUT" == *"Insufficient arguments"* ]]; then
192+
VERIFYOUT="$($VERIFY $TOKEN)"
193+
RET=$?
194+
fi
187195
if [ $RET != 0 ]; then
188196
if [ -n "$VERIFYOUT" ]; then
189197
echo "$VERIFYOUT" >&2

htgettoken.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ order to work.
151151
.TP
152152
.BR \-\-novaulttoken
153153
Disable all authentication methods that get vault tokens.
154-
Currently this equivalent to
154+
Currently this is equivalent to
155155
.IR \-\-nooidc\ \-\-nokerberos\ \-\-nossh .
156156
.BR
157157
.TP

htgettoken.spec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ rm -rf $RPM_BUILD_ROOT
7474

7575

7676
%changelog
77+
78+
# - Have htdecodetoken take advantage of new scitokens-verify ability
79+
# to read from stdin, when available.
80+
7781
* Mon Dec 1 2025 Dave Dykstra <dwd@fnal.gov> 2.5-1
7882
- Add htdestroytoken -f option to force a removal of a refresh token in
7983
vault.

0 commit comments

Comments
 (0)