-
Notifications
You must be signed in to change notification settings - Fork 67
LCORE-598: RBAC E2E tests #1017
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
Merged
radofuchs
merged 1 commit into
lightspeed-core:main
from
radofuchs:LCORE_598_RBAC_E2E_tests
Jan 22, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
tests/e2e/configuration/library-mode/lightspeed-stack-rbac.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: Lightspeed Core Service (RBAC E2E Tests - Library Mode) | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| auth_enabled: true | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
|
|
||
| llama_stack: | ||
| use_as_library_client: true | ||
| library_client_config_path: run.yaml | ||
|
|
||
| user_data_collection: | ||
| feedback_enabled: true | ||
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_enabled: true | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
|
|
||
| # Conversation cache for storing Q&A history | ||
| conversation_cache: | ||
| type: "sqlite" | ||
| sqlite: | ||
| db_path: "/tmp/data/conversation-cache.db" | ||
|
|
||
| # JWK token authentication with role extraction | ||
| authentication: | ||
| module: "jwk-token" | ||
| jwk_config: | ||
| url: "http://mock-jwks:8000/.well-known/jwks.json" | ||
| jwt_configuration: | ||
| user_id_claim: "sub" | ||
| username_claim: "name" | ||
| # Role rules: extract roles from JWT claims | ||
| role_rules: | ||
| # Grant 'admin' role to users with admin=true in JWT | ||
| - jsonpath: "$.admin" | ||
| operator: "equals" | ||
| value: [true] | ||
| roles: ["admin"] | ||
| # Grant 'user' role to users with role=user in JWT | ||
| - jsonpath: "$.role" | ||
| operator: "equals" | ||
| value: ["user"] | ||
| roles: ["user"] | ||
| # Grant 'viewer' role to users with role=viewer in JWT | ||
| - jsonpath: "$.role" | ||
| operator: "equals" | ||
| value: ["viewer"] | ||
| roles: ["viewer"] | ||
| # Grant 'query_only' role based on permissions array containing 'query' | ||
| - jsonpath: "$.permissions[*]" | ||
| operator: "contains" | ||
| value: "query" | ||
| roles: ["query_only"] | ||
|
|
||
| # Authorization: map roles to actions | ||
| authorization: | ||
| access_rules: | ||
| # Admin role gets full access | ||
| - role: "admin" | ||
| actions: ["admin"] | ||
| # User role can query, access conversations, and provide feedback | ||
| - role: "user" | ||
| actions: | ||
| - "query" | ||
| - "streaming_query" | ||
| - "get_conversation" | ||
| - "list_conversations" | ||
| - "delete_conversation" | ||
| - "update_conversation" | ||
| - "feedback" | ||
| - "get_models" | ||
| - "get_tools" | ||
| - "info" | ||
| - "model_override" | ||
| # Viewer role can only read (no mutations) | ||
| - role: "viewer" | ||
| actions: | ||
| - "get_conversation" | ||
| - "list_conversations" | ||
| - "get_models" | ||
| - "get_tools" | ||
| - "info" | ||
| # Query-only role can only query (no model_override - must use defaults) | ||
| - role: "query_only" | ||
| actions: | ||
| - "query" | ||
| - "streaming_query" | ||
| # Everyone (*) role gets basic info access | ||
| - role: "*" | ||
| actions: | ||
| - "info" | ||
|
|
95 changes: 95 additions & 0 deletions
95
tests/e2e/configuration/server-mode/lightspeed-stack-rbac.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Lightspeed Core Service (RBAC E2E Tests) | ||
| service: | ||
| host: 0.0.0.0 | ||
| port: 8080 | ||
| auth_enabled: true | ||
| workers: 1 | ||
| color_log: true | ||
| access_log: true | ||
|
|
||
| llama_stack: | ||
| use_as_library_client: false | ||
| url: http://llama-stack:8321 | ||
| api_key: xyzzy | ||
|
|
||
| user_data_collection: | ||
| feedback_enabled: true | ||
| feedback_storage: "/tmp/data/feedback" | ||
| transcripts_enabled: true | ||
| transcripts_storage: "/tmp/data/transcripts" | ||
|
|
||
| # Conversation cache for storing Q&A history | ||
| conversation_cache: | ||
| type: "sqlite" | ||
| sqlite: | ||
| db_path: "/tmp/data/conversation-cache.db" | ||
|
|
||
| # JWK token authentication with role extraction | ||
| authentication: | ||
| module: "jwk-token" | ||
| jwk_config: | ||
| url: "http://mock-jwks:8000/.well-known/jwks.json" | ||
| jwt_configuration: | ||
| user_id_claim: "sub" | ||
| username_claim: "name" | ||
| # Role rules: extract roles from JWT claims | ||
| role_rules: | ||
| # Grant 'admin' role to users with admin=true in JWT | ||
| - jsonpath: "$.admin" | ||
| operator: "equals" | ||
| value: [true] | ||
| roles: ["admin"] | ||
| # Grant 'user' role to users with role=user in JWT | ||
| - jsonpath: "$.role" | ||
| operator: "equals" | ||
| value: ["user"] | ||
| roles: ["user"] | ||
| # Grant 'viewer' role to users with role=viewer in JWT | ||
| - jsonpath: "$.role" | ||
| operator: "equals" | ||
| value: ["viewer"] | ||
| roles: ["viewer"] | ||
| # Grant 'query_only' role based on permissions array containing 'query' | ||
| - jsonpath: "$.permissions[*]" | ||
| operator: "contains" | ||
| value: "query" | ||
| roles: ["query_only"] | ||
|
|
||
| # Authorization: map roles to actions | ||
| authorization: | ||
| access_rules: | ||
| # Admin role gets full access | ||
| - role: "admin" | ||
| actions: ["admin"] | ||
| # User role can query, access conversations, and provide feedback | ||
| - role: "user" | ||
| actions: | ||
| - "query" | ||
| - "streaming_query" | ||
| - "get_conversation" | ||
| - "list_conversations" | ||
| - "delete_conversation" | ||
| - "update_conversation" | ||
| - "feedback" | ||
| - "get_models" | ||
| - "get_tools" | ||
| - "info" | ||
| - "model_override" | ||
| # Viewer role can only read (no mutations) | ||
| - role: "viewer" | ||
| actions: | ||
| - "get_conversation" | ||
| - "list_conversations" | ||
| - "get_models" | ||
| - "get_tools" | ||
| - "info" | ||
| # Query-only role can only query (no model_override - must use defaults) | ||
| - role: "query_only" | ||
| actions: | ||
| - "query" | ||
| - "streaming_query" | ||
| # Everyone (*) role gets basic info access | ||
| - role: "*" | ||
| actions: | ||
| - "info" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 637
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 1767
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 2358
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 1498
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 1717
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 789
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 337
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 14918
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 305
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 767
🏁 Script executed:
Repository: lightspeed-core/lightspeed-stack
Length of output: 2372
Add mock-jwks to lightspeed-stack's depends_on to ensure RBAC test stability.
The RBAC E2E tests dynamically switch to a configuration that references
http://mock-jwks:8000/.well-known/jwks.jsonat runtime (see environment.py:before_feature for RBAC tests). When the lightspeed-stack container restarts with this config, there's no guarantee that mock-jwks is healthy and ready to serve JWKS tokens. Without an explicit dependency, the first RBAC authentication request could fail if mock-jwks hasn't fully started.Add the following to the lightspeed-stack service's
depends_onsection:This ensures Docker enforces proper startup ordering for RBAC test scenarios.
🤖 Prompt for AI Agents