mirror of
https://github.com/rudrankriyam/App-Store-Connect-CLI.git
synced 2026-04-25 07:35:48 +03:00
[GH-ISSUE #268] Auth: Add cleanup for temporary private key files #82
Labels
No labels
bug
bug
documentation
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/App-Store-Connect-CLI#82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rudrankriyam on GitHub (Jan 28, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/268
Problem
When users provide inline private keys via
ASC_PRIVATE_KEYorASC_PRIVATE_KEY_B64environment variables, the CLI writes these to temporary files in/tmp/asc-key-*.p8. The path is stored in the module-level variableprivateKeyTempPathincmd/shared.go, but there is no cleanup mechanism.This creates two risks:
0o600permissions,/tmpis a shared directory and the file persists longer than necessaryAffected Code
cmd/shared.go:274-292- TheresolveEnvCredentialsfunction creates the temp filecmd/shared.go:38- TheprivateKeyTempPathmodule-level variable stores the path but is never used for cleanupProposed Solution
deferor anatexit-style handler that removes the temporary file when the CLI exitsos.CreateTempwith a more restricted parent directory if availablesync.Oncepattern to ensure cleanup happens exactly onceExample implementation:
Acceptance Criteria
/tmpafter CLI execution completes@rudrankriyam commented on GitHub (Jan 28, 2026):
Closing per request. Reopen if any auth issues remain.