sso-manager-node

Directory Management

The SSO Manager ships with a built-in Directory & Inventory Management feature. Instead of just managing bare LDAP groups for your homelab, the Directory allows you to map out your infrastructure graph and assign rich metadata to your services.

Architecture

The Directory models your homelab infrastructure using a parent-child graph (e.g. Site -> Host -> Service).

There are three primary Kinds of resources you can define:

By defining this hierarchy, the SSO Manager builds a queryable graph of your infrastructure.

Automatic LDAP Group Creation

When you create a new Host or Service in the Directory via the web UI (or API), the SSO Manager will automatically provision two LDAP groups in your directory to govern access to that resource:

  1. <slug>_access (Member level access)
  2. <slug>_admin (Owner level access)

For example, if you create a Service named “Emby” with the slug app_emby, the system will create the LDAP groups app_emby_access and app_emby_admin. You can then assign users to these groups, and they will immediately see the service populate on their “My Services” dashboard.

Resource Metadata

Resources carry a flexible metadata JSON object that can store essential context for your applications. The UI natively supports the following metadata fields:

Common Metadata

Host Metadata

Service Metadata

Who sees which metadata

Metadata keys are declared in @simpleworkjs/directory-schema with an admin flag, and every API response is passed through its projection. There are three tiers:

Note that machine tokens are deliberately not admins, so anything a machine consumer needs (the firewall generator reads port / externalPort / isExternalReachable) has to be in the public tier. A metadata key that isn’t declared at all is treated as admin-only and will silently vanish for normal users — if you add a field to the admin form, declare it in the schema package too.

Catalog & access requests

The site root (/) is the end-user catalog — the only ungated page in the nav. It shows:

A request is a proposal to join an LDAP group. It targets the resource’s member-level group (the _access one, never _admin), and approving it performs the LDAP group add — so LDAP stays the single access-control truth and the table is just the audit trail. Approvals are idempotent: approving for someone already in the group succeeds rather than erroring.

Requests are decided by the resource’s owner, or by any directory admin. Mark a resource metadata.requestable = false to keep it out of self-service.

The Directory Management interface provides a Tree View toggle that visually nests your resources, making it easy to comprehend your network topography at a glance. You can also filter, search, and sort your entire infrastructure inventory. From the tree view, you can click the green + icon next to any resource to instantly add a child resource beneath it.

Directory & inventory list view

Slug conventions

Slugs are the stable identifiers automation keys off, so the tooling around the SSO Manager follows a shared convention:

The auto-created LDAP groups derive from the slug (<slug>_access / <slug>_admin), so keep slugs stable once access groups are in use.

Automatic registration

You don’t have to build the graph by hand — the theta42 tooling registers itself:

The stack itself (theta-env)

theta-env’s ./setup.sh seeds the directory on every run with the stack it deploys:

The seed is idempotent and non-destructive: a resource whose slug already exists is considered operator-owned — the seed only fills in metadata fields you haven’t set, and never overwrites your values.

Linux hosts (ldap-client)

The ldap-client join script enrolls a Debian/Ubuntu machine for LDAP login (SSSD/PAM), LDAP-backed sudo, and SSH keys from the directory — and, when given an SSO API token, registers the machine as a host_<hostname> resource with its IP, MAC, OS, and kernel, parented to the site named by its configured location.

Consumers of the directory

The inventory graph isn’t just documentation — other components read it to make decisions:

Planned consumers (end-user catalog, firewall/DNS generation) and the model/API gaps they need are tracked in directory_spec.md §9.

API

All of the above uses the same admin API the UI does (group app_sso_directory_admin or app_sso_admin):

Access requests are open to any authenticated user; deciding is gated per-resource inside the router (resource owner or directory admin):