Skip to content

Conversation

@onselakin
Copy link
Contributor

This pull request introduces middleware components for authentication, authorization, service registration, and token management in the ESO-server project. These changes enhance the security and integration capabilities of the server with the tenant manager. The most important changes include the implementation of authentication and authorization middleware, service registration logic, token management functionality, and the integration of these components into the main application.

Middleware for Authentication and Authorization:

  • handlers/middleware/auth.go: Added AuthMiddleware to handle authentication and authorization, including JWT validation and tenant manager authorization checks. This includes methods like ValidateToken, CheckAuthorization, and callTenantManagerAuthz.

Service Registration:

  • handlers/middleware/service_registration.go: Implemented ServiceRegistration for ESO-server's self-registration with the tenant manager, including creating policies for authorization. Methods like RegisterWithTenantManager and SetupPolicies ensure the server registers itself and sets up necessary permissions.

Token Management:

  • handlers/middleware/token_manager.go: Added TokenManager to manage OAuth token exchange and refresh. This includes methods to ensure valid tokens (EnsureValidToken) and handle token exchange (exchangeToken).

Integration into Main Application:

  • main.go: Integrated the middleware package into the main application by adding it to the import statements.…nt manager integration

@linear
Copy link

linear bot commented Jul 1, 2025

ESS-2 Integrate ESO server with existing AuthZ on tenant-manager

In order for us to safely use ESO server, we need to be able to:

  • Authenticate user requests;
  • Authorize user requests;

Both of these activities need t obe checked by middleware-integrating ESO server with tenant-manager

- Merged authorization implementation from HEAD with new features from main
- Added proper import aliases to avoid middleware naming conflicts
- Integrated tenant manager authentication with all new handlers
- Applied authorization middleware to all routes including:
  - Generator routes with CRUD operations
  - Scan job routes with CRUD operations
  - Scan finding routes with read operations
  - Target routes with CRUD operations
  - Generator state routes with read/delete operations
- Maintained permissions routes for tenant management
- Added new content route for secrets with authorization
- Unified function signature to include all handlers from both branches
@github-actions github-actions bot added size/XL and removed size/XL labels Jul 29, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Jul 31, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Jul 31, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Jul 31, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Jul 31, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 1, 2025
…ng-authz-on-tenant-manager

# Conflicts:
#	Tiltfile
#	database/database.go
#	deploy/local/eso-server.yaml
#	go.mod
#	go.sum
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 1, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 1, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 3, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 3, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 3, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 3, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 9, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 9, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 13, 2025
@github-actions github-actions bot added size/XL and removed size/XL labels Aug 14, 2025
…t for service registration in Helm chart and middleware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants