Skip to content

Commit b33e3eb

Browse files
committed
Bump lightspeed-stack to authorization commit
Bump lightspeed-stack submodule to include the authorization changes from lightspeed-core/lightspeed-stack#356 Use the new authorization features to restrict access to the assisted-chat service to, for now, Red Hat employees only. In the future we can open this up to all authenticated users.
1 parent d839c04 commit b33e3eb

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

Containerfile.assisted-chat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# vim: set filetype=dockerfile
2-
# This is the digest of quay.io/lightspeed-core/lightspeed-stack:dev-20250814-7a531cb
3-
FROM quay.io/lightspeed-core/lightspeed-stack@sha256:90deb575e0c18bdcf9721aa7614826653ad13b717c992f12b89b6e1f0413179c
2+
# This is the digest of quay.io/lightspeed-core/lightspeed-stack:dev-20250826-969904b
3+
FROM quay.io/lightspeed-core/lightspeed-stack@sha256:5582703f6220f0668ea465c66e81f2a5a425437e1a12b4419c8a61e930a11aad
44

55
RUN python3 -m ensurepip --default-pip && pip install --upgrade pip
66

scripts/query.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ if [[ -n "$CONVERSATION_ID" ]]; then
218218
else
219219
# Only select model for new conversations
220220
echo "Selecting model for new conversation..."
221+
222+
if ! get_ocm_token; then
223+
echo "Failed to get OCM token for query"
224+
return 1
225+
fi
226+
221227
MODELS=$(get_available_models)
222228
model_selection=$(select_model "$MODELS")
223229
MODEL_NAME=$(echo "$model_selection" | cut -d'|' -f1)

template.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,40 @@ objects:
165165
jwt_configuration:
166166
user_id_claim: ${USER_ID_CLAIM}
167167
username_claim: ${USERNAME_CLAIM}
168+
role_rules:
169+
- jsonpath: "$.realm_access.roles[*]"
170+
operator: "contains"
171+
value: "redhat:employees"
172+
roles: ["redhat_employee"]
173+
authorization:
174+
access_rules:
175+
- role: redhat_employee
176+
actions:
177+
- get_models
178+
# Temporarily we only want redhat employees to be able to use the service,
179+
# uncomment when we want to allow all authenticated users
180+
# - role: "*"
181+
# actions:
182+
- query
183+
- streaming_query
184+
- get_conversation
185+
- list_conversations
186+
- delete_conversation
187+
- feedback
188+
- get_metrics
189+
- info
190+
# "nobody" is a made up role, doesn't do anything but just good for being explicit
191+
# about what is not allowed by anyone
192+
- role: nobody
193+
actions:
194+
# This exposes the database password - once LSC fixes this issue we
195+
# can allow this for employees
196+
- get_config
197+
# For now we don't want to let even administrators / employees access other users conversations
198+
- query_other_conversations
199+
- delete_other_conversations
200+
- list_other_conversations
201+
- read_other_conversations
168202
mcp_servers:
169203
- name: mcp::assisted
170204
url: "${MCP_SERVER_URL}"

0 commit comments

Comments
 (0)