fix: add missing authorization check to fingerprint endpoint

Merged
RI
4mo ago
+55-0

Proposed changes (including videos or screenshots)

The POST /api/v1/fingerprint endpoint was protected by authRequired: true but had no permissionsRequired check. The endpoint is still actively used as part of the deployment fingerprint change flow.

Fix: add permissionsRequired: ['manage-cloud'] to the endpoint options, matching the authorization pattern used by every other cloud management endpoint in cloud.ts. The manage-cloud permission is assigned to the admin role by default, so the legitimate flow is unaffected.

The 403 response code is also added to the endpoint's response schema, which was missing.

Issue(s)

CORE-2238, VLN-398

Steps to test or reproduce

Before the fix:

  1. Call POST /api/v1/fingerprint as a user without the manage-cloud permission -> returns 200

After the fix:

  1. Call POST /api/v1/fingerprint as a user without the manage-cloud permission -> expect 403 Forbidden
  2. Call POST /api/v1/fingerprint as a user with the manage-cloud permission -> expect 200
  3. Trigger the fingerprint change modal as an admin (change Site_Url setting) -> confirm the modal still works end-to-end

Further comments

The manage-cloud permission was chosen because it is already used by all other cloud management endpoints (cloud.syncWorkspace, cloud.createRegistrationIntent, cloud.getRegistrationStatus, etc.) and is semantically correct for an action that modifies workspace cloud identity.