Add OpenConfig user provider - #513
Open
rgildein wants to merge 3 commits into
Open
Conversation
rgildein
marked this pull request as draft
August 20, 2026 14:13
rgildein
force-pushed
the
feat/openconfig-user
branch
from
August 21, 2026 05:51
1227441 to
aa94822
Compare
Implement UserProvider for the OpenConfig provider, targeting the standard OpenConfig path: openconfig-system:system/aaa/authentication/users/user[username=X]/config Nokia SR Linux limitation: the OpenConfig user model on SRLinux does not expose password or ssh-public-key as writable config leaves — only username and role are settable, and only a single role is accepted. The provider raises UnsupportedFieldError for spec.password, spec.sshPublicKey, and spec.roles when more than one role is given. Since spec.password is mandatory in the CRD, User CRs will always reach Ready=False (terminal) on Nokia SRL via the OpenConfig provider. Also adds a gnmi testdata file documenting the expected device state for a user created with a single role. Co-authored-by: Claude <claude@anthropic.com> Signed-off-by: Robert Gildein <rgildein@users.noreply.github.com>
rgildein
force-pushed
the
feat/openconfig-user
branch
from
August 21, 2026 06:26
aa94822 to
f480dcc
Compare
…feat/openconfig-user
Rewrite the user provider to target vanilla OpenConfig rather than Nokia SRLinux-specific behavior: - Support password, ssh-key and role — all standard OpenConfig user config leaves (openconfig-system:system/aaa/authentication/users) - Use gNMI update (Patch) instead of replace (Update) for user creation — Juniper rejects replace for new entries with "statement not found" - Password excluded from UnmarshalJSON to avoid perpetual diffs (device returns hashed value that never matches plaintext) - Remove Nokia-specific UnsupportedFieldError for password/sshPublicKey - Remove CodeIgnoredField from apistatus — not needed for vanilla OpenConfig; revert related changes to conditions.go and user_controller.go - Only retain single-role constraint (OpenConfig role leaf is a single value, not a leaf-list — confirmed on both Juniper and Nokia) - Replace user.txt testdata with proper user.txtar including secrets and full expected gNMI state with ssh-key Tested against Juniper vJunos-Evolved 26.2R1.7 via containerlab. Co-authored-by: Claude <claude@anthropic.com> Signed-off-by: Robert Gildein <rgildein@users.noreply.github.com>
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
rgildein
marked this pull request as ready for review
September 2, 2026 08:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OpenConfig provider implementation for the
Userresource targetingthe standard OpenConfig path:
openconfig-system:system/aaa/authentication/users/user[username=X]/configWhat changed
Initial implementation (
Add OpenConfig user provider):EnsureUser/DeleteUserfor the OpenConfig providerusername,password,role, andssh-key— all standardOpenConfig user config leaves
Patch) instead of replace for user creation —Juniper rejects gNMI replace for new list entries with
statement not found; update works for both create and updatepasswordexcluded fromUnmarshalJSONto avoid perpetual diffs —the device returns the hashed value which never matches the plaintext
spec.roleswith more than one entry returnsUnsupportedFieldError—the OpenConfig
roleleaf is a single value (not a leaf-list),confirmed on both Juniper and Nokia
Vanilla OpenConfig cleanup (
Update OpenConfig user provider to vanilla OpenConfig):UnsupportedFieldErrorforspec.passwordandspec.sshPublicKey— vanilla OpenConfig supportsboth fields
CodeIgnoredFieldfromapistatusand related changes toconditions.goanduser_controller.go— not needed once passwordis fully supported
user.txtartestdata including secrets and full expected gNMIstate with
ssh-keyTesting
Tested against real devices via containerlab and live gNMI probing.
Juniper vJunos-Evolved
Device: Juniper vJunos-Evolved 26.2R1.7 (
vrnetlab/juniper_vjunosevolved:26.2R1.7-EVO) via containerlab, gNMI at10.47.43.114:50051What was tested:
username,password,role, andssh-key— all acceptedpasswordis writable and returned hashed (\$9\$...) on read — write-only in practicessh-keyis readable and writable — drift detection works correctlyroleaccepts only a single string (Juniper native class name e.g.superuser,operator)openconfig-aaa-types:SYSTEM_ROLE_ADMINis accepted (treated as plain string by Juniper)openconfig-aaa-types:SYSTEM_ROLE_OPERATORis rejected (Must be a string of alphanumericals, dashes or underscores) — Juniper uses native class names, not OpenConfig identitiesInvalidArgument)statement not found) — gNMI update used insteadVerify user config:
Example output:
{ "config": { "password": "\$9\$Dqjm5n6A01hCtvWXxdV.Pf5n/CAp", "role": "superuser", "ssh-key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDSGgsAKZn/hxPMKyfwKboiOEeuL9bTqW79QfEQ8h0kpGhkFJJEWR1e3BvXpdT9KYQOaKQnNw32atULweSQQNGh6 IronCore Test", "username": "testplan" }, "username": "testplan" }Nokia SR Linux
Device: Nokia SR Linux 26.7.1 (
ghcr.io/nokia/srlinux:26.7.1) via containerlab, gNMI at172.20.20.2:57400What was tested:
configcontainer foruseronly exposes[username, role]—passwordandssh-keyare not writable leaves on Nokia SRL via OpenConfigopenconfig-aaa-types:SYSTEM_ROLE_ADMIN) — native Nokia role names rejected withFailedPreconditionInvalidArgument