Skip to content

Review apps and publishers

An app’s badge on the consent screen says who vouches for it (validation levels). Reviewers give and withdraw that trust: they review apps, and decide whether an account is a validated publisher. This page is for operators and reviewers; developers publish with the developer API. Every route is in the Admin API reference.

Versions. The review of clients and the publisher decisions over HTTP come with open-pryv.io 2.0.0-rc.92. The review of developers’ submissions, the decision notices and mail, ifUpdatedAt on publisher decisions and the audiences offered to developers come with 2.0.0-rc.94, with the developer API. The separation of duties, the client list filters level, region and owner with total, and metadataUrl come with 2.0.0-rc.96. The separation of duties covers the team members of the owner’s account, and the active delegates of those members, from 2.0.0-rc.98.

Route Permission
GET /system/admin/oauth/clients ?queue=&pending=&origin=&status=&level=&region=&owner=&limit=&skip= oauthClients:read
GET /system/admin/oauth/clients/{clientId} oauthClients:read
POST .../clients/{clientId}/approve { digest, reason? } oauthClients:review
POST .../clients/{clientId}/unvalidate { reason } oauthClients:review
POST .../clients/{clientId}/suspend { reason } oauthClients:review
POST .../clients/{clientId}/resume { reason? } oauthClients:review
GET .../clients/{clientId}/submission (owner’s home core, 2.0.0-rc.94) oauthClients:read
POST .../clients/{clientId}/submission/approve { digest, reason? } (owner’s home core, 2.0.0-rc.94) oauthClients:review
POST .../clients/{clientId}/submission/reject { digest, reason } (2.0.0-rc.94) oauthClients:review
GET /system/admin/oauth/publishers ?status=&limit=&skip= publishers:read
GET /system/admin/oauth/publishers/{userId} publishers:read
PUT /system/admin/oauth/publishers/{userId} { status, displayName?, regions?, reason, ifUpdatedAt? } publishers:review

They take an administrator session or the admin key in scope full (refused under break-glass); none asks for a second factor (each act is reversible and recorded). From 2.0.0-rc.96, for an administrator session, every act but suspend (publisher decisions included) is served by the owner’s home core only (see Separation of duties); with the admin key, only the two submission routes marked so above are. The app-reviewer role holds every permission above, owner too; operator, auditor and viewer hold the two reads. Creating or editing an operator’s clients stays with bin/oauth-client.js.

Region rule. OAuth clients and publishers are platform-wide, so these permissions come only from grants at scope platform or region:<r> (a zone, hosting or core scope gives none, nor do a core’s local grants). Each route keeps to the rows the caller’s grants cover: platform covers every row; region:<r> covers a row whose regions are all r; a row without regions needs platform. This holds for the lists and the reads too. A row out of reach answers 404, as a missing one. A developer’s app takes its publisher’s regions at creation.

GET /system/admin/oauth/clients?queue=true is computed at each read: developer clients whose review does not stand, clients under review, and, from 2.0.0-rc.94, developer clients waiting with a submission (pending=true keeps only those; each line then carries pending: { digest, submittedAt, by }, by being the account id or delegate:<relationship id>, never a username).

Filters and total (from 2.0.0-rc.96). The client list also takes level (nonValidated, publisherValidated or appValidated, the level the client has now), region (a region key: the clients whose regions list it; -: the clients listing none, served in every region) and owner (an account id: the developer clients it owns). They combine with queue, pending, origin, status, limit and skip; a malformed value answers 400. The answer carries the lines in clients and, in total, the number of clients every filter keeps at the time of the call, before skip and limit (a client added or removed between two calls shifts the pages). Filters and total apply after the region rule: a reviewer scoped to a region neither sees nor counts a client out of its reach.

Metadata-document clients are addressed by their row key: their line carries clientId: "url~<40 hex>", the key every {clientId} route takes, and (from 2.0.0-rc.96) metadataUrl, the client’s id on the wire (a URL, which a path segment cannot carry: it answers 404 there). Their level follows the metadata-document mode, so they have no app review to approve or withdraw; suspend and resume apply as to any client.

Approve what was read. A client is answered with its review digest. approve takes that digest: without the current one it answers 409 stale-resource and writes nothing, and its answer does not give the new digest (read the client again), so what is approved is always what was read. On a developer’s client it records the app review; on a client under review it also approves the held changes. A row the registration rules now refuse answers 400 invalid-operation (nothing written; suspend still works on it).

Withdraw, suspend, resume. unvalidate withdraws a developer’s app review (the app falls back to its publisher’s level). suspend stops a client at once: authorization, consent and refresh refused, on every core. resume serves it again; it refuses a client under review or holding unapproved changes (approve it first).

