# Store the impersonator id on access tokens created via ZED_IMPERSONATE · gitcafe/zed

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

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

Visibility: public

Requested revision: ab1bea515c41a7e35d8ffdcca3175bca186a62b3

Requested commit: ab1bea515c41a7e35d8ffdcca3175bca186a62b3

Commit: ab1bea515c41a7e35d8ffdcca3175bca186a62b3

Tree: 6d04d64c92ff684119edc61d572b8af65a56317e

Author: Max Brunsfeld

Committer: Max Brunsfeld

## Message

```
Store the impersonator id on access tokens created via ZED_IMPERSONATE

* 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.

Co-authored-by: Marshall <marshall@zed.dev>

```

## Parents

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

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