Skip to content

Fix API key permissions not applied on initial creation#960

Open
rajeswari1301 wants to merge 1 commit into
jhpyle:masterfrom
SuffolkLITLab:fix-api-key-perms
Open

Fix API key permissions not applied on initial creation#960
rajeswari1301 wants to merge 1 commit into
jhpyle:masterfrom
SuffolkLITLab:fix-api-key-perms

Conversation

@rajeswari1301
Copy link
Copy Markdown

Fixes a bug where permissions selected during API key creation were silently dropped -add_api_key had no permissions parameter, the POST handler never read permissions from the request, and manage_api was saving them under the wrong key (limits instead of permissions).

This fix adds permissions support to add_api_key, adds the same permissions validation to the POST handler that already existed in the PATCH handler, and corrects the key name in manage_api so permissions set at creation time are now correctly saved.

When creating a new API key, Docassemble lets you select permissions
during creation but they were dropped silently - add_api_key function
had no permissions parameter and the POST handler never read them from
the request.

This fix adds permissions support to add_api_key and adds the same
permissions validation to the POST handler that already existed in the
PATCH handler, so permissions set at creation time are now saved
correctly. This is a prerequisite for contributing #24 upstream.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant