Skip to content

Feature/user login#43

Open
ewassef wants to merge 5 commits intomainfrom
feature/user-login
Open

Feature/user login#43
ewassef wants to merge 5 commits intomainfrom
feature/user-login

Conversation

@ewassef
Copy link
Copy Markdown
Contributor

@ewassef ewassef commented Aug 27, 2025

This pull request introduces authentication to the Vega CLI, requiring users to log in before executing most commands. It adds support for OAuth2 device code flow using Ory Hydra, including login/logout commands and multi-profile token management. The cluster creation workflow now records the authenticated user's TenantId in Kubernetes for downstream tooling. The codebase is refactored to integrate authentication checks and services throughout the CLI.

Authentication and Identity Management

  • Added LoginCommand and LogoutCommand to the CLI, supporting device code flow authentication and multi-profile management. Credentials are stored locally, and refresh tokens are used for automatic renewal. [1] [2]
  • Implemented AuthService and HydraDeviceFlowClient for OAuth2 device flow, token storage, refresh handling, and JWT claim extraction (TenantId). [1] [2] [3]
  • Updated dependency injection to register authentication services and HTTP client.

Command and Workflow Changes

  • Modified AppCommand to include login/logout commands, and updated Program.cs to enforce authentication before running most commands. [1] [2]
  • Refactored CreateClusterCommand to require authentication and write a ConfigMap containing the user's TenantId in the vega-system namespace during cluster creation. [1] [2] [3] [4]

Documentation Updates

  • Updated ReadMe.md with new authentication instructions, login/logout usage, and details about token storage and TenantId propagation. [1] [2]

Configuration

  • Added OAuth2/Hydra endpoint and claim settings to GlobalConfiguration for easy customization.

Dependency Injection

  • Registered new commands and services in the CLI's service provider for seamless integration.

These changes collectively introduce robust authentication, improve security, and enable user identity propagation throughout the Vega CLI and cluster lifecycle.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants