Repository navigation
Feature: browser-based PAT auth setup - #5
Merged
Merged
Conversation
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.
Why are we changing this?
The CLI needed a real first-run auth model for Omni. PATs are created through browser login, not pasted manually, and some API surfaces require an org key while others work with a PAT. This change makes setup match that product reality and records the OAuth flow we derived from Omni's public MCP/OAuth metadata.
What has changed?
pat,org, orboth, withdefault_authselection.omni setupand auth commands so PAT uses a browser-based OAuth loopback flow and org auth prompts for the org API key.docs/pat-auth-flow.md..github/PULL_REQUEST_TEMPLATE.mdso future PRs use the same structure.How to test it and expected results?
Run
go test ./....Expected: all tests pass.
Run
./bin/omni setup --url https://<your-instance>.omniapp.co/ --auth-mode pat.Expected: the CLI opens a browser login, stores a PAT on success, and completes setup without asking the user to paste a PAT.
Run
./bin/omni setup --url https://<your-instance>.omniapp.co/ --auth-mode both --default-auth organd provide the org key when prompted.Expected: PAT login completes in browser, the org key prompt appears, both credentials are stored, and org validation shows full API access.
Run
OMNI_URL=https://<your-instance>.omniapp.co/ OMNI_AUTH=org ./bin/omni api call --method GET --path /api/v1/user-attributes --json.Expected: the command returns authenticated JSON data from the Omni API.
Checklist: