Skip to content

Fix: [ENG-836] project_permissions JSON field name in API key creation (ENG-836)#1078

Closed
liranfarage89 wants to merge 2 commits into
mainfrom
eng-836-project-permissions-fix
Closed

Fix: [ENG-836] project_permissions JSON field name in API key creation (ENG-836)#1078
liranfarage89 wants to merge 2 commits into
mainfrom
eng-836-project-permissions-fix

Conversation

@liranfarage89

Copy link
Copy Markdown
Contributor

Problem

Users reported that API keys created with blocks were not receiving the correct project access, resulting in 403 errors. This affected multiple customers including Adaptavist and Allstate.

Root Cause

The struct in was using an incorrect JSON field name:

  • Expected: (singular)
  • Was: (plural)

This mismatch prevented project permissions from being properly assigned during API key creation.

Solution

  • Change JSON tag from to in the struct
  • Add comprehensive tests to verify correct JSON serialization behavior
  • Ensure both empty and non-empty project permissions are handled correctly

Changes

  • File: - Fixed JSON field name in struct tag
  • File: - Added tests for JSON serialization verification

Testing

  • All existing tests continue to pass (429/429 specs)
  • New tests verify correct JSON field name usage
  • Tests cover both empty and populated project permissions scenarios

Impact

This fix ensures that API keys with configurations receive the proper project assignments, resolving the 403 authorization errors reported by users.

Fixes: ENG-836

- Change JSON tag from 'projectsPermissions' to 'projectPermissions' in ApiKeyPermissions struct
- Add comprehensive tests to verify correct JSON serialization
- Fixes 403 errors when API keys have project_permissions configured
- Resolves issue ENG-836 reported by Adaptavist and Allstate users

The incorrect JSON field name prevented project permissions from being
properly assigned to API keys, causing authorization failures.
@liranfarage89 liranfarage89 changed the title Fix project_permissions JSON field name in API key creation (ENG-836) Fix: [ENG-836] project_permissions JSON field name in API key creation (ENG-836) Dec 25, 2025
- Revert JSON tag from 'projectPermissions' back to 'projectsPermissions' in ApiKeyPermissions struct
- Update tests to verify 'projectsPermissions' field name
- This reverts commit 8997832

The original field name 'projectsPermissions' was correct per API specification.
@liranfarage89

Copy link
Copy Markdown
Contributor Author

nvm it's irrelevant... resolved by @eranelbaz already #1077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant