[PR #133] [MERGED] Add auth config init and storage selection #314

Closed
opened 2026-02-26 21:34:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/133
Author: @rudrankriyam
Created: 1/24/2026
Status: Merged
Merged: 1/25/2026
Merged by: @rudrankriyam

Base: mainHead: cursor/auth-config-init-issue-102


📝 Commits (10+)

  • 089fdfa Add auth init and config-only storage.
  • 84fc38f Clarify config storage behavior.
  • a2589e2 Skip empty config credentials
  • 1297fb1 Support repo-local config and config defaults.
  • b318396 Merge pull request #134 from rudrankriyam/cursor/empty-config-phantom-credentials-1f39
  • 360a172 Merge auth config consistency fixes and add config fallback for bypass-keychain.
  • 96864c2 Add integration tests for auth config features.
  • ceb2d77 Fix auth logout to preserve non-credential config settings.
  • 919dac6 Improve integration tests with error handling and auto-build.
  • 744a526 Add testing standards to GO_STANDARDS.md.

📊 Changes

15 files changed (+1192 additions, -73 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 CONTRIBUTING.md (+3 -2)
📝 README.md (+38 -2)
📝 cmd/analytics_helpers.go (+19 -3)
📝 cmd/auth.go (+93 -4)
📝 cmd/commands_test.go (+3 -0)
📝 cmd/shared.go (+13 -2)
📝 docs/CONTRIBUTING.md (+1 -1)
📝 docs/GO_STANDARDS.md (+33 -0)
📝 internal/asc/client_core.go (+99 -20)
📝 internal/asc/integration_test.go (+81 -6)
internal/auth/integration_test.go (+366 -0)
📝 internal/auth/keychain.go (+81 -7)
📝 internal/config/config.go (+142 -19)
📝 internal/config/config_test.go (+219 -7)

📄 Description

Summary

  • add asc auth init and asc auth init --local to generate a template config.json in global ~/.asc or repo-local ./.asc
  • add asc auth login --bypass-keychain (optional --local) to explicitly store credentials in config.json instead of keychain
  • add config path resolution precedence: ASC_CONFIG_PATH → repo-local ./.asc/config.json → global ~/.asc/config.json
  • support config.json equivalents for env overrides (vendor numbers, timeouts, retry settings, app id)
  • avoid “phantom credentials” by treating empty config as no stored credentials
  • update docs/README and gitignore to describe config usage and prevent committing .asc/

Auth + Config Behavior

  • Global config (default): ~/.asc/config.json
  • Repo-local config: ./.asc/config.json (preferred when present)
  • Override: ASC_CONFIG_PATH points to any config file

Commands

  • asc auth init → writes template config to ~/.asc/config.json
  • asc auth init --local → writes template config to ./.asc/config.json
  • asc auth login --bypass-keychain → stores credentials in config (global)
  • asc auth login --bypass-keychain --local → stores credentials in repo-local config

Config Keys (config.json)

Config keys mirror env vars using snake_case:

  • app_id
  • vendor_number
  • analytics_vendor_number
  • timeout, timeout_seconds
  • upload_timeout, upload_timeout_seconds
  • max_retries
  • base_delay
  • max_delay
  • retry_log

Env/Config Precedence

  • Environment variables override config values when set.
  • When env vars are not set, values are resolved from config.json using the above keys.

Test Plan

  • make test
  • make lint
  • make build

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rudrankriyam/App-Store-Connect-CLI/pull/133 **Author:** [@rudrankriyam](https://github.com/rudrankriyam) **Created:** 1/24/2026 **Status:** ✅ Merged **Merged:** 1/25/2026 **Merged by:** [@rudrankriyam](https://github.com/rudrankriyam) **Base:** `main` ← **Head:** `cursor/auth-config-init-issue-102` --- ### 📝 Commits (10+) - [`089fdfa`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/089fdfaf81ccef43f8d8e373ce33935d69d81ba0) Add auth init and config-only storage. - [`84fc38f`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/84fc38f6cf311f993c5da384dbd291e1bf46edfe) Clarify config storage behavior. - [`a2589e2`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/a2589e2229f5ad5c5cc014b3fa3075a546870357) Skip empty config credentials - [`1297fb1`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/1297fb161640e23e2706a73dbd75455dd47239f9) Support repo-local config and config defaults. - [`b318396`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/b318396ec543b99154f022748207951fea21c699) Merge pull request #134 from rudrankriyam/cursor/empty-config-phantom-credentials-1f39 - [`360a172`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/360a1724fcb4b6b2ca9375b7f325d49220db9e21) Merge auth config consistency fixes and add config fallback for bypass-keychain. - [`96864c2`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/96864c2bf7b6713b7e527d9187a20106a3e26762) Add integration tests for auth config features. - [`ceb2d77`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/ceb2d771724b994f3c4729f578fdb72d6093bc4d) Fix auth logout to preserve non-credential config settings. - [`919dac6`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/919dac69b8cdfad7ca78c86bfc09df600d59ac3b) Improve integration tests with error handling and auto-build. - [`744a526`](https://github.com/rudrankriyam/App-Store-Connect-CLI/commit/744a52667c8ed449ea9c8cf45d62786a3d991dc8) Add testing standards to GO_STANDARDS.md. ### 📊 Changes **15 files changed** (+1192 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `CONTRIBUTING.md` (+3 -2) 📝 `README.md` (+38 -2) 📝 `cmd/analytics_helpers.go` (+19 -3) 📝 `cmd/auth.go` (+93 -4) 📝 `cmd/commands_test.go` (+3 -0) 📝 `cmd/shared.go` (+13 -2) 📝 `docs/CONTRIBUTING.md` (+1 -1) 📝 `docs/GO_STANDARDS.md` (+33 -0) 📝 `internal/asc/client_core.go` (+99 -20) 📝 `internal/asc/integration_test.go` (+81 -6) ➕ `internal/auth/integration_test.go` (+366 -0) 📝 `internal/auth/keychain.go` (+81 -7) 📝 `internal/config/config.go` (+142 -19) 📝 `internal/config/config_test.go` (+219 -7) </details> ### 📄 Description ## Summary - add `asc auth init` and `asc auth init --local` to generate a template `config.json` in global `~/.asc` or repo-local `./.asc` - add `asc auth login --bypass-keychain` (optional `--local`) to explicitly store credentials in `config.json` instead of keychain - add config path resolution precedence: `ASC_CONFIG_PATH` → repo-local `./.asc/config.json` → global `~/.asc/config.json` - support config.json equivalents for env overrides (vendor numbers, timeouts, retry settings, app id) - avoid “phantom credentials” by treating empty config as no stored credentials - update docs/README and gitignore to describe config usage and prevent committing `.asc/` ## Auth + Config Behavior - **Global config (default)**: `~/.asc/config.json` - **Repo-local config**: `./.asc/config.json` (preferred when present) - **Override**: `ASC_CONFIG_PATH` points to any config file ### Commands - `asc auth init` → writes template config to `~/.asc/config.json` - `asc auth init --local` → writes template config to `./.asc/config.json` - `asc auth login --bypass-keychain` → stores credentials in config (global) - `asc auth login --bypass-keychain --local` → stores credentials in repo-local config ## Config Keys (config.json) Config keys mirror env vars using snake_case: - `app_id` - `vendor_number` - `analytics_vendor_number` - `timeout`, `timeout_seconds` - `upload_timeout`, `upload_timeout_seconds` - `max_retries` - `base_delay` - `max_delay` - `retry_log` ## Env/Config Precedence - Environment variables override config values when set. - When env vars are not set, values are resolved from config.json using the above keys. ## Test Plan - `make test` - `make lint` - `make build` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 21:34:33 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#314
No description provided.