Skip to content

webui: let the members of a NACM group share a home page - #1817

Open
troglobit wants to merge 5 commits into
mainfrom
webui-home2
Open

troglobit wants to merge 5 commits into
mainfrom
webui-home2

Conversation

@troglobit

Copy link
Copy Markdown
Contributor

Description

WEBUI_HOME names the users that get a page of their own, but the image is built before the users exist. An operator account added in the field is not in the list and lands on the regular pages.

Take @group=/path as well, for all members of a NACM group, so the factory configuration can ship the group and its rules:

WEBUI_HOME=operator=/panel/ @guest=/stats/

A user entry wins over a group, and of several groups the first in the list. A group never applies to an admin, who could otherwise not get back to the regular pages to leave it.

Only an admin may read the NACM data over RESTCONF, so the groups are read with sysrepocfg at login and the home is kept in the session. A login is refused when they cannot be read.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

WEBUI_HOME names the users that get a page of their own, but the image
is built before the users exist.  An operator account added in the
field is not in the list and lands on the regular pages.

Take @group=/path as well, for all members of a NACM group, so the
factory configuration can ship the group and its rules:

    WEBUI_HOME=operator=/panel/ @guest=/stats/

A user entry wins over a group, and of several groups the first in the
list.  A group never applies to an admin, who could otherwise not get
back to the regular pages to leave it.

Only an admin may read the NACM data over RESTCONF, so the groups are
read with sysrepocfg at login and the home is kept in the session.  A
login is refused when they cannot be read.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
troglobit requested a review from mattiaswal November 23, 2026 14:58
@troglobit troglobit added the ci:main Build default defconfig, not minimal label Nov 23, 2026
The developer's guide left out two things a fresh machine needs for
the tests.  make test runs Infamy in a container and needs Docker or
podman for that, and the test specification generator imports the
Python yaml module.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Only an admin can read the NACM configuration, so nobody else, and no
application acting for them, can tell what groups a user is in.

    POST /restconf/operations/infix-system:whoami

returns the name of the calling user and its groups, nothing about
other users.  The factory rules deny guests all RPCs, so permit this
one ahead of that rule, and add the same rule to existing
configurations on upgrade.

The rpc_output() helper in Infamy now returns a leaf-list as a list.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The groups behind a @group entry in WEBUI_HOME were read with
sysrepocfg, as root.  That goes around NACM and stops working the day
the WebUI runs as an unprivileged user.

Ask for them over RESTCONF as the user logging in, like everything
else.  The NACM rules must permit the members of a listed group to
call whoami, as the factory rules do for guest.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Comment thread src/webui/internal/handlers/nacm.go Resolved
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
@troglobit
troglobit requested a review from mattiaswal November 23, 2026 19:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:main Build default defconfig, not minimal

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants