wild276
wild276

Reputation: 43

CKAN API key rotation

I'm wondering if there are any CKAN extensions that manage API key rotation? We ideally want to rotate API keys for all users every 30 days. I can't seem to find anything in the extensions or community support pages on Stackoverflow or GitHub. How are other organisations managing this?

Upvotes: 1

Views: 107

Answers (1)

TkTech
TkTech

Reputation: 4976

welcome to stackoverflow.

There are none that I'm aware of that handle automatic API key rotation for users. However, writing such an extension is trivial. You can use CKAN's background workers to periodically create a new key:

result = get_action('user_generate_apikey')(context, {'id': '<id of the user>'})

I'd also suggest notifying them that their key has been changed, since randomly changing keys would drive me insane.

Upvotes: 1

Related Questions