Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
LINE requests used to fall back to the
warehouserole when ERP identity lookup failed. That allowed an unknown user to read operational data through the low-privilege role. This change removes the fallback: unresolved identities now reach the tool gateway without a role and are denied.Changes
line bot/line_access.pyto isolate LINE role resolution and gateway authorization.Verification
pytest: passed.git diff --check: passed.Scope and integration notes
backend/auth.pystill grants access when it runs without a Streamlit context. Fixing that safely requires an authenticated server-side authorization context that reaches the underlying tool functions. Changing the current fallback to an unconditional denial would also block legitimate LINE and agent gateway calls.The
/trigger_morning_briefingendpoint also remains unauthenticated. Its worker callsget_ai_response(prompt)without a service role, so this change will deny its tool calls if the briefing feature is enabled.LINE_BRIEFING_ENABLEDis disabled by default. The follow-up should protect the endpoint with an authenticatedPOSTrequest and run the briefing under an explicit least-privilege service principal.This PR remains a draft until those authorization paths are integrated and tested together.