Skip to content

Conversation

talboren
Copy link
Member

No description provided.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 10, 2025
@vercel
Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
keep ⬜️ Ignored (Inspect) Visit Preview Jul 10, 2025 8:31am

@dosubot dosubot bot added the Bug Something isn't working label Jul 10, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Authentication Method Conflict

The commit fails to enable simultaneous Basic and X-Scope-OrgID authentication as intended. This is because the authentication_type field is a Literal type, allowing only one value at a time, so only one authentication method is ever applied. The refactoring to build a credentials dictionary does not address this. To support both, the logic should check for the presence of credentials (e.g., username/password and x_scope_orgid) instead of relying on authentication_type.

keep/providers/grafana_loki_provider/grafana_loki_provider.py#L125-L137

"""
credentials = {}
if self.authentication_config.authentication_type == "Basic":
username_password = f"{self.authentication_config.username}:{self.authentication_config.password}".encode(
"utf-8"
)
encoded_credentials = base64.b64encode(username_password).decode("utf-8")
credentials["Authorization"] = f"Basic {encoded_credentials}"
if self.authentication_config.authentication_type == "X-Scope-OrgID":
credentials["X-Scope-OrgID"] = self.authentication_config.x_scope_orgid
return credentials

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@talboren talboren changed the title 5160 bug if loki uses both tenant id and basic for authentication simultaneously it wont work fix(provider): loki auth Jul 10, 2025
@talboren talboren enabled auto-merge (squash) July 10, 2025 08:51
Copy link
Contributor

@Kiryous Kiryous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! some test would be great tho :-)

@talboren talboren merged commit c5e23ca into main Jul 10, 2025
24 of 26 checks passed
@talboren talboren deleted the 5160-bug-if-loki-uses-both-tenant_id-and-basic-for-authentication-simultaneously-it-wont-work branch July 10, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: If Loki uses both tenant_id and Basic for authentication simultaneously, it won't work.

2 participants