Skip to content

Conversation

@ibpark-moreh
Copy link
Contributor

This PR improves the local dashboard development workflow by enabling login via OAuth2 or a Service Account.

Currently, the local development server for the dashboard only supports Basic Auth. If the API server uses OAuth2, logging in can be impossible (due to domain policies preventing redirects to localhost). While manually copying and pasting the OAuth cookie is possible but inconvenient.

This PR adds two new authentication methods for the dev server:

  1. OAuth2

When SKYPILOT_OAUTH_ENABLED=1 is set, running npm run dev will now fetch an OAuth token using the same mechanism as the SkyPilot SDK (i.e., the sky api login command).

export SKYPILOT_API_SERVER_ENDPOINT=https://skypilot-api.domain.com
export SKYPILOT_OAUTH_ENABLED=1
npm run dev
  1. Service Account

Additionally, this provides a method to log in using a Service Account token.

export SKYPILOT_API_SERVER_ENDPOINT=https://skypilot-api.domain.com
export SKYPILOT_ACCESS_TOKEN=sky_...
npm run dev

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

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