Skip to content

fix(authz): fix Authorization V2 service logging to log direct entitlements config correctly#3036

Open
ryanulit wants to merge 1 commit intomainfrom
fix/auth-svc-v2-dir-entitlements-logging
Open

fix(authz): fix Authorization V2 service logging to log direct entitlements config correctly#3036
ryanulit wants to merge 1 commit intomainfrom
fix/auth-svc-v2-dir-entitlements-logging

Conversation

@ryanulit
Copy link
Contributor

Proposed Changes

Fix #3035

Checklist

  • I have added or updated unit tests
  • I have added or updated integration tests (if appropriate)
  • I have added or updated documentation

Testing Instructions

@ryanulit ryanulit requested a review from a team as a code owner January 28, 2026 20:47
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ryanulit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the logging behavior within the Authorization V2 service. The primary goal is to ensure that the 'AllowDirectEntitlements' configuration is logged consistently and at an appropriate verbosity level, making it easier to diagnose and understand the service's setup during initialization.

Highlights

  • Logging Level Adjustment: Changed the log level for the 'direct entitlements enabled' message from 'Info' to 'Debug' in the Authorization V2 service registration, aligning it with other configuration logging.
  • Structured Configuration Logging: Ensured that the 'AllowDirectEntitlements' configuration is explicitly included in the structured log output when the Authorization V2 service configuration is logged.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Logs flow, debug deep, Config details now appear, Truth in every line.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves the logging for the Authorization V2 service configuration by correctly adding the allow_direct_entitlements setting to the structured configuration log. My review includes a suggestion to remove a redundant log statement which was introduced, to further clean up the code. Overall, this is a good fix that improves log clarity.

Comment on lines +85 to +88
if authZCfg.AllowDirectEntitlements {
l.Debug("direct entitlements are enabled for authorization service")
}

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This log statement is redundant because the allow_direct_entitlements configuration is now included in the structured log on line 83, thanks to the changes in service/authorization/v2/config.go. To avoid duplicate log entries and keep the code concise, this block can be removed.

Copy link
Member

Choose a reason for hiding this comment

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

I kinda agree with this - it is in the line above (as config.allow_direct_entitlements). Is there a need to call it out explicitly now?

@github-actions
Copy link
Contributor

Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 185.755408ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 114.826687ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 370.317358ms
Throughput 270.04 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 39.070178827s
Average Latency 388.872238ms
Throughput 127.97 requests/second

@github-actions
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Authorization V2 service logging does not log direct entitlements config correctly

2 participants