Skip to content

Token names don't include owner identity – collision when multiple users use the same project #34

Description

@AndreHeller

Problem

When kbagent generates per-project tokens via a manage token, it names them as:

kbagent-cli (Iterable)

If two users (or two machines) configure the same project, both tokens get the same name. In the Keboola UI token list you can see which project the token belongs to, but you have no way to tell who created it or which machine is using it.

Impact

  • Impossible to audit which token belongs to which person/machine
  • Risky to revoke a token — you don't know if it's yours or a colleague's
  • In teams with multiple people using kbagent, the token list becomes unmanageable

Expected behavior

Token name should include a user or machine identifier, e.g.:

kbagent-cli (Iterable) [john.doe]
kbagent-cli (Iterable) [hostname]
kbagent-cli (Iterable) [john.doe@hostname]

Suggested fix

When creating the token, append the local username and/or hostname to the token name:

import os, socket
name = f"kbagent-cli ({project_name}) [{os.getlogin()}@{socket.gethostname()}]"

This way each token is uniquely identifiable by owner, project, and machine — safe to audit and revoke individually.

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