Publisher suspended, app still reviewed. Suspending a publisher does not un-validate its reviewed apps: an app whose review stands keeps its badge and full policy. Suspend each such app to stop it.

From open-pryv.io 2.0.0-rc.96, an administrator does not decide about its own account’s applications. An administrator session whose account owns the client (a developer’s client) or is the publisher, is an active delegate of that account (a delegate’s token is a personal token of the account), or, from 2.0.0-rc.98, holds an active membership of that account (a team member of a group account) or is an active delegate of such a member (a member whose account is on the owner’s home core: a delegate token of the member’s account reads the membership’s endpoint there and may draft as that member), is refused approve, unvalidate, resume, submission/approve, submission/reject and every publisher decision: 403 review-conflict-of-interest, data: { clientId | publisherUserId, reason }, with reason:

  • own-account: the session’s account owns the client or is the publisher;
  • delegate-of-owner: it is an active delegate of that account;
  • delegation-unverified: the owner’s core cannot tell the administrator apart from a delegate (a delegation record without the delegate’s account id, written when the delegate’s core did not report it, while neither that username nor the administrator’s account is on the owner’s core), the owner has more delegation records than one read returns (1000; from 2.0.0-rc.98, 1000 active records or more, invited and stale records are not read), or a developer’s client names no owner. From 2.0.0-rc.98 a record naming the administrator decides first, wherever it sits in the list: the answer is then delegate-of-owner (before, an earlier record that could not be told apart, or a list at the read limit, answered delegation-unverified; both are refusals);
  • member-of-owner (from 2.0.0-rc.98): it holds an active membership of that account, whatever its team and level;
  • membership-unverified (from 2.0.0-rc.98): the owner’s core cannot tell the administrator apart from a member (a membership recorded without its member’s account id, while neither that username nor the administrator’s account is on the owner’s core, see below);
  • delegate-of-member (from 2.0.0-rc.98): it is an active delegate of an account holding an active membership of that account, the member’s account being on the owner’s home core;
  • member-delegation-unverified (from 2.0.0-rc.98): the owner’s core cannot tell the administrator apart from an active delegate of such a member, or a member has 1000 active delegation records or more (see below).

Nothing is written; the refusal is recorded in the platform trail like other refused acts (who tried, the error id, and the target with conflict: the reason, elsewhere for a 421 or unavailable for a 503). suspend stays open to such an administrator: it only stops a client (for instance on a leaked key), and lifting the suspension (resume) is left to another reviewer. The admin key holds no account and is not concerned; a client without owner (an operator’s or a metadata-document client) is never concerned. The check comes after the region rule (out of reach: 404). A relationship that is invited, stale or detached does not count (an invitation becomes active only by the delegate’s own accept), nor a membership request not yet accepted, nor a membership ended or expired; any membership of the account counts, whatever its team and level. For a member, the same delegations count as for the owner (active only), one level only: a delegate of a delegate of a member, or a member of a member, is not followed.

Served by the owner’s home core. The delegation records and the memberships live in the owner’s account (and, from 2.0.0-rc.98, for each member whose account is on that core, the member’s list of delegates is read there too), so for an administrator session these acts are served by the owner’s home core only, as submission is. Any other core, the administrator’s own included, answers 421 not-home-core with data.check: 'review-conflict': send the request to the owner’s home core (the platform portal 0.4.0 does it). A lookup that fails answers 503 review-conflict-unavailable (data.check: 'review-conflict', nothing done, retry): it is never read as “no relationship”. The admin key and suspend stay valid on every core. Before 2.0.0-rc.96 these acts were served on every core: a review tool must send them to the owner’s home core (an earlier portal than 0.4.0 does not). What the administrator’s own account records about its relationships is not read: the delegate’s or member’s side grants nothing.

Memberships recorded without an account id (from 2.0.0-rc.98). A membership records its member’s account id (clientData.cmc.membership.memberUserId, stamped by the member’s core on the membership request). One made before 2.0.0-rc.98, or through a member’s core of an earlier release, names its member by username only; when neither that username nor the administrator’s account is on the owner’s core, the act is refused as membership-unverified: another reviewer, one whose account is on the owner’s core, or the admin key decides. Multi-core platforms: one such membership whose member is on another core makes every reviewer whose account is not on the owner’s core refused for that owner, until the membership is re-issued (the member leaves and asks again, the owner accepts, once every core runs 2.0.0-rc.98); meanwhile, review from the owner’s core or with the admin key.

