Skip to content

Improve Conan package registry authentication method

Description

At the moment, the usage of the Conan package registry in a development environment where package version changes are frequent is a bit of a pain because of the authentication expires way too frequently.

While I saw the reasoning behind the current value for the JWT token expiration in here !60763 (merged), 1 day is still way too short and since it forces our developers to regenerate a PAT basically every day, or store it somewhere (which is unsafe), to reauthenticate to the registry.

I would like to either:

Is this something we could investigate on? 🙂

I would love to have a better look and help out but I am missing the background on both the GitLab integration and Conan "hosting" 😅

Proposed solution

Deploy token

By default a deploy token never expires docs, but it's possible to set expiration time during the token creation. Having a JWT that never expires might be a security aspect, but to set the expiration time of JWT when there's one for a deploy token might be a good option.

CI job token

CI job token is valid only during the job execution: docs. The current 1 hour expiration time of JWT seems good enough, of course until we have long running tasks. But perhaps, we could deal with it in the follow up.

Thus, we skip them for now.

Personal access token

We could set the expiration time of Conan JWT token from personal access token when we create it here. We'll need to change the ConanToken to accept the optional argument token when we initialize it.

Edited by Dzmitry (Dima) Meshcharakou