Skip to content

feat: persist endpoint overrides for named teams - #131

Merged
nalanj merged 2 commits into
mainfrom
team-endpoint-overrides
Dec 2, 2026
Merged

nalanj merged 2 commits into
mainfrom
team-endpoint-overrides

Conversation

@nalanj

@nalanj nalanj commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Named teams previously stored only API keys, so staging access required setting LOOPS_ENDPOINT_URL on each invocation. Login now saves normalized, nondefault endpoints in an optional endpointOverrides map and reports the saved override; auth list shows endpoints when overrides exist. Stored team keys use their configured endpoints, environment API keys ignore saved config entirely, and logout removes the team's override.

Verified login persistence, the stored endpoint in auth list, and a read-only staging auth request with both endpoint and API-key environment variables unset. Environment-key isolation, logout cleanup, and URL normalization are covered by automated regression tests.

loops auth list:

k8s:staging.loops ~
❯ loops auth list
 NAME             ACTIVE  API KEY                           ENDPOINT URL
─────────────────────────────────────────────────────────────────────────────────────────
 loops            *       ****************************52d1  https://app.loops.so/api/v1
 staging-primary          ****************************047d  https://app.l3s.email/api/v1


Traffic Cop

  • Tested in staging

@nalanj
nalanj requested a review from notnmeyer December 1, 2026 21:43
@nalanj
nalanj marked this pull request as ready for review December 1, 2026 21:43
@notnmeyer

Copy link
Copy Markdown
Member

auth list should show an endpoint url column. maybe omit the column unless theres an override?

Comment thread internal/config/config.go Resolved
Comment thread internal/config/store.go Resolved
Comment thread internal/config/store.go Resolved
Comment thread internal/config/config.go Resolved
Comment thread internal/config/store.go Resolved
Comment thread cmd/auth_login.go Resolved
@notnmeyer

notnmeyer commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

two things i'd like to see changed before this merges:

  • when LOOPS_API_KEY is set we should ignore the config entirely, including endpoint overrides. just LOOPS_ENDPOINT_URL or the default.
  • auth logout should remove the team's endpoint override too. otherwise logging in again with the same name sends the new key to the old host.

the rest are nits

@nalanj

nalanj commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 6a2c676 with both blockers fixed and the nits addressed. auth list now shows an endpoint URL column only when a stored team has an override; JSON includes endpointUrl only on those entries. Login reports saved overrides, and URL normalization preserves path case. The full Go test suite and build pass; the updated list and a read-only auth request also passed against staging with environment overrides unset.

@nalanj
nalanj requested a review from notnmeyer December 2, 2026 16:17
@nalanj
nalanj merged commit b2f209a into main Dec 2, 2026
2 checks passed
@nalanj
nalanj deleted the team-endpoint-overrides branch December 2, 2026 17:37
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.

2 participants