A membership is the owner’s record. The member’s name and account id are what the offer the owner accepted said. Matching by account id is a guarantee only for an offer minted by a platform core, which stamps the requesting account’s own id, never a value sent by the client. An owner (or its delegate) that accepts an offer served by a host it controls, or by a core of another platform, can record a chosen reviewer as its member: that reviewer is then refused for this owner (member-of-owner) although it never asked to join. So member-of-owner is a relationship recorded by the owner’s side, not proof of an act of the reviewer; another reviewer, suspend and the admin key stay open, and each refusal is in the platform trail.

Delegates of members (from 2.0.0-rc.98). A member’s active delegates are compared the same way as the owner’s, after the memberships, and a delegate of any member naming the administrator decides first (delegate-of-member). Otherwise, a member’s active delegate recorded without its account id whose username is not on the owner’s core, while the administrator’s account is not on that core either, cannot be told apart from the administrator: every such administrator is refused member-delegation-unverified for that owner, while a reviewer whose account is on the owner’s core is not. A member with 1000 active delegation records or more (invited and stale records are not read) has every administrator session refused the same way. The answer names neither the member nor the delegation: the operator finds the members from the owner’s membership accesses. It is lifted when the member ends that delegation and attaches the delegate again (the new record carries its account id when the delegate’s core reports it) or drops delegations, or when the owner ends the membership; meanwhile a reviewer whose account is on the owner’s core, or the admin key, decides. Only members on the owner’s core are read: a member whose account is on another core holds its delegation records there, so its delegates are not seen by this rule. Nothing changes for delegate tokens: what a delegated session may read or do is as before.

Consequences: an owner whose home core refuses replicated grants (a strict local policy) is reviewed only by an administrator holding a local grant there, or with the admin key; a client or publisher row whose account exists on no core (a deleted account) answers 421 on every core to a session, and is decided with the admin key or bin/oauth-client.js.

What it does not cover. The rule compares accounts, direct active delegations and (from 2.0.0-rc.98) active memberships and the active delegates of members whose account is on the owner’s core, nothing more. It does not see a former team member who drafted what is reviewed and left the team before the act (the draft’s modifiedBy and the deleted membership keep the trace; before 2.0.0-rc.98, no team member at all), a delegate of a member whose account is on another core than the owner’s (the member’s delegation records are not on the owner’s core; before 2.0.0-rc.98, no delegate of a member at all), a former delegate of a member that kept the membership’s endpoint (a bearer credential that does not end with the delegation: detaching a delegate does not revoke the relationship credentials it already read), a membership held under another identity (a second account, an account of another platform, a plain shared access the owner hands over), a delegate of a delegate of the owner (from open-pryv.io 2.0.0-rc.98 such an account no longer obtains a token on the owner’s account through the delegate’s token, see No delegation chains; it still can by setting the intermediate account’s password and signing in as it), one person holding two accounts, a relationship ended just before the act or begun just after it, nor the admin key and shell access, which are the operator’s. Who receives the app-reviewer role remains an organisational decision.

From 2.0.0-rc.94. A developer asks for an app review by submitting a draft: the client row then holds pending: { digest, submittedAt, by, eventId, eventModified }, and the content is the draft event in the developer’s account. So:

  1. Read it on the owner’s home core. GET .../submission reads the draft again and compares it with the live client: the reviewed fields it changes (fields, diff with from and to), whether the live row already holds it (applied), the row approving it would write (candidate). Another core answers 421 not-home-core without naming the right one: ask the cores you reach (the portal does, and each core that is not the home core records that try as a refused read in its trail). The read is recorded in the platform trail (target: { clientId, draftEventId }, no content), since it reads an account.
  2. Approve only the version submitted. submission/approve takes pending.digest. It is possible only while the draft still gives that digest (matches), is the event version submitted (changedSinceSubmit: false) and lists only audiences the platform still offers (audiencesOutsideBound empty). Otherwise: 409 stale-resource (a newer submission replaced it), 409 submission-changed, 409 submission-gone (the draft was deleted or moved), 409 no-submission (withdrawn or decided meanwhile), 400 invalid-submission (refused by the registration rules, or an audience no longer offered). The developer then submits again. An approval applies the draft (never its secret, owner, origin, kind nor regions), records the app review on it and clears pending.
  3. Or reject it. submission/reject takes pending.digest and a reason, on any core with the admin key (from 2.0.0-rc.96, an administrator session on the owner’s home core, where the separation of duties is checked). It clears the request only: the live version keeps serving. When the submission’s content was applied at submit (an app without a standing review), it stays live: the answer says applied: true; suspend the app to stop it.

approve on the client itself also clears a submission whose content it approves. From a core’s shell, bin/oauth-client.js show prints a waiting submission and reject-submission <clientId> --digest <d> --reason <text> rejects it; there is no approval of a submission from the shell (the tool does not read account data).

