Skip to content

Implements the frontend logic for gNSI Authz#549

Merged
sneelam20 merged 1 commit intosonic-net:masterfrom
niranjanivivek:gnsi_authz_fe
Mar 11, 2026
Merged

Implements the frontend logic for gNSI Authz#549
sneelam20 merged 1 commit intosonic-net:masterfrom
niranjanivivek:gnsi_authz_fe

Conversation

@niranjanivivek
Copy link
Contributor

@niranjanivivek niranjanivivek commented Dec 5, 2025

This commit enables support for policy-based authorization of gRPC requests in gNMI server and handles the Authz Rotate() RPC for secure policy updates.

HLD Reference : gNSI HLD

Dependency Chain for Merge

Please follow this merge order,

Backend Base PR: sonic-mgmt-common #sonic-net/sonic-mgmt-common#183 (Must be merged first)
Backend Incremental PR: sonic-mgmt-common #sonic-net/sonic-mgmt-common#200
Current PR: sonic-gnmi ##549

gNSI Authz - UT Results
=== RUN TestGnsiAuthzRotation
=== RUN TestGnsiAuthzRotation/RotateOpenClose
=== RUN TestGnsiAuthzRotation/RotateStreamRecvError
=== RUN TestGnsiAuthzRotation/RotateStreamSendError
=== RUN TestGnsiAuthzRotation/RotatePolicyEmptyRequest
=== RUN TestGnsiAuthzRotation/RotatePolicyEmptyUploadRequest
=== RUN TestGnsiAuthzRotation/RotatePolicyWrongJSON
=== RUN TestGnsiAuthzRotation/RotatePolicyNoVersion
=== RUN TestGnsiAuthzRotation/RotatePolicySuccess
=== RUN TestGnsiAuthzRotation/RotatePolicyNoFinalize
=== RUN TestGnsiAuthzRotation/RotateTheSamePolicyTwice
=== RUN TestGnsiAuthzRotation/RotateTheSamePolicyTwiceWithForceOverwrite
=== RUN TestGnsiAuthzRotation/ParallelRotationCalls
--- PASS: TestGnsiAuthzRotation (4.38s)
--- PASS: TestGnsiAuthzRotation/RotateOpenClose (0.02s)
--- PASS: TestGnsiAuthzRotation/RotateStreamRecvError (0.02s)
--- PASS: TestGnsiAuthzRotation/RotateStreamSendError (0.01s)
--- PASS: TestGnsiAuthzRotation/RotatePolicyEmptyRequest (0.02s)
--- PASS: TestGnsiAuthzRotation/RotatePolicyEmptyUploadRequest (0.02s)
--- PASS: TestGnsiAuthzRotation/RotatePolicyWrongJSON (0.02s)
--- PASS: TestGnsiAuthzRotation/RotatePolicyNoVersion (0.02s)
--- PASS: TestGnsiAuthzRotation/RotatePolicySuccess (0.02s)
--- PASS: TestGnsiAuthzRotation/RotatePolicyNoFinalize (0.02s)
--- PASS: TestGnsiAuthzRotation/RotateTheSamePolicyTwice (0.02s)
--- PASS: TestGnsiAuthzRotation/RotateTheSamePolicyTwiceWithForceOverwrite (0.02s)
--- PASS: TestGnsiAuthzRotation/ParallelRotationCalls (0.02s)
=== RUN TestGnsiAuthzRotateUnauthenticated
E0310 17:16:23.722383 2622035 gnsi_authz.go:71] authentication failed in Rotate RPC: rpc error: code = Unauthenticated desc = Unauthenticated
--- PASS: TestGnsiAuthzRotateUnauthenticated (6.31s)
=== RUN TestGnsiAuthzUnimplemented
=== RUN TestGnsiAuthzUnimplemented/ProbeUnimplemented
=== RUN TestGnsiAuthzUnimplemented/GetUnimplemented
--- PASS: TestGnsiAuthzUnimplemented (2.10s)
--- PASS: TestGnsiAuthzUnimplemented/ProbeUnimplemented (0.01s)
--- PASS: TestGnsiAuthzUnimplemented/GetUnimplemented (0.00s)
=== RUN TestCopyFile
=== RUN TestCopyFile/Success
=== RUN TestCopyFile/SrcNotExist
=== RUN TestCopyFile/SrcIsNotRegularFile
=== RUN TestCopyFile/DstParentNotExist
--- PASS: TestCopyFile (0.00s)
--- PASS: TestCopyFile/Success (0.00s)
--- PASS: TestCopyFile/SrcNotExist (0.00s)
--- PASS: TestCopyFile/SrcIsNotRegularFile (0.00s)
--- PASS: TestCopyFile/DstParentNotExist (0.00s)
=== RUN TestFileCheck
=== RUN TestFileCheck/RegularFile
=== RUN TestFileCheck/NonExistentFile
=== RUN TestFileCheck/IsDirectory
=== RUN TestFileCheck/SymlinkToFile
=== RUN TestFileCheck/SymlinkToDir
--- PASS: TestFileCheck (0.00s)
--- PASS: TestFileCheck/RegularFile (0.00s)
--- PASS: TestFileCheck/NonExistentFile (0.00s)
--- PASS: TestFileCheck/IsDirectory (0.00s)
--- PASS: TestFileCheck/SymlinkToFile (0.00s)
--- PASS: TestFileCheck/SymlinkToDir (0.00s)
Why I did it

Why I did it

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@niranjanivivek niranjanivivek marked this pull request as ready for review December 16, 2025 17:11
@niranjanivivek
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 549 in repo sonic-net/sonic-gnmi

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@niranjanivivek
Copy link
Contributor Author

@sreeiyer-1, Please review and approve.

@niranjanivivek
Copy link
Contributor Author

niranjanivivek commented Dec 19, 2025

Hi @ndas7 and @rlucus , @kishanps Please review .

@sreeiyer-1
Copy link

@sreeiyer-1, Please review and approve.

The changes look good

Copy link
Contributor

@ndas7 ndas7 left a comment

Choose a reason for hiding this comment

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

Could you please add more details in the description? Thanks.

@niranjanivivek
Copy link
Contributor Author

Could you please add more details in the description? Thanks.

Description is updated.

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ndas7
Copy link
Contributor

ndas7 commented Jan 9, 2026

Could you please add a link to the HLD in the description?

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: kanchanavelusamy <velusamyk@google.com>
@mssonicbld
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sneelam20 sneelam20 merged commit 5da416f into sonic-net:master Mar 11, 2026
9 checks passed
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.

7 participants