Skip to content

Do not reuse a saved session for a different server or site - #501

Open
jacalata wants to merge 2 commits into
developmentfrom
jac/fix-session-server-binding
Open

jacalata wants to merge 2 commits into
developmentfrom
jac/fix-session-server-binding

Conversation

@jacalata

@jacalata jacalata commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

A login saved by tabcmd login (session token, site and user ids, token name and secret, password and token file paths) is now only used for the server and site it was made on.

  • If --server names a different server (compared after normalising the URL), or --site names a different site (case-sensitive, surrounding whitespace ignored, default means the default site), the saved login is not used. The command signs in from its own arguments, as it would with no saved session.
  • Leaving out both --server and --site, or giving the saved values, keeps reusing the saved session as before. --server without --site selects the default site, as before.

Behavior change

A saved login is no longer reused when --server names a different server or --site names a different site; the command then needs new credentials. Site names are compared case-sensitively, so Site-A and site-a are different sites, and the site name is stored and sent with the case given. As before, --server without --site uses the default site, and default means the default site.

A script that logged in once and then ran commands with a different -s or --site and no credentials now exits with "missing arguments / run 'tabcmd login -h'". Pass credentials on those commands, or run tabcmd login against the new server or site first. Changing only the scheme (http vs https) counts as a different server.

🤖 Generated with Claude Code

A saved login (session token, site and user ids, token name and secret,
password and token file paths) applies only to the server and site it was
made on. When --server names a different server (after normalising both
URLs) or --site names a different site (compared case-insensitively,
ignoring surrounding whitespace, with "default" meaning the default site),
the saved login details are dropped and the command signs in from its own
arguments, as it would with no saved session. Omitting --site keeps the
saved site and its login.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
tabcmd
   __main__.py121212 0%
   _version.py111111 0%
   tabcmd.py151515 0%
   version.py1066 40%
tabcmd/commands
   commands.py101010 0%
   constants.py771515 81%
   server.py1351818 87%
tabcmd/commands/auth
   session.py4424444 90%
tabcmd/commands/datasources_and_workbooks
   datasources_and_workbooks_command.py1701818 89%
   datasources_workbooks_views_url_parser.py14255 96%
   delete_command.py702323 67%
   export_command.py1262121 83%
   get_url_command.py1274747 63%
   publish_command.py1341616 88%
   runschedule_command.py2177 67%
tabcmd/commands/extracts
   create_extracts_command.py4288 81%
   decrypt_extracts_command.py2722 93%
   delete_extracts_command.py3766 84%
   encrypt_extracts_command.py2722 93%
   extracts.py2022 90%
   reencrypt_extracts_command.py2722 93%
   refresh_extracts_command.py481010 79%
tabcmd/commands/group
   create_group_command.py2955 83%
   delete_group_command.py2722 93%
tabcmd/commands/project
   create_project_command.py4688 83%
   delete_project_command.py3544 89%
   publish_samples_command.py3044 87%
tabcmd/commands/site
   create_site_command.py3455 85%
   delete_site_command.py2722 93%
   edit_site_command.py661818 73%
   list_command.py771212 84%
   list_sites_command.py2922 93%
tabcmd/commands/user
   add_users_command.py2955 83%
   create_site_users.py1151414 88%
   create_users_command.py5999 85%
   delete_site_users_command.py4355 88%
   user_data.py2303030 87%
tabcmd/execution
   _version.py222 0%
   global_options.py15544 97%
   localize.py671111 84%
   logger_config.py7266 92%
   tabcmd_controller.py4077 82%
TOTAL309645585% 

Site names are case sensitive, so the site name is stored and sent as
given and a case-only difference counts as a different site. As before,
giving --server without --site uses the default site.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 22:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@jacalata jacalata mentioned this pull request Nov 17, 2026

This branch has not been deployed

No deployments
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.

2 participants