Skip to content

fix: preserve object storage secret keys in table output - #944

Merged
mawilk90 merged 4 commits into
linode:devfrom
pcbeingused33:fix/object-storage-key-truncation
Dec 3, 2026
Merged

mawilk90 merged 4 commits into
linode:devfrom
pcbeingused33:fix/object-storage-key-truncation

Conversation

@pcbeingused33

@pcbeingused33 pcbeingused33 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #825

📝 Description

What does this PR do and why is this change necessary?

The default table renderer uses ellipsis when a value exceeds the terminal width. For object-storage keys-create, this can discard part of the secret key that is only returned at creation time.

Add action-specific table, ASCII table and Markdown output overrides that enable the existing nontruncating renderer. Long keys fold across lines, preserving every character. Other actions retain their existing output behavior.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?

Run linode-cli object-storage keys-create --label <label> in a narrow terminal and check that secret_key is shown in full, folded across lines.

How do I run the relevant unit/integration tests?

LINODE_CLI_TEST_MODE=1 XDG_CONFIG_HOME=$(mktemp -d) pytest tests/unit/test_overrides.py tests/unit/test_output.py

The tests render through the response dispatch at a terminal width of 28 columns, checking complete key creation output and unchanged truncation for key listing. No live API call was made.

This change was prepared with AI assistance (Codex).

@pcbeingused33
pcbeingused33 requested review from a team as code owners November 9, 2026 01:41
@pcbeingused33
pcbeingused33 requested review from mawilk90 and zliang-akamai and removed request for a team November 9, 2026 01:41
@zliang-akamai
zliang-akamai requested a max review from Copilot November 11, 2026 16:51

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.

🟡 Changes recommended

Markdown output still truncates the one-time object-storage secret key in narrow terminals because it lacks a truncation-disabling override.

1 open issue
What changed in this PR

This PR addresses #825 by preserving one-time Object Storage secret keys in table and ASCII table output, using the CLI’s existing nontruncating renderer.

Changes:

  • Adds keys-create overrides that fold long values instead of truncating them.
  • Adds narrow-terminal tests for complete creation output and unchanged listing behavior.
  • Documents the action-specific output behavior.
File Description
tests/​unit/​test_overrides.py Tests key creation and listing output at 28 columns in both table modes.
linodecli/​overrides.py Disables truncation for object-storage keys-create in table and ASCII table modes.
AGENTS.md Documents preservation of the one-time secret key.

Review effort: Max

Comment thread linodecli/overrides.py Resolved
@pcbeingused33

Copy link
Copy Markdown
Contributor Author

Friendly ping: could someone take a look at this when there's time? I'm happy to adjust anything. Thanks!

Comment thread AGENTS.md Resolved
@mawilk90 mawilk90 added the community-contribution contributions from the community. label Nov 26, 2026
mawilk90 and others added 2 commits November 26, 2026 10:06
Also drop the AGENTS.md Code Map note, as requested in review.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

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.

🟢 Approval recommended

No active review issues remain for the change preserving one-time Object Storage secret keys in narrow-terminal output.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@mawilk90 mawilk90 added the bugfix for any bug fixes in the changelog. label Dec 3, 2026
@mawilk90
mawilk90 merged commit d48d621 into linode:dev Dec 3, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix for any bug fixes in the changelog. community-contribution contributions from the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: object-storage keys-create not displaying keys on small terminals

4 participants