Skip to content

Browser authentication flow#9

Merged
carole-lavillonniere merged 1 commit intomainfrom
drg-358-implement-browser-based-auth-flow
Feb 3, 2026
Merged

Browser authentication flow#9
carole-lavillonniere merged 1 commit intomainfrom
drg-358-implement-browser-based-auth-flow

Conversation

@carole-lavillonniere
Copy link
Copy Markdown
Collaborator

Changes

  • Implements browser-based login when no auth token is saved or set in env var (CLI opens browser to LocalStack webapp, receives token via local callback server)
  • Starts an HTTP server in order to receive the callback from the webapp (the call will be implemented in the webapp in a subsequent PR)
  • Falls back gracefully by printing the URL if browser cannot be opened
    Dependencies
  • Added github.com/pkg/browser for cross-platform browser opening

Integration test

  • TestStartCommandTriggersLoginWithoutToken: simulates browser callback to verify that the login flow works (LOCALSTACK_WEB_APP_URL env var allows overriding webapp URL for testing)

TODO

  • handle /redirect?name=CLI in webapp and execute CLI callback
  • save the received auth token

Comment thread internal/auth/auth.go
log.Println("Authentication failed.")
return "", err
}
log.Println("Login successful.")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print directly for now but we will need to agree on a communication mechanism between business logic and TUI (callback functions/bubbletea messages pattern/channels etc)

Copy link
Copy Markdown
Member

@silv-io silv-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks very clean

@carole-lavillonniere carole-lavillonniere force-pushed the drg-359-inline-token-authentication-with-environment-variable-for-ci branch from 6025783 to 0df30e7 Compare February 3, 2026 13:44
Base automatically changed from drg-359-inline-token-authentication-with-environment-variable-for-ci to main February 3, 2026 13:44
@carole-lavillonniere carole-lavillonniere force-pushed the drg-358-implement-browser-based-auth-flow branch from a63e5e0 to 35fa4ec Compare February 3, 2026 13:45
@carole-lavillonniere carole-lavillonniere merged commit 031c94b into main Feb 3, 2026
@carole-lavillonniere carole-lavillonniere deleted the drg-358-implement-browser-based-auth-flow branch February 3, 2026 13:45
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