Add OpenConfig user provider - #513
Draft
rgildein wants to merge 1 commit into
Draft
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
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. |
Comment on lines
+37
to
+42
|
|
||
| // CodeIgnoredField signals that one or more spec fields were silently | ||
| // ignored during realization because the provider does not support them. | ||
| // The resource is still considered successfully configured. [WrapTerminalError] | ||
| // does not promote these errors to terminal. | ||
| CodeIgnoredField |
Contributor
There was a problem hiding this comment.
Honestly, this status code doesn't seem to follow the same semantics as all others do. Other status codes result in an error being returned (while this status code then returns nil from a reconcile) and also set the status condition to false (while this status code keeps it as true). As such, I would rather avoid having it.
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 User resource
(
internal/provider/openconfig/user.go) and a gnmi testdata file(
test/gnmi/testdata/openconfig/user.txt).Also introduces
CodeIgnoredFieldininternal/apistatusand updatesconditions.FromErrorto treat it asReady=Truewith a warning message —used when a provider successfully configures a resource but silently skips
fields that are not supported by the platform.
Nokia SRL limitation
The OpenConfig user model on Nokia SR Linux does not expose
passwordor
ssh-public-keyas writable leaves in theconfigcontainer underopenconfig-system:system/aaa/authentication/users/user[username=X]/config.Only
usernameandroleare settable. Additionally, only a singlerole is accepted — passing multiple roles results in
InvalidArgumentfrom the device.
Since
spec.passwordis mandatory in the CRD but cannot be set viaOpenConfig on Nokia SRL, the provider ignores it rather than failing.
The user is created with
usernameandroleonly, and the CR reachesReady=Truewith anIgnoredFieldwarning in the condition message:spec.sshPublicKey(optional) andspec.roleswith more than one entrystill return a terminal
UnsupportedFieldError.Juniper vJunos-Evolved comparison
The same OpenConfig path
(
openconfig-system:system/aaa/authentication/users/user[username=X]/config)was tested on a Juniper vJunos-Evolved 26.2R1.7 device. Juniper supports
passwordas a writable config leaf (returned as a hashed\$9\$...valueon read), making user password management possible there. However,
roleis also a single string on Juniper (not an array), and
ssh-public-keyis not part of the standard OpenConfig user model on Juniper either —
SSH key provisioning uses the separate
gnsi-credentialzservice(out of scope for this provider).
The testdata file documents the expected gNMI state for a user created
with a single role — the supported subset on both platforms.
Testing
Tested against real devices using containerlab and live gNMI probing.
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:
usernameand a singlerole— accepted,Ready=TruewithIgnoredFieldwarning for passwordpasswordviaconfigleaf — rejected by device (Options are [username, role])ssh-public-keyviaconfigleaf — rejected by device (Options are [username, role])rolevalues as an array — rejected by device (InvalidArgument)admin) — rejected withFailedPrecondition(leafref violation)openconfig-aaa-types:SYSTEM_ROLE_ADMINVerify user config:
Example output:
{ "openconfig-system:system/aaa/authentication/users": { "user": [ { "config": { "role": "SYSTEM_ROLE_ADMIN", "username": "testplan" }, "state": { "role": "SYSTEM_ROLE_ADMIN", "username": "testplan" }, "username": "testplan" } ] } }Juniper vJunos-Evolved
Device: Juniper vJunos-Evolved 26.2R1.7 (
vrnetlab/juniper_vjunosevolved:26.2R1.7-EVO) via containerlab, gNMI at172.20.20.2:50051What was tested:
username,password, and a singlerole— acceptedpasswordis writable and returned hashed (\$9\$...) on read — write-only in practiceroleas an array — rejected by device (InvalidArgument)ssh-public-keyin the user config — rejected (syntax error, expecting "@") — SSH keys require the separategnsi-credentialzserviceopenconfig-aaa-types:SYSTEM_ROLE_ADMIN— accepted (treated as a plain string)openconfig-aaa-types:SYSTEM_ROLE_OPERATOR— rejected (Must be a string of alphanumericals, dashes or underscores)operator,superuser) — acceptedVerify user config:
Example output:
{ "openconfig-system:system/aaa/authentication/users": { "user": [ { "config": { "password": "\$9\$j9iPT6/tOIcApM8x7Vbmf5T69Atu", "role": "superuser", "username": "testplan" }, "username": "testplan" } ] } }Manual testing