Repository navigation
KZN-19166 - Add machinery for app-builder-cli to drive admin command with oauth credentials - #92
Merged
Conversation
…with oauth credentials
keegandonley
requested
a balanced review from Copilot
and removed request for
jbedient-kizen
October 21, 2026 21:10
There was a problem hiding this comment.
🔵 Needs a closer look
Human validation is needed to confirm that OAuth 401 responses always precede write execution, making automatic write replay safe.
No open issues 🎉
What changed in this PR
Adds helper-based OAuth authentication so app-builder-cli can invoke kizen without a local credential profile, while preserving directory identity checks.
Changes:
- Adds environment-based configuration, cached Bearer authentication, and one refresh-and-retry on a 401 response.
- Guards credential and installation management commands when app-builder owns the environment.
- Adds regression tests and documents the wrapper integration contract.
| File | Description |
|---|---|
tests/test_auth_helper.py |
Tests helper configuration, authentication, failures, retries, and command guards. |
src/kizen_builder/docs/operating.md |
Documents helper-mode requirements and behavior. |
src/kizen_builder/config.py |
Adds authentication types and helper-mode configuration resolution. |
src/kizen_builder/cli/upgrade.py |
Prevents managed upgrades while preserving --check behavior. |
src/kizen_builder/cli/init.py |
Guards managed credentials and adopts the API-key authentication type. |
src/kizen_builder/cli/envs.py |
Blocks profile listing in helper mode. |
src/kizen_builder/auth_helper.py |
Executes the helper, caches tokens, and refreshes on 401 responses. |
src/kizen_builder/api/client.py |
Supports both authentication modes and helper-specific error guidance. |
README.md |
Clarifies that init does not read an environment variable for its base URL. |
docs/ARCHITECTURE.md |
Describes the updated authentication flow. |
CONTRIBUTING.md |
Adds the helper module to the source map. |
CHANGELOG.md |
Records the new app-builder integration. |
Review effort: Balanced
jbedient-kizen
approved these changes
Oct 21, 2026
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds required machinery so that app-builder-cli can wrap this tool and call into it using provided oauth credentials
Jira: https://kizen.atlassian.net/browse/KZN-19166
Checklist
uv run pytest), and I ran the wheel tier too if I touched packaging (pyproject.toml,docs/specs/, anything undersrc/kizen_builder/docs/).CHANGELOG.mdis updated under[Unreleased]if a user of the CLI would notice this change. Internal refactors don't need an entry.src/kizen_builder/docs/, it's covered by apackage-dataglob inpyproject.toml(tests/test_docs_packaging.pyenforces this, but check before pushing).specs/README.md/reference.md's router table (orGUIDE_TOPICSfor cross-cutting topics).