# Store the impersonator id on access tokens created via ZED_IMPERSONATE \(\#4108\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f2f3a935b996344a5d2255ea8ae4ad0843e7ad2d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f2f3a935b996344a5d2255ea8ae4ad0843e7ad2d

Requested commit: f2f3a935b996344a5d2255ea8ae4ad0843e7ad2d

Commit: f2f3a935b996344a5d2255ea8ae4ad0843e7ad2d

Tree: e208d101a57448e31c1334542248efa12570110c

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Store the impersonator id on access tokens created via ZED_IMPERSONATE (#4108)

* Use the impersonator id to prevent these tokens from counting against
the impersonated user when limiting the users' total of access tokens.
* When connecting using an access token with an impersonator add the
impersonator as a field to the tracing span that wraps the task for that
connection.
* Disallow impersonating users via the admin API token in production,
because when using the admin API token, we aren't able to identify the
impersonator.
```

## Parents

- [bfe76316f7043c1ebd37c0946b772758b1c4556c](https://git.cafe/gitcafe/zed/commit/bfe76316f7043c1ebd37c0946b772758b1c4556c?format=markdown)

- [93d068a7467cc12ad68d4ab1ca5c0bfd9397aa33](https://git.cafe/gitcafe/zed/commit/93d068a7467cc12ad68d4ab1ca5c0bfd9397aa33?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f2f3a935b996344a5d2255ea8ae4ad0843e7ad2d?format=markdown)
