Credential pooling with Docker and Helm
Under some circumstances it can be desirable to create a "pool" of credentials, for example, to work around rate-limiting issues. You can do this by creating an environment variable ending in _POOL
, separating each credential with a comma. The Broker Client will then, when doing variable replacement, look to see if the variable in use has a variant with a _POOL
suffix, and if so, use the next item in that pool. For example, if you have set the environment variable GITHUB_TOKEN
, but want to provide multiple tokens, you would do this instead:
You can add this as env var + value in the Helm Chart.
Then the Broker Client would, any time it needed GITHUB_TOKEN
, instead take an item from the GITHUB_TOKEN_POOL
.
Credentials are taken in a round-robin fashion, so the first, the second, the third, and so on, until the Broker Client reaches the end and then takes the first credential again.
Calling the /systemcheck
endpoint will validate all credentials, in order, and will return an array where the first item is the first credential, and so on. For example, if you were running the GitHub Client and have this:
The /systemcheck
endpoint would return the following, where the first object is for good_token
and the second for bad_token
:
The credentials are masked. However, note that if your credentials contain six (6) or fewer characters, they will be completely replaced with the mask.
Limitations of credential pooling
Credential validity is not checked before using a credential, nor are invalid credentials removed from the pool, so it is strongly recommended that credentials be used exclusively by the Broker Client to avoid credentials reaching rate limits at different times, and that the /systemcheck
endpoint be called before use.
Some providers, such as GitHub, do rate-limiting on a per-user basis, not a per-token or per-credential basis, and in those cases you will need to create multiple accounts with one credential per account.
Credentials matrix
Generating a Matrix of credentials is not supported.
A "Matrix" in this case is defined as taking two (or more) _POOL
s of length x
and y
, and producing one final pool of length x * y
. For example, given an input like:
Matrix support would generate this internally:
Instead, the Broker Client would generate this internally, using only the first pool it finds:
Last updated