Cannot use keyring tokens with glab v1.84.0 and later
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "bug" label: - https://gitlab.com/gitlab-org/cli/-/issues/?label_name%5B%5D=type%3A%3Abug and verify the issue you're about to submit isn't a duplicate. ---> ### Checklist <!--Please test the latest versions, that will remove the possibility that you see a bug that is fixed in a newer version.--> - [x] I'm using the latest version of the extension (Run `glab --version`) - Extension version: _1.85.2_ - [x] Operating system and version: _arch_ - [x] Gitlab.com or self-managed instance? _both_ - [x] GitLab version (if self-managed) _latest; 18.9.0-pre_ - [x] I have performed `glab auth status` to check for authentication issues - [x] Run the command in debug mode (like `DEBUG=true glab mr list`) and attach any useful output ### Summary <!--Summarize the bug encountered concisely--> Cannot use glab with token in keyring after v1.84.0. ### Environment <!--on POSIX system (Linux, MacOS), run bash -c 'printf -- "- OS: %s\n- SHELL: %s\n- TERM: %s\n- GLAB: %s" "$(uname -srm)" "$SHELL" "$TERM" "$(glab --version)"' and replace the following section with the result. If you use non-POSIX system, fill in the section manually: - OS: Your operating system including version and architecture (Windows 11 - AMD64, MacOS Sonoma - ARM64) - SHELL: Your shell (bash, fish, zsh, ...) - TERM: Your terminal emulator (Kitty, Xterm2..) - GLAB: result of running `glab --version` (glab version 1.32.0 (2023-08-18))--> - OS: arch - SHELL: bash - TERM: screen-256color - GLAB: glab 1.85.2 () <!--Please include any other information that you believe might be relevant in debugging. For example, you may include a shell framework like oh-my-zsh or other customizations like editing the prompt (PS1, PS2, and others).--> Other: ### Steps to reproduce <!--How one can reproduce the issue - this is very important--> Example with glab 1.83.0 working setup: ```bash $ glab --version glab 1.83.0 () $ DEBUG=1 GLAB_DEBUG_HTTP=1 glab issue list [git remote -v] [git config --get-regexp ^remote\..*\.glab-resolved$] REQUEST: GET /api/v4/projects/example%2Fdebug?license=true&with_custom_attributes=true HTTP/1.1 Host: gitlab.com User-Agent: glab/v1.83.0 (linux, amd64) Accept: application/json Private-Token: [REDACTED] Accept-Encoding: gzip RESPONSE: HTTP/2.0 200 OK Cache-Control: max-age=0, private, must-revalidate Cf-Cache-Status: MISS Cf-Ray: 9cf372453849543e-TLL Content-Security-Policy: default-src 'none' Content-Type: application/json Date: Tue, 17 Feb 2026 07:07:12 GMT ... ``` glab config with `token` configured in keyring: ```yaml # What protocol to use when performing git operations. Supported values: ssh, https git_protocol: ssh # What editor glab should run when creating issues, merge requests, etc. This is a global config that cannot be overridden by hostname. editor: nvim # What browser glab should run when opening links. This is a global config that cannot be overridden by hostname. browser: firefox # Set your desired markdown renderer style. Available options are [dark, light, notty] or set a custom style. Refer to https://github.com/charmbracelet/glamour#styles glamour_style: dark # Allow glab to automatically check for updates and notify you when there are new updates check_update: false # Disable telemetry telemetry: "false" # configuration specific for gitlab instances hosts: gitlab.com: user: <redacted> api_host: gitlab.com api_protocol: https git_protocol: ssh ``` ### What is the current _bug_ behavior? <!--What actually happens--> ```bash $ glab --version glab 1.84.0 () $ DEBUG=1 GLAB_DEBUG_HTTP=1 glab issue list [git remote -v] [git config --get-regexp ^remote\..*\.glab-resolved$] REQUEST: GET /api/v4/projects/example%2Fdebug/issues?in=title%2Cdescription&order_by=created_at&page=1&per_page=30&sort=desc&state=opened HTTP/1.1 Host: gitlab.com User-Agent: glab/v1.84.0 (linux, amd64) Accept: application/json Job-Token: [REDACTED] Accept-Encoding: gzip RESPONSE: HTTP/2.0 401 Unauthorized Content-Length: 30 Cache-Control: no-cache ... Content-Type: application/json Date: Tue, 17 Feb 2026 07:11:55 GMT Gitlab-Lb: haproxy-main-41-lb-gprd Gitlab-Sv: api-gke-us-east1-c Nel: {"max_age": 0} Ratelimit-Limit: 500 Ratelimit-Name: throttle_unauthenticated_api Ratelimit-Observed: 1 Ratelimit-Remaining: 499 Ratelimit-Reset: 1771312320 Referrer-Policy: strict-origin-when-cross-origin Server: cloudflare ... Vary: Origin, Accept-Encoding X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-Gitlab-Meta: {"correlation_id":"9cf379300788542a-ATL","version":"1"} X-Request-Id: 9cf379300788542a-ATL X-Runtime: 0.069240 {"message":"401 Unauthorized"} ERROR Get https://gitlab.com/api/v4/projects/example%2Fdebug/issues: 401 {message: 401 Unauthorized}. ``` Same error occurs if I use the following config and same token value in keyring as before upgrade to 1.84.0: ```yaml gitlab.com: user: <redacted> # token: # use keyring instead: glab auth login --hostname gitlab.com --use-keyring api_host: gitlab.com api_protocol: https git_protocol: ssh use_keyring: "true" ``` Or even: ```yaml gitlab.com: user: <redacted> token: glpat-************ api_host: gitlab.com api_protocol: https git_protocol: ssh use_keyring: "true" ``` ### What is the expected _correct_ behavior? <!--What you should see instead--> glab command requests should be authenticated. ### Relevant logs and/or screenshots <!--- Paste the activity log from your command line--> ### Possible fixes <!--If you can, link to the line of code that might be responsible for the problem-->
issue