Skip to content

[18.0][ADD] auth_api_key_expire: expiration date for API keys with a warning - #1089

Draft
simahawk wants to merge 2 commits into
OCA:18.0from
camptocamp:18-add-auth_api_key_expire
Draft

simahawk wants to merge 2 commits into
OCA:18.0from
camptocamp:18-add-auth_api_key_expire

Conversation

@simahawk

@simahawk simahawk commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Depends on:

Add an optional expiration date to the API keys of auth_api_key: a key is refused after it. It is checked at each authentication, outside the key cache, as a key expires without any change on the record. This allows rotating a key: create the new one, switch the callers, then expire the old one.

A daily scheduled action creates a To Do activity on each key about to expire, for each user of a configurable group (system administrators by default), a configurable number of days before (15 by default). The users of the group need read access to the keys, the others are skipped and a warning is logged. Marking the To Do as done does not create it again; changing the expiration date does, when the new date comes close.

Add an optional expiration date to the API keys of auth_api_key: a key is
refused after it. It is checked at each authentication, outside the key
cache, as a key expires without any change on the record. This allows
rotating a key: create the new one, switch the callers, then expire the
old one.

A daily scheduled action creates one To Do activity per user of a
configurable group (system administrators by default), listing all the
keys about to expire, a configurable number of days before (15 by
default, 0 disables the warnings). Users without read access to the keys
are skipped and logged.
@OCA-git-bot OCA-git-bot added series:18.0 mod:auth_api_key_expire Module auth_api_key_expire labels Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:auth_api_key_expire Module auth_api_key_expire series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants