Don't require an expiration date for new access tokens

Problem to solve

We want to allow tokens that don’t expire, as access to our GitLab server is restricted enough, and expiry seem to cause confusion and is mostly escalated to us = the group that maintains the installation.

So I looked at

and thought that would be a good idea to change.

Put when queried (with a GET request to http://localhost/api/v4/application/settings) the API doesn’t return that setting, and while it doesn’t complain when trying to change that setting (but it also doesn’t complain when I set ruler_of_the_world, so that doesn’t say much) it doesn’t return it afterwards either.

There is a setting (and it’s documented!) called require_personal_access_token_expiry that seems to control that. Is that what I can/should change?

Describe your question in as much detail as possible:

  • What are you seeing, and how does that differ from what you expect to see?
  • Consider including screenshots, error messages, and/or other helpful visuals

Steps to reproduce

Which troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

Configuration

Provide screenshots from the GitLab UI showing relevant configuration, if applicable.
On self-managed instances, add the relevant configuration settings or changes.

Versions

Please add an x whether options apply, and add the version information.

  • Self-managed
  • GitLab.com SaaS
  • Dedicated

Versions

  • GitLab (Web: /help or self-managed system information sudo gitlab-rake gitlab:env:info):

Helpful resources

  1. Check the FAQ for helpful documentation, issues/bugs/feature proposals, and troubleshooting tips.
  2. Before opening a new topic, make sure to search for keywords in the forum search
  3. Check the GitLab project for existing issues. If you encounter a bug, please create a bug report issue.
  4. Review existing troubleshooting docs.

Thanks for taking the time to be thorough in your request, it really helps! :blush:

Under Admin → General → Account and limit → Personal / project / group access token expiration and it can be toggled on/off

brave_screenshot_repo.neogage.com

I don’t know of an API option, but maybe that would be enough?

No, that would not be enough. It must be possible to automate it, and things that require clicking typically can’t, that’s why I’m looking at the API for this - and generally keeping an eye on it (can be seen e.g. from my updating of Docs feedback: Describe new parameters (#3078) · Epics · Epics · GitLab.org · GitLab - some of my comments there are older than the epic. because they are from before the issue I opened was turned into an epic).