uselagoon / lagoon

Lagoon, the developer-focused application delivery platform
https://docs.lagoon.sh/
Apache License 2.0
552 stars 149 forks source link

Change: check expiration of legacy tokens, reject if necessary #3645

Closed shreddedbacon closed 5 months ago

shreddedbacon commented 5 months ago

General Checklist

Database Migrations

As we look to phase out the usage of legacy tokens, we need to be able to reject long lived or non-expiring legacy tokens initially. This introduces two new environment variables that can be set in the API.

If a legacy token has the exp field, the remaining duration of the token is calculated against the iss timestamp. If this duration is greater than the LEGACY_EXPIRY_MAX, then depending on the LEGACY_EXPIRY_REJECT setting, it will log, or log and reject the request.

If there is no exp field on the token, then depending on the LEGACY_EXPIRY_REJECT setting, it will log, or log and reject the request.