netlify / git-gateway

A Gateway to Git APIs
MIT License
404 stars 89 forks source link

better handling 2-hour expiry on gitlab tokens #68

Closed fool closed 2 years ago

fool commented 2 years ago

- Do you want to request a feature or report a bug*?**

bug

- What is the current behavior?

When using git gateway with gitlab.com, the Gitlab auth tokens the user creates through our UI seem to expire quickly, which breaks git gateway for all users on the site. We believe this is due to this change: https://docs.gitlab.com/ee/update/deprecations#oauth-tokens-without-expiration (announced for monday, but maybe has happened earlier, cf https://github.com/netlify/pillar-workflow/issues/501 - internal issue for Netlify staff only)

- If the current behavior is a bug, please provide the steps to reproduce.

  1. create a site using the CMS and configure it to use git gateway.
  2. link a site at any plan level
  3. with a repo at gitlab
  4. in identity settings
  5. confirm you can use identity/commit via CMS
  6. wait 2 hours
  7. confirm you can no longer use identit/commit via CMS
  8. see humio showing sudden 401 HTTP responses (example from a customer case:

- What is the expected behavior?

token would work indefinitely, or we'd have a workflow that renews it appropriately.

- Please mention your Go version, and operating system version.

This is production/whatever is running at Netlify

fool commented 2 years ago

customers reporting (internal links for Netlify staff):

Enterprise customers:

Pro Customers:

rybit commented 2 years ago

Best explained here: https://answers.netlify.com/t/how-to-mitigate-changes-to-gitlab-version-15-0-support-for-oauth-tokens/56613