Skip to content

[code sync] Merge code from sonic-net/sonic-gnmi:master to kubesonic - #234

Merged
mssonicbld merged 2 commits into
Azure:kubesonicfrom
mssonicbld:sonicbld/kubesonic-merge
Sep 16, 2026
Merged

mssonicbld merged 2 commits into
Azure:kubesonicfrom
mssonicbld:sonicbld/kubesonic-merge

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator
* 9d14569 - (origin/master, origin/HEAD, test, master) gnmi_server: apply role-based authorization uniformly across auth methods (#782) (2026-09-15) [xq9mend]<br>```

xq9mend and others added 2 commits September 15, 2026 17:08
…hods (#782)

Description
Moves the readonly/readwrite role check in authenticate() out of the cert-only branch into a shared checkRoleAccess() helper, and runs it once after any authentication mechanism succeeds.

Motivation and Context
The role check previously only executed inside the client-certificate authentication branch. Clients authenticating via password or JWT bypassed the readonly/readwrite role gate entirely. This change applies the same role check uniformly regardless of which authentication mechanism succeeded.

Semantics are unchanged: same role postfix handling (noaccess/readonly/readwrite), same ConfigTableName guard, same fail-closed-on-writes behavior when no matching role is found.

How Has This Been Tested?
gofmt -l reports no formatting issues. Full go build ./... was not achievable in this environment due to pre-existing local toolchain gaps unrelated to this change (missing generated swsscommon bindings, a libyang C header/API mismatch, missing PAM dev headers) — confirmed by building the unmodified upstream gnmi_server package in the same environment, which fails with the identical errors. No unit test changes were made.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld
mssonicbld merged commit 5559d6d into Azure:kubesonic Sep 16, 2026
12 checks passed
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.

2 participants