Summary
I’m not sure if this is a bug or a feature … I’m running version 10.1.1
The documentation for mmctl token list says, it would list a user’s tokens. This is somewhat incorrect or unspecific.
Steps to reproduce
mmctl --local token list sample_user
gives the following output:
root@exchange64:/opt/mattermost/bin# ./mmctl --local token list sample_user
gozteg4zjbd5pdnnsswqy5w35o: token-description
There are 1 tokens on local instance
Hereby, gozteg4zjbd5pdnnsswqy5w35o
is the (database record) ID of the token - not the token itself.
MariaDB [mattermost]> select * from UserAccessTokens;
+----------------------------+----------------------------+----------------------------+--------------+----------+
| Id | Token | UserId | Description | IsActive |
+----------------------------+----------------------------+----------------------------+--------------+----------+
| gozteg4zjbd5pdnnsswqy5w35o | *** redacted *** | 77q5wnuxubgr3job63354sp5jw | set-password | 1 |
+----------------------------+----------------------------+----------------------------+--------------+----------+
1 row in set (0.000 sec)
Expected behavior
the token used to access the mattermost server should be displayed.
The SQL equivalent would be
select Token from UserAccessTokens where ...
Observed behavior
The database record ID from the database is displayed, not the token itself. This is equivalent to
select Id from UserAccessTokens where ...