Skip to content

feat(keys): auto-bridge Deploy Key into ait profile by default#183

Merged
DaveDev42 merged 1 commit into
mainfrom
feat/182-auto-deploy-key-bridge
Jun 1, 2026
Merged

feat(keys): auto-bridge Deploy Key into ait profile by default#183
DaveDev42 merged 1 commit into
mainfrom
feat/182-auto-deploy-key-bridge

Conversation

@DaveDev42

Copy link
Copy Markdown
Contributor

Summary

  • aitcc keys create --name ci-deploy now automatically saves the issued Deploy Key to ~/.ait/credentials under the ci-deploy profile so ait deploy --profile ci-deploy works immediately — no separate ait token add step required.
  • --no-save-profile opt-out for CI pipes that store the key in an external secret manager (stdout-only).
  • --save-profile <other> still works as an override for the profile name.
  • Fixes ~/.ait directory permissions: mkdirSync now uses mode: 0o700 (was missing, defaulted to 0755).
  • docs/api/api-keys.md: documents automatic save behaviour, 0600/0700 permissions, and opt-out.
  • README.md + README.en.md: new "Deploy Key 발급" / "Issuing a Deploy Key" section with one-shot workflow example.
  • Adds resolveProfileName() exported helper for clean unit testing.
  • 8 new tests: 4 for resolveProfileName pure logic (all three flag branches + precedence) and 4 integration tests using _AIT_CREDENTIALS_PATH_OVERRIDE (credential write/no-write, override name, SECRET-HANDLING).

Closes #182

Test plan

  • pnpm typecheck — clean
  • pnpm lint — clean (0 errors, 0 warnings)
  • pnpm format — no changes
  • pnpm test — 664 pass, 20 skipped (pre-existing cli-subprocess.test.ts requires pnpm build; unrelated to this PR)
  • SECRET-HANDLING verified: TEST_API_KEY never appears in any stderr assertion
  • _AIT_CREDENTIALS_PATH_OVERRIDE used throughout; real ~/.ait/credentials is never touched by tests

`aitcc keys create` now saves the issued key to ~/.ait/credentials under
the --name profile automatically, so `ait deploy --profile <name>` works
immediately without a manual `ait token add` step.

- default path: profile saved under --name value
- --save-profile <other>: saves under the override name instead
- --no-save-profile: disables saving (stdout-only, for CI pipes)
- src/ait-token-profile.ts: mkdirSync now passes mode: 0o700 so the
  ~/.ait directory is created with the correct restrictive permissions
- README ko + en: new "Deploy Key 발급" / "Issuing a Deploy Key" section
- docs/api/api-keys.md: documents automatic save behaviour + opt-outs
- New resolveProfileName() helper exported for unit testing
- Tests: 8 new tests covering all three flag branches + SECRET-HANDLING
@DaveDev42 DaveDev42 merged commit 087b752 into main Jun 1, 2026
1 check passed
@DaveDev42 DaveDev42 deleted the feat/182-auto-deploy-key-bridge branch June 1, 2026 05:43
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.

feat(keys): aitcc keys create → ait CLI profile 자동 등록으로 deploy key 다리 놓기

1 participant