Skip to content

Conversation

quge009
Copy link
Collaborator

@quge009 quge009 commented Sep 8, 2025

Add:

  • in 'AGENT_LOCAL' mode:
    • return dev purpose admin (bool) and virtual_cluster (list)
  • in production mode
    • get value of key 'admin' and 'virtualCluster' from rest server api
  • authenticate logic:
    • if user is admin, or user is not admin but belong to a valid vc (set via env: COPILOT_VALID_VCS), authenticate success
    • else, authenticate fail
    • user's authenticate state will be valid inside Copilot for 1 hour, access within valid duration won't require rest server api call, access after valid duration requires rest server api call

Copilot

This comment was marked as outdated.

@quge009 quge009 requested review from yukirora and Copilot September 10, 2025 08:08
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements user group membership authentication for the Copilot system, adding support for both local development mode and production REST API authentication.

  • Adds REST API integration to verify user authentication via the rest server
  • Updates authentication logic to check admin privileges and virtual cluster membership
  • Changes configuration from "valid-groups" to "valid-vcs" (virtual clusters) across deployment files

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
authentication.py Implements production REST API authentication and updates local auth logic to return admin/virtual cluster info
copilot-chat-deployment.yaml.template Updates environment variable name from COPILOT_VALID_GROUPS to COPILOT_VALID_VCS
copilot-chat.yaml Changes configuration key from valid-groups to valid-vcs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

quge009 and others added 4 commits September 10, 2025 16:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@quge009 quge009 merged commit a3ea170 into dev Sep 10, 2025
1 check passed
@quge009 quge009 deleted the lequ/copilot/authenticate branch September 10, 2025 23:51
This was referenced Sep 15, 2025
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.

3 participants