8000 chore: add debug logs to GetPrincipal by rsbh · Pull Request #970 · raystack/frontier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: add debug logs to GetPrincipal #970

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
merged 3 commits into from
Apr 25, 2025
Merged

Conversation

rsbh
Copy link
Member
@rsbh rsbh commented Apr 25, 2025

No description provided.

Copy link
vercel bot commented Apr 25, 2025

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

Name Status Preview Comments Updated (UTC)
frontier ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 6:17am

Copy link
Contributor
@Copilot Copilot AI left a comment

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 the GetPrincipal function by adding debug and error logging to improve traceability when fetching the principal.

  • Added error logs for failures in retrieving session user and extracting session context.
  • Inserted a debug log for cases where no client assertions match.
Comments suppressed due to low confidence (3)

core/authenticate/service.go:767

  • [nitpick] Consider using a structured logging approach such as s.log.Errorf (if supported) to pass the error as a parameter instead of formatting it, thereby preserving the error context.
s.log.Error(fmt.Sprintf("unable to get session user by id: %v", err))

core/authenticate/service.go:777

  • [nitpick] Similarly, consider using a structured logging method to log the session extraction error by directly passing the error to the logger if supported.
s.log.Error(fmt.Sprintf("unable to extract session from context: %v", err))

core/authenticate/service.go:902

  • [nitpick] If possible, include additional context (such as input parameters or a summary of received assertions) in this debug log to help diagnose mismatches in client assertions.
s.log.Debug("none of the client assertions matched")

@coveralls
Copy link

Pull Request Test Coverage Report for Build 14658185677

Details

  • 1 of 3 (33.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 33.254%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/authenticate/service.go 1 3 33.33%
Totals Coverage Status
Change from base Build 14657720416: 0.0%
Covered Lines: 9767
Relevant Lines: 29371

💛 - Coveralls

@rsbh rsbh merged commit f3adf9f into main Apr 25, 2025
7 checks passed
@rsbh rsbh deleted the chore_getprincipal_debug_logs branch April 25, 2025 06:36
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
0