Conversation
What was broken The earlier PM-4211 runtime fix handled M2M project-member writes, but the exact Auth0 client-credentials token shape from QA was still not covered by automated regression. That left the POST, PATCH, and DELETE member flows vulnerable to future regressions without a failing test. Root cause (if identifiable) The existing route e2e coverage mocked a simplified machine user, and JwtService coverage did not assert the non-numeric @Clients subject plus project-member write scope combination from the QA token. What was changed Added JwtService coverage for an Auth0 client-credentials subject carrying project-member write scope. Added guarded project-member POST, PATCH, and DELETE regression coverage for an Auth0-shaped M2M principal whose raw token payload is broader than user.scopes. Any added/updated tests Updated src/shared/modules/global/jwt.service.spec.ts. Updated test/project-member.e2e-spec.ts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
The earlier PM-4211 runtime fix handled M2M project-member writes, but the exact Auth0 client-credentials token shape from QA was still not covered by automated regression. That left POST /v6/projects/{projectId}/members, PATCH /v6/projects/{projectId}/members/{id}, and DELETE /v6/projects/{projectId}/members/{id} vulnerable to future regressions without a failing test.
Root cause (if identifiable)
The existing route e2e coverage mocked a simplified machine user, and JwtService coverage did not assert the non-numeric @Clients subject plus project-member write scope combination from the QA token.
What was changed
Added JwtService coverage for an Auth0 client-credentials subject carrying project-member write scope.
Added guarded project-member POST, PATCH, and DELETE regression coverage for an Auth0-shaped M2M principal whose raw token payload is broader than user.scopes.
Any added/updated tests
Updated src/shared/modules/global/jwt.service.spec.ts.
Updated test/project-member.e2e-spec.ts.
Validation run: pnpm test -- src/shared/modules/global/jwt.service.spec.ts; pnpm test:e2e -- --runInBand test/project-member.e2e-spec.ts; pnpm test -- src/shared/services/permission.service.spec.ts; pnpm test -- src/api/project-member/project-member.service.spec.ts; pnpm lint; pnpm build.
pnpm test still fails in unrelated metadata event-publishing specs on the current dev baseline.