Package org.jwcarman.who.admin
package org.jwcarman.who.admin
-
ClassDescriptionThe checks every admin endpoint makes before it looks at anything the request names, in this order: signed out is
401; a request whose permissions lack the one needed is403; then, for a request that changes something, thecallerdecides: a browser session whose sign-in is no longer recent is401and must sign in again; a session cookie with an API key or bearer token beside it, which the session signed in and the header did not, is403, as is any sign-in that is neither a browser session nor a bearer token or an API key.The answer toPOST /who/invitations.The addresses of who's email sign-in.who's identity admin endpoints:GET /identities?status=&role=&email=&page=0&size=20pages through identities, oldest first, as anIdentityPage.The email addresses identities sign in with, as the admin endpoints read them. who's autoconfiguration supplies one, anEmailLinkIdentityEmails, when email sign-in is on; without it the endpoints show no addresses and refuse a search by address.A request named an identity that does not exist, or an id that is not a UUID.A request to change an identity that holds a permission the caller does not: deactivating or reactivating it, or assigning or removing one of its roles. who's admin endpoints change only identities whose every permission, as who resolves them whatever their status, the caller holds too; for an API key, those its scopes keep.One page of identities, asGET /who/identitiesanswers it.An identity as who's admin endpoints show it.A request to an admin endpoint that who refuses as it stands: a page or size out of range, a status who does not know, a body that is not the expected JSON, or a search by email address without email sign-in.POST /invitationswith{"email": "...", "roles": ["..."]}invites the address throughInvitationService.invite(String, Set)and answers201with aCreatedInvitation;rolesmay be left out for none.A change that would leave no active identity holdingWhoAdminPermissions.IDENTITIES_MANAGE: deactivating the last one, or removing the role through which the last one holds it.Keeps who's admin endpoints from leaving no active identity that holdsWhoAdminPermissions.IDENTITIES_MANAGE.A signed-in request to an admin endpoint whose permissions lack the one it needs, such asWhoAdminPermissions.IDENTITIES_READ.A request to grant a role that carries a permission the caller does not hold itself. who's admin endpoints grant only roles within the caller's own permissions; for an API key, those its scopes keep.GET /who/roleslists every role with its permissions, by name.A role asGET /who/rolesshows it.A request to deactivate the identity making it: an admin cannot lock themselves out.A request named a role that does not exist. who's admin endpoints assign and remove only roles the application has made.The permissions who's admin endpoints check. who defines them but grants them to no one: an application assigns them to its own roles, as it would any permission, for example withRbacService.addPermissionToRole(role, WhoAdminPermissions.IDENTITIES_READ).