-
Notifications
You must be signed in to change notification settings - Fork 109
feat(access-control-service): AccessControlService added as a new micro service #3767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 introduces a new Access Control Service as a standalone microservice to handle user authorization for computing unit requests. The service validates JWT tokens, checks user permissions against computing units in the PostgreSQL database, and returns authorization decisions with appropriate user metadata headers.
- Adds a new Dropwizard-based microservice for access control authorization
- Implements database queries to determine user privileges (READ/WRITE/NONE) for computing units
- Creates shared utilities for HTTP header constants used by the access control system
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
core/config/src/main/scala/edu/uci/ics/amber/util/PathUtils.scala |
Adds path constant for the new access control service directory |
core/build.sbt |
Defines the AccessControlService project with dependencies on Auth, Config, and DAO modules |
core/auth/src/main/scala/edu/uci/ics/texera/auth/util/HeaderField.scala |
Defines HTTP header constants for user metadata passed by the access control service |
core/auth/src/main/scala/edu/uci/ics/texera/auth/util/ComputingUnitAccess.scala |
Implements database logic to query user access privileges for computing units |
core/access-control-service/src/test/scala/edu/uci/ics/texera/AccessControlResourceSpec.scala |
Comprehensive test suite covering authorization scenarios including valid/invalid tokens and access permissions |
core/access-control-service/src/main/scala/edu/uci/ics/texera/service/resource/HealthCheckResource.scala |
Simple health check endpoint for service monitoring |
core/access-control-service/src/main/scala/edu/uci/ics/texera/service/resource/AccessControlResource.scala |
REST endpoints for GET/POST authorization requests |
core/access-control-service/src/main/scala/edu/uci/ics/texera/service/access/AccessChecker.scala |
Core authorization logic with path matching and computing unit access validation |
core/access-control-service/src/main/scala/edu/uci/ics/texera/service/AccessControlServiceConfiguration.scala |
Dropwizard configuration class |
core/access-control-service/src/main/scala/edu/uci/ics/texera/service/AccessControlService.scala |
Main Dropwizard application entry point |
core/access-control-service/src/main/resources/logback.xml |
Logging configuration |
core/access-control-service/src/main/resources/access-control-service-web-config.yaml |
Service configuration for port 9096 |
core/access-control-service/project/build.properties |
SBT version configuration |
core/access-control-service/build.sbt |
Build configuration with Dropwizard dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../access-control-service/src/main/scala/edu/uci/ics/texera/service/access/AccessChecker.scala
Outdated
Show resolved
Hide resolved
.../access-control-service/src/main/scala/edu/uci/ics/texera/service/access/AccessChecker.scala
Outdated
Show resolved
Hide resolved
bobbai00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start! I left some comments.
core/auth/src/main/scala/edu/uci/ics/texera/auth/util/ComputingUnitAccess.scala
Outdated
Show resolved
Hide resolved
.../access-control-service/src/main/scala/edu/uci/ics/texera/service/access/AccessChecker.scala
Outdated
Show resolved
Hide resolved
...ntrol-service/src/main/scala/edu/uci/ics/texera/service/resource/AccessControlResource.scala
Show resolved
Hide resolved
bobbai00
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
...ntrol-service/src/main/scala/edu/uci/ics/texera/service/resource/AccessControlResource.scala
Show resolved
Hide resolved
core/auth/src/main/scala/edu/uci/ics/texera/auth/util/ComputingUnitAccess.scala
Outdated
Show resolved
Hide resolved
...ntrol-service/src/main/scala/edu/uci/ics/texera/service/resource/AccessControlResource.scala
Show resolved
Hide resolved
chenlica
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a few iterations of discussion, this PR is in a good shape.
Overview
This PR is fixing the first part of #3634. The full PR had so many changes so we broke it down into two PRs. This PR is the first one that introduce Access Control Service only without its usage in any part of the system.
Test cases
Changes
Currently, the folder named
access-control-serviceis added with its dependencies toauthfolder. Currently, it has test cases to make sure its functionality is working correctly.AccessControlServicecore/access-control-service/...AccessControlService.scala), configuration model (AccessControlServiceConfiguration.scala), authorization logic, REST endpoint (AccessControlResource.scala), and unit tests (AccessControlResourceSpec.scala).core/auth/src/main/scala/edu/uci/ics/texera/auth/util/ComputingUnitAccess.scalaREAD,WRITE,NONE) for a given Computing Unit.core/auth/src/main/scala/edu/uci/ics/texera/auth/util/HeaderField.scalax-user-cu-access,x-user-id, etc.) that are injected by the Access Control Service.