Via #21745 (closed) we added default expiration of OAuth tokens for new OAuth Applications, and an option to enable it for existing applications. In %15.0 we can remove the backward compatibility and force all tokens to expire within 2 hours.
NOTE: We will also need a database migration to set an expiration for existing tokens. Otherwise, they will never expire unless revoked (even refreshing a previously non-expiring token will result in a new token without expiration).
@dblessing I'm checking on your label question and will get back to you...
I read this in the deprecations portion of the handbook:
A deprecation is an announcement in the release post notifying the community of a future removal. Deprecations should be included as soon as possible in the documentation or for at least 2 releases prior to the final removal.
If we are going to deprecate this in 15.0, I suppose I should make a task for myself to write this pending deprecation up in the release posts for 14.4 onwards? @ogolowinski can you see if I'm on the right track?
@hsutor yes! You should create an issue for deprecation, similar to #337384 (closed) for the next milestone and create a release deprecation note for it following the new process. This will automatically add this to the deprecation docs until %15.0 where we will need to make a removal notice.
It is important to add to the release post, what action the user needs to do in order to rectify the situation before it breaks in %15.0.
NOTE: We will also need a database migration to set an expiration for existing tokens. Otherwise, they will never expire unless revoked (even refreshing a previously non-expiring token will result in a new token without expiration).
Can this occur before the support for non-expiring tokens is dropped? We're attempting to migrate prior to the removal date, and we'd prefer to not have to revoke all existing tokens.
The background migration is completed. I checked the database, the migration set expires_in for all oauth_access_tokens. However, since the migration is completed, approximately 40% of tokens is created with expires_in set to nil.
We thought this change (!86379 (merged)) was scheduled as part of the May 22nd release. Our team has a change that was scheduled to go out later today around using refresh tokens, but all of our access tokens are now expired.
How can we proceed here without requiring all of our customers to reauthenticate?
@ifarkas Beyond some instances not being updated/restarted, the only other thing I can think of is some sort of race condition during the migration where maybe some existing tokens were refreshed before the expires_in value was migrated, which would have generated a new token also without expires_in, which may not have been included in the migration loop?
Do we see this number holding steady or are we still getting new tokens without expiry? That might give us some indication if we just need another migration pass or we have a bug somewhere.
Again, we thought the token expiry changes were part of the GitLab 15.0 release on May 22.
@ddorosz, GitLab.com is already on 15.0 (15.0.0-pre c566a6ecfc8 to be precise). There might have been misunderstanding / miscommunication regarding breaking changes, but May 22 is the release date for self-managed packages.
Unfortunately, I don't think there's a way to rollback right now. For many breaking changes like this one, we offer the ability to opt-in and begin using the new functionality ahead of the breaking change to make the migration easier. We're reviewing the way we communicated the breaking changes on .com to ensure we make it more clear in the future.
On Netlify the Git Gateway access token feature seems to be broken as well, needing to manually refresh the access tokens for all clients each two hours. Is there a way to change this setting within Gitlab? Thank you for your help
@vvo No, refresh tokens should remain valid as part of the migration. Unless the access token was specifically revoked subsequently.
@dylandavies Netlify Git Gateway needs to store the refresh token and request a new access token after the access token expires. The expires_in value when initially getting an access token indicates how long it's valid for. The refresh token can be used anytime during or after that period of time to refresh the token.
@hsutor, I am still verifying if the background migration has been successfully completed. I am currently looking into an issue described in #340848 (comment 949500475). I still need to dig a bit deeper, but I might create a follow-up.