Skip to content

Added -s/-f flags to skip/force token validation#132

Merged
DrDaveD merged 4 commits intofermitools:masterfrom
shreyb:issue-130
Jun 20, 2025
Merged

Added -s/-f flags to skip/force token validation#132
DrDaveD merged 4 commits intofermitools:masterfrom
shreyb:issue-130

Conversation

@shreyb
Copy link
Contributor

@shreyb shreyb commented Jun 18, 2025

As discussed in issue #130, if stdout is a TTY, we will keep the current default behavior of verifying the token. If stdout is not a TTY, we will skip verification of the token by default. The default behavior can be overridden using the -s/-f flags.

Closes #130

As discussed in issue fermitools#130, if stdout is a TTY, we will keep the
current default behavior of verifying the token.  If stdout is not a
TTY, we will skip verification of the token by default.  The default
behavior can be overridden using the -s/-f flags.
@shreyb
Copy link
Contributor Author

shreyb commented Jun 18, 2025

These are the tests I ran:

Interactive (TTY): PASS

  • -s --> skip verification
  • default --> don't skip verification
  • -f --> force verification
  • -f and -s: error

Non-interactive (from a script) (NOT a TTY): PASS

  • -s ---> skip verification
  • default ---> skip verification
  • -f --> force verification
  • -f and -s: error

Script to check non-interactive case:

/path/to/copy/of/htdecodetoken "$@" > /tmp/htdecodetoken.log 2>&1
echo "Is TTY?" >> /tmp/htdecodetoken.log
echo "  $(test -t 1 && echo "yes" || echo "no")" >> /tmp/htdecodetoken.log
echo "Args: $@" >>  /tmp/htdecodetoken.log
cat /tmp/htdecodetoken.log
exit

@DrDaveD DrDaveD merged commit 810f81f into fermitools:master Jun 20, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add flag to allow users to skip verification for htdecodetoken

2 participants