Moss · API

server.identity

Answers who a principal is, resolved the way a request resolves it: { roles, scope }. With no identity seam on the app, the roles are the ones assignments names and scope is empty. Nobody signed in (null) and a principal the map does not list both wear the single role public. Example: ruth is not in the map.

Assignments
{
  grace: ['member'],
  linus: ['usher', 'member'],
  manager: ['manager'],
}
Identity per principal
[
  { principal: 'grace', roles: ['member'], scope: {} },
  {
    principal: 'linus',
    roles: ['usher', 'member'],
    scope: {},
  },
  { principal: 'ruth', roles: ['public'], scope: {} },
  { principal: null, roles: ['public'], scope: {} },
]
Output matches the expected value

Computed when this site was built, by the installed package, which does not run in a browser. The site’s checks recompute it on every change.