Skip to content

Problem: API for /api/user/tokens changed #3200

@helioloureiro

Description

@helioloureiro

Issue

Before, on 2.14, I was using /api/user/tokens to fetch a non-expired token and reuse it. So I upgraded to 2.15 and now it is failing.

The token is coming back trimmed.

❯ curl -X GET 'https://semaphore/api/user/tokens' -H "Authorization: Bearer ****" | jq .
[
  {
    "id": "vlv3dyfk",
    "created": "2025-08-12T13:23:26Z",
    "expired": false,
    "user_id": 8
  },
  {
    "id": "u1p7nzog",
    "created": "2025-08-12T13:19:09Z",
    "expired": false,
    "user_id": 8
  }
]

If I request a new token, it is created properly:

❯ curl -X 'POST' \
              'https://semaphore/api/user/tokens' \
              -H 'accept: application/json' \
              -d '' \
              -b 'semaphore=****; Path=/; HttpOnly' -s
{"id":"d1qvj3v3wynblapxz6fpvoryhli9bztwfn8_ha1rd4w=","created":"2025-08-12T13:37:26Z","expired":false,"user_id":8}

But on requesting it for usage:

❯ curl -X GET 'https://semaphore.xensam.eu/api/user/tokens/' -H "Authorization: Bearer d1qvj3v3wynblapxz6fpvoryhli9bztwfn8_ha1rd4w=" -s | jq .
[
  {
    "id": "d1qvj3v3",
    "created": "2025-08-12T13:37:26Z",
    "expired": false,
    "user_id": 8
  },
  {
    "id": "vlv3dyfk",
    "created": "2025-08-12T13:23:26Z",
    "expired": false,
    "user_id": 8
  }
]

result is trimmed.

Impact

Web-Backend (APIs)

Installation method

Binary

Database

BoltDB

Browser

No response

Semaphore Version

2.15.0-1e13324-1749881537

Ansible Version

Logs & errors

No response

Manual installation - system information

No response

Configuration

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions