Skip to content

refactor: Refactor authentication handling and update role assignment#977

Merged
Avijit-Microsoft merged 3 commits into
bs-generic-kmfrom
pk-km-modularity
Jun 25, 2026
Merged

refactor: Refactor authentication handling and update role assignment#977
Avijit-Microsoft merged 3 commits into
bs-generic-kmfrom
pk-km-modularity

Conversation

@Pavan1-Microsoft

Copy link
Copy Markdown

Purpose

This pull request introduces several key changes focused on improving authentication flexibility and simplifying API route security. The main updates include adding utility functions for extracting user authentication details, providing a sample user for development, and removing enforced authentication dependencies from multiple API routers. Additionally, there are infrastructure enhancements related to Azure role assignments.

Authentication & Authorization Improvements:

  • Added get_authenticated_user_details and get_tenantid utility functions in src/api/auth/auth_utils.py to extract user details and tenant ID from request headers, supporting both Easy Auth and a local development fallback.
  • Introduced a sample_user dictionary in src/api/auth/sample_user.py to allow the app to function without authentication in development environments.
  • Removed the get_current_user dependency from all API endpoints in src/api/modules/embeddings/router.py, src/api/modules/ingestion/router.py, src/api/modules/pipelines/router.py, and src/api/modules/processing/router.py, making endpoints accessible without enforced authentication. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22]

Infrastructure & Azure Role Assignments:

  • Added a new Azure role assignment resource searchContribRole in infra/modules/roles.bicep to grant the backend service principal contributor access to the search service.
  • Commented out the AI agent setup step in azure.yaml to prevent failures during deployment when the agent is not required. [1] [2]

These changes collectively improve the developer experience, simplify local development, and enhance infrastructure role management.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

…nd simplify user role checks

Add search contributor role assignment in Bicep template
Comment out AI agent setup steps in Azure YAML
Update dependencies in requirements.txt for compatibility
@Avijit-Microsoft Avijit-Microsoft merged commit 18d4208 into bs-generic-km Jun 25, 2026
2 of 3 checks passed
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