Skip to content

[gNSI][Certz] Add missing tests for gnsi/certz#5435

Open
morrowc wants to merge 9 commits into
mainfrom
gnsiAuthz
Open

[gNSI][Certz] Add missing tests for gnsi/certz#5435
morrowc wants to merge 9 commits into
mainfrom
gnsiAuthz

Conversation

@morrowc
Copy link
Copy Markdown
Contributor

@morrowc morrowc commented May 6, 2026

Here is a summary of the changes made:

  1. Renamed authz1_4_test.go to authz_test.go using git mv to preserve history.
  2. Added policy-prefix-suffix-match to policy.json to define prefix and suffix matching rules for principals.
  3. Implemented Authz-1.5 subtest in authz_test.go to verify the matching behaviors.
  4. Updated metadata.textproto description to "General Authz tests".
  5. Updated README.md title and resolved the TODO for Authz-1.5 with the actual test procedure.

@morrowc morrowc requested a review from a team as a code owner May 6, 2026 20:48
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 expands the gNSI authorization test suite by implementing validation for prefix and suffix matching on principals. It includes necessary updates to the test configuration, documentation, and file structure to support these new test cases, ensuring that gNSI policies correctly handle specific principal patterns.

Highlights

  • Test Expansion: Implemented the Authz-1.5 subtest to validate principal prefix and suffix matching behaviors in gNSI authorization policies.
  • Configuration Updates: Added the 'policy-prefix-suffix-match' policy definition to policy.json to support the new testing requirements.
  • Refactoring: Renamed authz1_4_test.go to authz_test.go to better reflect the broader scope of the authorization tests.
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 the 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 counterproductive. 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.

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.

@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented May 6, 2026

Pull Request Functional Test Report for #5435 / 1686329

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
Authz: General Authz tests
086ee8e8 Log
Cisco 8000E status
Authz: General Authz tests
87ace102 Log
Cisco XRd status
Authz: General Authz tests
e48ec13d Log
Juniper ncPTX status
Authz: General Authz tests
17cb043a Log
Nokia SR Linux status
Authz: General Authz tests
c7f97627 Log
Openconfig Lemming status
Authz: General Authz tests
67226c14 Log

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
Authz: General Authz tests
Cisco 8808 status
Authz: General Authz tests
Juniper PTX10008 status
Authz: General Authz tests
Nokia 7250 IXR-10e status
Authz: General Authz tests

Help

Copy link
Copy Markdown
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 introduces a new test case, Authz-1.5, to verify principle prefix and suffix matching, including necessary updates to the test README, metadata, and policy configuration. The review feedback highlights a critical issue regarding loop variable capture in subtests, a bug in the authz.Verify helper function that affects test validation, and minor spelling corrections for the term 'principal' in both documentation and test code.

Comment thread feature/gnsi/authz/tests/authz/authz_test.go
Comment thread feature/gnsi/authz/tests/authz/authz_test.go Outdated
Comment thread feature/gnsi/authz/tests/authz/README.md Outdated
Comment thread feature/gnsi/authz/tests/authz/authz_test.go Outdated
@morrowc morrowc requested a review from a team as a code owner May 6, 2026 21:36
@morrowc
Copy link
Copy Markdown
Contributor Author

morrowc commented May 7, 2026

Ok.. I think finally ready for review.

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.

2 participants