Skip to content

[IMP] developer/api/external_api: document programmatic API key management#18000

Open
madprog wants to merge 1 commit into
19.0from
19.0-apikey_renewal-pmo
Open

[IMP] developer/api/external_api: document programmatic API key management#18000
madprog wants to merge 1 commit into
19.0from
19.0-apikey_renewal-pmo

Conversation

@madprog
Copy link
Copy Markdown
Contributor

@madprog madprog commented May 19, 2026

Document the RPC methods introduced by odoo/odoo#246118 to generate and revoke API keys programmatically, and add recommendations about API key rotation best practices.

@robodoo
Copy link
Copy Markdown
Collaborator

robodoo commented May 19, 2026

Pull request status dashboard

@C3POdoo C3POdoo requested a review from a team May 19, 2026 12:57
Copy link
Copy Markdown
Collaborator

@AntoineVDV AntoineVDV left a comment

Choose a reason for hiding this comment

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

LGTM! Just a few comments on the structure.

@robodoo delegate+

Comment thread content/developer/reference/external_api.rst Outdated
Comment thread content/developer/reference/external_api.rst Outdated
Comment thread content/developer/reference/external_api.rst Outdated
Comment on lines +199 to +202
- ``key``: an existing valid API key
- ``scope``: the scope assigned to the new key
- ``name``: a human-readable label
- ``expiration_date``: the expiration date of the key
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

add the json datatype of each value, for expiration_data is likely is a ISO8601 encoded string.

Suggested change
- ``key``: an existing valid API key
- ``scope``: the scope assigned to the new key
- ``name``: a human-readable label
- ``expiration_date``: the expiration date of the key
- ``key`` (string): an existing valid API key
- ``scope`` (string or null): the scope assigned to the new key
- ``name`` (string): a human-readable label
- ``expiration_date`` (string): the expiration date of the key, encoded as a ISO8601datetime

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

alternatively give a (relative) link to the /doc page, anchored on that method. Users will have to change the relative URL to add their domain name, but at least the info is precise.

Talking of which, please improve the docstring of the public methods of res.users.apikeys. At least please document every single parameter via :param.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The relative link: /doc/res.users.apikeys#generate

Test it: http://localhost:8069/doc/res.users.apikeys#generate

Comment thread content/developer/reference/external_api.rst Outdated
Comment on lines +208 to +209
The expiration date is validated against the maximum API key duration allowed
by the roles assigned to the user.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add recommendations about what lifetime we recommend for what usage. Bonus point if those recommendations are based on existing NIST (US)/ENISA (EU) ones.

Comment thread content/developer/reference/external_api.rst Outdated
Comment thread content/developer/reference/external_api.rst Outdated
Comment thread content/developer/reference/external_api.rst Outdated
Comment thread content/developer/reference/external_api.rst Outdated
Comment thread content/developer/reference/external_api.rst Outdated
@madprog madprog force-pushed the 19.0-apikey_renewal-pmo branch from a13cca0 to 4506f11 Compare May 20, 2026 08:57
…ement

Document the RPC methods introduced by odoo/odoo#246118 to generate
and revoke API keys programmatically, and add recommendations about
API key rotation best practices.
@madprog madprog force-pushed the 19.0-apikey_renewal-pmo branch from 4506f11 to 48aad54 Compare May 20, 2026 14:29
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.

4 participants