Skip to content

ATS-PFM-SEC-018Suspend and resume service principals: Capability Test Specification

Markdown

ATS-PFM-SEC-018

Suspend and resume service principals: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-PFM-SEC-018

Design

Executed by
TST-PFM-SEC-177, TST-PFM-SEC-184, TST-PFM-SEC-185

KindAcceptance test setProduct areaPlatformModuleSecurity, Customers and WorkspacesRevision2

Read atservices-platform ad3f6a65

Coverage

  • Rule gap: FND-PFM-SEC-075
  • Transition covered
  • Validation covered
  • Permission covered
  • Edge gap: FND-PFM-SEC-075
  • Failure gap: FND-PFM-SEC-075
  • Boundary gap: FND-PFM-SEC-075
  • Concurrency gap: FND-PFM-SEC-075
  • Invariant gap: FND-PFM-SEC-075
  • Interaction covered

Test Scenarios

9 scenarios proving CAP-PFM-SEC-018; 5 bound to an existing test.

01 List principals only for authorized staffpermissionapinegativetest
Proves
BR-CAP-PFM-SEC-018-01
Preconditions
Prepare a staff reader, customer Administrator and anonymous caller.
Steps
Request the principal list with each caller.
Expected
Return kind and status to the staff reader; return 403 to customer authority and 401 without authentication.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/integration/services/service-principals/hq-service-principals-routes.integration.spec.js#answers a staff reader 200 with every principal, this suite’s among them with its kind and status
Source
services-platform:modules/security/tests/integration/services/service-principals/hq-service-principals-routes.integration.spec.js#answers a staff reader 200 with every principal, this suite’s among them with its kind and status
02 Audit each effective status transition oncetransitionapinegativetest
Proves
BR-CAP-PFM-SEC-018-02
Preconditions
Prepare an active principal and an authorized manager and reader.
Steps
Suspend twice, resume and attempt management as the reader.
Expected
The first suspension advances the version and creates one event; the repeat creates none. Resumption records widening, and the reader cannot manage status.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/integration/services/service-principals/hq-service-principals-routes.integration.spec.js#records the suspension: the staff member, Rhythm’s customer, narrowing, from active to suspended
services-platform:modules/security/tests/integration/services/service-principals/hq-service-principals-routes.integration.spec.js#answers a second suspension 200 and records nothing more, the principal being suspended already
Source
services-platform:modules/security/tests/integration/services/service-principals/hq-service-principals-routes.integration.spec.js#records the suspension: the staff member, Rhythm’s customer, narrowing, from active to suspended
03 Separate unknown and malformed principal identifiersvalidationapinegativetest
Proves
BR-CAP-PFM-SEC-018-03
Preconditions
Prepare an unknown valid identifier and a malformed one.
Steps
Request suspension or resumption with each.
Expected
Return 404 and a refusal audit event for the unknown id without creating a principal; return 400 for malformed input.
Data
Use the records described in the setup.
Bound to
Source
services-platform:modules/security/tests/integration/services/service-principals/hq-service-principals-routes.integration.spec.js#answers an id no principal holds 404
04 Enforce registry status in a receiving handlerinteractionapinegativetest
Proves
BR-CAP-PFM-SEC-018-04
Preconditions
Prepare a principal invoking a handler that reads the registry.
Steps
Invoke while active, suspended and resumed.
Expected
Serve active and resumed calls and return 403 while suspended. This binding does not measure deployed cache propagation.
Data
Use the records described in the setup.
Bound to
Source
services-platform:modules/security/tests/integration/services/service-principals/registered-principals.integration.spec.js#is served 200
05 Preserve existing principals during activationtransitionapinegativetest
Proves
BR-CAP-PFM-SEC-018-05
Preconditions
Prepare a registry containing a suspended principal and a seed list with missing principals.
Steps
Reconcile twice, then submit a seed the database rejects.
Expected
Insert missing principals as active, preserve existing names and suspension, and report the rejected seed without throwing an activation failure.
Data
Use the records described in the setup.
Bound to
services-platform:modules/security/tests/integration/services/provisioning/ensure-service-principals.integration.spec.js#answers the failure rather than throwing, so the activation goes on, having inserted nothing
Source
services-platform:modules/security/tests/integration/services/provisioning/ensure-service-principals.integration.spec.js#answers both as inserted, and none unchanged
06 Service principal: active to suspendedtransitionapiproposed
Proves
BR-CAP-PFM-SEC-018-02
Preconditions
Use an isolated service principal in active state, with the required authority and guard fixtures.
Steps
[ { "do": "Suspend the registered caller as authorized staff and inspect status history.", "expect": "Read the resulting service principal as suspended; inspect the associated records and recorded history for this transition.", "provenance": "proposed", "source": [ "services-platform:modules/security/services/service-principals/principal-status.ts", "services-platform at ad3f6a65: modules/security/db/service-principals.table.ts; services/service-principals/principal-status.ts, registered-principals.ts; services/provisioning/ensure-service-principals.ts; docs/proposals/service-principals.md §8.1." ] } ]
Expected
Read the resulting service principal as suspended; inspect the associated records and recorded history for this transition.
Data
A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
Source
services-platform:modules/security/services/service-principals/principal-status.ts,services-platform at ad3f6a65: modules/security/db/service-principals.table.ts; services/service-principals/principal-status.ts, registered-principals.ts; services/provisioning/ensure-service-principals.ts; docs/proposals/service-principals.md §8.1.
07 Service principal: suspended to activetransitionapiproposed
Proves
BR-CAP-PFM-SEC-018-02
Preconditions
Use an isolated service principal in suspended state, with the required authority and guard fixtures.
Steps
[ { "do": "Resume the registered caller as authorized staff and inspect widening history.", "expect": "Read the resulting service principal as active; inspect the associated records and recorded history for this transition.", "provenance": "proposed", "source": [ "services-platform:modules/security/services/service-principals/principal-status.ts", "services-platform at ad3f6a65: modules/security/db/service-principals.table.ts; services/service-principals/principal-status.ts, registered-principals.ts; services/provisioning/ensure-service-principals.ts; docs/proposals/service-principals.md §8.1." ] } ]
Expected
Read the resulting service principal as active; inspect the associated records and recorded history for this transition.
Data
A disposable customer, workspace and named actor; a controllable clock where the transition depends on time.
Source
services-platform:modules/security/services/service-principals/principal-status.ts,services-platform at ad3f6a65: modules/security/db/service-principals.table.ts; services/service-principals/principal-status.ts, registered-principals.ts; services/provisioning/ensure-service-principals.ts; docs/proposals/service-principals.md §8.1.
08 Suspend and resume service principals with enforce access at request boundariesinteractionapinegativeproposed
Proves
BR-CAP-PFM-SEC-015-13 BR-CAP-PFM-SEC-018-04
Preconditions
An active registered service principal can call its declared operation.
Steps
Suspend it, wait for registry refresh, call again, resume it, and repeat after refresh.
Expected
The suspended caller is refused; the resumed eligible caller succeeds without deployment.
Data
An isolated customer with two workspaces, ordinary and staff identities, and records owned by this run.
Source
services-platform:modules/security/tests/unit/authorizer/service-function-rules.spec.ts#refuses a route whose catalog permission is sensitive behind a function that is not, naming the key,services-platform:modules/security/tests/integration/services/service-principals/registered-principals.integration.spec.js#is refused 403
09 Suspend and resume service principals with administer rhythm staff membershipsinteractionapiproposed
Proves
BR-CAP-PFM-SEC-016-01 BR-CAP-PFM-SEC-018-01
Preconditions
A customer administrator, a staff reader and a Rhythm Administrator are available.
Steps
Read the principal register and attempt suspension with each identity.
Expected
Only authorized staff can read it and only the management key permits suspension.
Data
An isolated customer with two workspaces, ordinary and staff identities, and records owned by this run.
Source
services-platform:modules/security/tests/e2e/hq-staff-and-roles.e2e.spec.js#refuses an administrator of a customer, holding every key at that customer, as 403,services-platform:modules/security/tests/integration/services/service-principals/hq-service-principals-routes.integration.spec.js#refuses a customer's administrator 403, holding every key of their own customer

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.