Skip to content

Fix API key permissions#35

Merged
BryceStevenWilley merged 2 commits into
v1.9.8.postfrom
fix-api-key-permissions
May 29, 2026
Merged

Fix API key permissions#35
BryceStevenWilley merged 2 commits into
v1.9.8.postfrom
fix-api-key-permissions

Conversation

@rajeswari1301
Copy link
Copy Markdown

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

@rajeswari1301 rajeswari1301 self-assigned this May 28, 2026
Copy link
Copy Markdown

@BryceStevenWilley BryceStevenWilley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, but testing it doesn't actually fix the error: should hook into the /manage_api endpoint, I'm not sure if do_api_user_api() is called from there or not.

Comment thread docassemble_webapp/docassemble/webapp/server.py Outdated
Comment thread docassemble_webapp/docassemble/webapp/server.py Outdated
@BryceStevenWilley
Copy link
Copy Markdown

Perfect, that fix did seem to work!

@BryceStevenWilley BryceStevenWilley merged commit c6ca724 into v1.9.8.post May 29, 2026
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.

Docassemble API Keys don't set permissions on initial creation

2 participants