Download the PHP package polaris/admin without Composer

On this page you can find all versions of the php package polaris/admin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package admin

polaris/admin

Admin for Polaris for PHP: the operator API over users, sessions, MFA, organizations, audit drains and statistics, for admin users and API keys, every action audited. API-only: a dashboard, a support tool or an integration talks to /admin/*; hosts add nothing beyond the plugin.

polaris/audit is required and must be registered too: every admin action is an admin.* event in its store, and the statistics come from its tables. In Laravel, Symfony and Yii both instances go in the adapter's plugins configuration; the two tables (polaris_admin_grant, polaris_admin_key) join polaris:install, schema:create and schema:diff, the routes join the route table.

Principals

Three kinds of caller reach the admin routes, resolved by the plugin's middleware from the Authorization header; the routes are declared auth: public so core's bearer middleware leaves API keys alone.

An impersonation token (below) never reaches the admin routes (403 admin/impersonation_denied); a disabled user is no operator; a lapsed grant or key is refused (401 admin/unauthorized).

The role matrix, deny by default, each role including the ones below it:

capability viewer support admin owner
read users, sessions, MFA factors, organizations, audit, stats
revoke sessions
ban and unban, set a password, remove or reset MFA, set member roles, delete users and organizations
impersonate
manage grants, API keys and audit drains

An organization-scoped principal (a grant or key whose scope is an organization id) may call the organization routes for that organization only (read it, its drains, its audit trail; delete it, set its members' roles; create keys and grants scoped to it); the user, key, grant and stats routes need the instance scope (403 admin/forbidden).

Routes

All under /admin. Errors are RFC 9457 problem documents (admin/unauthorized, admin/forbidden, admin/impersonation_denied, admin/not_found, admin/conflict, admin/invalid_input) that also carry core's error and message. Lists are oldest first (ids are UUID v7) and cursor-paginated (cursor is the next_cursor of the previous page; limit 50 by default, 200 at most).

Route Needs Does
GET /admin/users?email=&status=&cursor=&limit= read the users (exact email, status active/disabled/locked)
GET /admin/users/{id} read one user with last_active_at from the audit plugin
POST /admin/users/{id}/ban, /unban manage core's disable (every session ends) and enable (lockout cleared)
POST /admin/users/{id}/password {password} manage a new password under the policy; every session ends
DELETE /admin/users/{id} manage core's anonymisation (tombstone row, factors and challenges scrubbed)
POST /admin/users/{id}/impersonate impersonate an access token acting as the user (below)
GET /admin/users/{id}/sessions read the active sessions
DELETE /admin/users/{id}/sessions/{sessionId}, DELETE /admin/users/{id}/sessions support end one, or every, session
GET /admin/users/{id}/mfa read the factors, without secrets or destinations
DELETE /admin/users/{id}/mfa/{factorId} manage remove one factor (the last one under enforced MFA is refused: reset instead)
DELETE /admin/users/{id}/mfa manage remove every factor and recovery code
GET /admin/organizations?status=&cursor=&limit= read the organizations
GET /admin/organizations/{id} read one organization with its members and their roles
PATCH /admin/organizations/{id}/members/{userId}/roles {roles} manage replace a member's roles (the last owner stays)
DELETE /admin/organizations/{id} manage core's soft deletion
GET /admin/audit?names=&actor_id=&subject_id=&organization_id=&from=&to=&cursor=&limit= read the instance-wide trail (newest first)
GET, POST /admin/organizations/{id}/drains read, own the organization's audit drains; a new signed webhook drain (endpoint, secret, filter)
DELETE /admin/organizations/{id}/drains/{drainId}, POST .../drains/{drainId}/test own delete; record admin.drain_tested and answer the drain's delivery state
GET /admin/stats read totals, sign-ups, sign-ins and active users over 24h, 7d and 30d
GET, POST /admin/keys, DELETE /admin/keys/{id} own the API keys (the secret is in the creation response only)
GET, POST /admin/grants, DELETE /admin/grants/{id} own the admin grants

Impersonation

POST /admin/users/{id}/impersonate answers an access token whose sub is the user, with amr: ["impersonation"], mfa: false, the impersonated_by claim (the operator's id) and impersonator_type, and no session (sid) behind it: it cannot be refreshed, stepped up, switched to an organization or logged out, so it lives exactly one access-token TTL (auth.access_token.ttl, 15 minutes by default). It reads and acts as the user on core's routes, never on the admin routes; a superadmin cannot be impersonated; a disabled account is refused. Hosts render a banner from the claim.

Audit

Every mutation is recorded through polaris/audit as admin.<action> (admin.user_banned, admin.password_set, admin.user_impersonated, admin.session_revoked, admin.mfa_reset, admin.member_roles_changed, admin.organization_deleted, admin.drain_created, admin.key_created, admin.grant_created, ...), the operator as actor (actor_type admin for a user, api_key for a key), the target as subject, the operator's role and scope in data, beside the core event the action emits (user.disabled, mfa.factor_removed, ...). GET /audit/types lists the names.

CLI

polaris admin:key <name> <role> [--scope=] [--allow=cidr,...] [--expires=] prints the key once; polaris admin:grant <email> <role> [--scope=] [--expires=] grants a role. Both take --bootstrap=<file> (or POLARIS_BOOTSTRAP) naming the application, as the other Polaris commands.

License

MIT. Polaris for PHP is created and maintained by 2am.tech.


All versions of admin with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
polaris/audit Version ^0.6
polaris/cli Version ^0.6
polaris/core Version ^0.6
psr/clock Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
symfony/console Version ^7.0 || ^8.0
symfony/uid Version ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package polaris/admin contains the following files

Loading the files please wait ...