Skip to content

feat(acl): enhance ACL support#1003

Merged
wakonig merged 4 commits into
mainfrom
fix/acl_support
Jul 23, 2026
Merged

feat(acl): enhance ACL support#1003
wakonig merged 4 commits into
mainfrom
fix/acl_support

Conversation

@wakonig

@wakonig wakonig commented Jul 13, 2026

Copy link
Copy Markdown
Member

Description

This PR improves the support for ACLs in BEC. In particular, it adds an e2e test for ensuring that they remain functional.

Type of Change

  • Forward service auth details from scan server to the procedure manager
  • Re-assign endpoints (ADMIN, INFO, USER) depending on what makes sense
  • Add e2e test for ACLs
  • Add context manager for temporarily using a different account

How to test

  • Run unit tests
  • Use the bec_lib/bec_lib/utils/user_acls_test.py module to set up your ACL environment and restart your server and client
  • run the client normally, use BW...
  • restart redis to reset the ACLs

Potential side effects

The renaming of the endpoints also means that certain data will be lost on redeployment

Additional Comments

The forwarding in the procedure manager is likely not needed. Instead, we should simply forward the entire connector.

Definition of Done

  • Documentation is up-to-date.

@wakonig
wakonig force-pushed the fix/acl_support branch 2 times, most recently from a88a0d8 to e0253b0 Compare July 22, 2026 08:52
@wakonig wakonig changed the title feat(acl): enhance ACL support with GUI synchronization and credentia… feat(acl): enhance ACL support Jul 22, 2026
@wakonig
wakonig force-pushed the fix/acl_support branch 3 times, most recently from 945f1b3 to 361bf2e Compare July 22, 2026 12:06
@wakonig wakonig self-assigned this Jul 22, 2026
@wakonig
wakonig marked this pull request as ready for review July 22, 2026 12:14
Copilot AI review requested due to automatic review settings July 22, 2026 12:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 enhances Redis ACL support across BEC services by forwarding active Redis ACL credentials to the ProcedureManager, reshaping several message endpoint namespaces to better match intended access levels, and adding an end-to-end ACL regression test.

Changes:

  • Forward the ScanServer’s current Redis ACL credentials into the ProcedureManager and authenticate its connector accordingly.
  • Add a temporary_user context manager and improve service ACL login/config handling (including ACLConfig.password).
  • Add an ACL-focused e2e test and adjust the e2e GitHub Action to run it in an isolated (flush-redis) setup.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
bec_server/tests/tests_scan_server/test_procedures.py Adds a unit test asserting ProcedureManager authenticates using forwarded credentials.
bec_server/bec_server/scan_server/scan_server.py Passes current ACL credentials into ProcedureManager at startup.
bec_server/bec_server/procedures/manager.py Adds redis_credentials support and authenticates the ProcedureManager Redis connector.
bec_lib/tests/test_bec_service.py Updates CLI parsing tests for new ACL config shape/behavior.
bec_lib/tests/test_bec_logger.py Updates expected log endpoint namespace (user/log).
bec_lib/tests/test_acl_login.py Adds tests for temporary user switching and ACL demo helpers; expands config login tests.
bec_lib/bec_lib/utils/user_acls_test.py Enhances ACL demo tooling (non_admin mode, admin detection/auth changes).
bec_lib/bec_lib/service_config.py Extends ACLConfig with an optional password field.
bec_lib/bec_lib/endpoints.py Reassigns several endpoints to different namespaces; removes/renames some endpoint helpers.
bec_lib/bec_lib/bec_service.py Adjusts CLI ACL argument handling and passes the typed ACL model into login flow.
bec_lib/bec_lib/acl_login.py Adds temporary_user, current_credentials, and refactors config-based login handling.
bec_ipython_client/tests/end-2-end/test_acl_e2e.py New ACL end-to-end test that verifies non-admin behavior and temporary elevation.
.github/actions/bec_e2e_install/action.yml Runs the ACL e2e test separately with --flush-redis, then runs remaining e2e tests with coverage append.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bec_lib/bec_lib/utils/user_acls_test.py
Comment thread bec_lib/tests/test_acl_login.py
@wakonig
wakonig force-pushed the fix/acl_support branch 2 times, most recently from 24bf644 to 2455c30 Compare July 22, 2026 13:22
@wakonig
wakonig requested a review from a team July 23, 2026 05:58
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.17949% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bec_lib/bec_lib/bec_service.py 71.42% 2 Missing and 2 partials ⚠️
bec_lib/bec_lib/acl_login.py 92.68% 2 Missing and 1 partial ⚠️
bec_lib/bec_lib/endpoints.py 85.71% 2 Missing ⚠️
bec_server/bec_server/scan_server/scan_server.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@wakonig
wakonig merged commit 2e39429 into main Jul 23, 2026
37 checks passed
@wakonig
wakonig deleted the fix/acl_support branch July 23, 2026 12:51
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