PUT /system/admin/oauth/publishers/{userId} sets status (none, pending, validated, suspended), optionally displayName (at most 128 characters, shown on consent screens once validated) and regions (null removes them), with a reason. It counts for every app of the account, on every core, from its next consent offer or refresh. Creating a publisher row needs scope platform; a reviewer scoped to a region decides only the rows assigned to its region and may only leave them in regions it covers.

From 2.0.0-rc.94, the account writes its own row when it asks for a validation, with the name it asks for and the developer terms it accepted (agreement, which decisions keep). So a decision validated on a row none or pending names what the reviewer saw: displayName (the name validated) or ifUpdatedAt (the row’s updatedAt as read: 409 stale-resource when the account changed it since); with neither it answers 400. Review tools that validated rows without either must be updated. The trail records the name before and after.

A stored row that cannot be read is never replaced unseen: a reader at scope platform sees { userId, unreadable: true }, and a decision on it needs replaceUnreadable: true (its former trail and agreement are lost).

From 2.0.0-rc.94. A decision about a developer’s app (approve, submission/approve, submission/reject, unvalidate, suspend, resume, when it changed the row), or a change of status of a publisher account that entered the developer space itself (it accepted the developer terms, asked for a validation, or holds a developer app), made on the account’s home core, leaves:

  • an event in the account: oauth-app/decision on the app’s stream, or oauth-publisher/decision on the developer space stream, { act, clientId?, status, level?, reason, applied?, at }, with createdBy and modifiedBy both system;
  • one mail to the account, template oauth-review-decision (en and fr), switch services.email.sendOauthReviewDecision (on by default), template name services.email.oauthReviewDecisionTemplate.

Neither names the reviewer: write the reason for the developer and the app’s team to read. A decision taken on another core is valid but leaves nothing in the account and sends no mail, so take decisions on the account’s home core (the portal sends the submission acts there anyway). A decision about any other account is recorded only. Every act answers notified: { event, mail }; the answer waits a few seconds at most for the mail (past that it says mail: false and the send goes on, logged). An account without its :_cmc:apps stream gets no notice event (logged); the decision stands.

The mail template. A deployment whose templates were seeded before 2.0.0-rc.94 does not have oauth-review-decision: add it with bin/mail.js templates set from components/mail/templates/oauth-review-decision/ (en and fr), or, with method: mandrill, create a template of that name in your Mandrill account. Its variables are USERNAME, SERVICE_NAME, PUBLISHER (true for a publisher decision), APP_NAME, CLIENT_ID, ACT, STATUS, LEVEL, DECISION (the decision in English words), REASON, APPLIED, and one flag per act (ACT_APPROVE, ACT_APPROVE_SUBMISSION, ACT_REJECT_SUBMISSION, ACT_UNVALIDATE, ACT_SUSPEND, ACT_RESUME) and per publisher status (STATUS_VALIDATED, STATUS_SUSPENDED, STATUS_PENDING, STATUS_NONE), true for the decision’s own, so that a template words the decision in its own language. APP_NAME and REASON are free text: let the template escape them. See Email configuration.

The policy lives in the configuration, platform-wide:

Key Default Meaning
oauth.clientRegistration.mode curated delegated opens the developer API (registration modes)
oauth.clientRegistration.whoMayRegister validatedPublishers or anyAccount
oauth.clientRegistration.levels.<level> everything allowed what an app of each level may do (per-level policies)
oauth.clientRegistration.audiences [] 2.0.0-rc.94: the resource URLs a developer’s app may name, each an absolute https URL or the per-account form https://{username}.<host>/..., compared as written. Empty: no developer can register an app (every app names an audience); the boot warns in mode delegated. Clients the operator registers and metadata-document clients are not concerned. Configuration files only
oauth.clientRegistration.limits appsPerAccount: 20, creationsPerDay: 5 per account; configuration files only
oauth.developerTerms { url: null, version: null } terms a developer accepts (both or neither; url https); a new version is accepted again before the next create or submit; configuration files only
services.email.sendOauthReviewDecision true the decision mail (2.0.0-rc.94)

mode, whoMayRegister and levels can also be held in the platform store (from 2.0.0-rc.93). An audience removed from the list does not change apps already registered, but a submission naming it can no longer be approved (audiencesOutsideBound).

Every act is recorded in the platform trail of the core that served it (who acted with which grant, the client or publisher, status and level before and after, the reason, the digest given, for a submission its event and the reviewed fields changed, and from 2.0.0-rc.94 notified), in the acting administrator’s own trail and, when that account is on this core, in the trail of the client’s owner (oauth.client.reviewed) or of the publisher (oauth.publisher.reviewed). There the actor is named platform-administrator, never the reviewer’s account. The reads of platform rows are not recorded; a submission read is (it reads an account).