Read one stored NSS account (auditor and above)
const url = 'https://example.com/api/admin/nss/users/1';const options = {method: 'GET', headers: {'X-Ssoossh-Key-Secret': '<X-Ssoossh-Key-Secret>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/admin/nss/users/1 \ --header 'X-Ssoossh-Key-Secret: <X-Ssoossh-Key-Secret>'The posix_users row with this uid as stored, the ssoossh user linked to it, every stored membership row for the uid, and what a host’s lookup by the uid is served now, built by the lookup code itself (absent with not_served saying why when the lookup finds nothing). Reads only the database: where a host’s miss would ask the directory, this does not.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The account’s stored uid
Responses
Section titled “Responses”The account
object
object
DirDisabled is the directory’s own disabled flag (nss.disabled_filter).
DirectoryID is the ldap.id_attribute value, absent when that is unset.
DN is the entry’s DN from the last read; empty once another entry took the DN (the row is then matched by DirectoryID alone).
GID is the stored gid attribute, before nss.auto_private_groups; absent when the entry has none (accepted only under “true”, where it is followed rather than frozen).
Groups is every stored membership row for the uid, by gid, whether or not the group is served. The primary group is not among them unless a membership row names it.
object
AddedAt is when ssoosshd first stored the membership, which is not the date of the add in the directory (it does not timestamp member values). Absent for a membership the first full import stored: present before that import.
Name and State describe the stored group with that gid, and are absent when no stored group has it.
Home and Shell are the directory’s attributes as stored, before the nss.default_home and nss.default_shell fallbacks.
Person is the ssoossh user linked to this entry at login. Absent for shared and service accounts and for anyone who has not logged in.
object
UserID addresses the person’s admin page, /admin/users/{id}.
Served is what a host’s lookup by this uid gets now. Absent when the lookup finds nothing; NotServed then says why.
object
GID is the primary gid after nss.auto_private_groups.
Groups is every membership served, primary first.
object
WithheldReason sums up the collisions that withhold the row.
Example
{ "data": { "groups": [ { "state": "withheld" } ], "not_served": "withheld", "served": { "status": "active" }, "state": "withheld" }}The uid is not a number
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}Not authenticated
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}Not authorized as auditor
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}No stored account has that uid, or NSS is disabled
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}