Skip to content

Feature: browser-based PAT auth setup - #5

Merged
hawkfry merged 2 commits into
mainfrom
feat/auth-mode-setup
Mar 15, 2026
Merged

hawkfry merged 2 commits into
mainfrom
feat/auth-mode-setup

Conversation

@hawkfry

@hawkfry hawkfry commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

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?

  • Added dual-auth profile support for pat, org, or both, with default_auth selection.
  • Reworked omni setup and auth commands so PAT uses a browser-based OAuth loopback flow and org auth prompts for the org API key.
  • Added validation and user-facing messaging that distinguishes limited PAT permissions from true setup failure.
  • Documented the PAT auth flow in docs/pat-auth-flow.md.
  • Added .github/PULL_REQUEST_TEMPLATE.md so future PRs use the same structure.

How to test it and expected results?

  1. Run go test ./....
    Expected: all tests pass.

  2. 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.

  3. Run ./bin/omni setup --url https://<your-instance>.omniapp.co/ --auth-mode both --default-auth org and 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.

  4. 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:

  • My pull request represents one logical piece of work.
  • My commits are related to the pull request and look clean.
  • My code follows our coding conventions.
  • My code has appropriate tests and documentation.

@hawkfry
hawkfry merged commit 60d3751 into main Mar 15, 2026
1 check passed
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.

1 participant