Service tokens are being deprecated in favor of machine identities.They will be removed in the future in accordance with the deprecation notice and timeline stated here.
Anatomy
A service token in Infisical consists of the token itself, astring
, and a corresponding document in the storage backend containing its
properties and metadata.
Database model
The storage backend model for a token contains the following information:- ID: The token identifier.
- Expiration: The date at which point the token is invalid.
- Project: The project that the token is part of.
- Scopes: The project environments and paths that the token has access to.
- Encrypted project key: An encrypted copy of the project key.
Token
A service token itself consist of two parts used for authentication and decryption, separated by the delimiter.
.
Consider the token st.abc.def.ghi
. Here, st.abc.def
can be used to authenticate with the API, by including it in the Authorization
header under Bearer st.abc.def
, and retrieve (encrypted) secrets as well as a project key back. Meanwhile, ghi
, a hex-string, can be used to decrypt the project key used to decrypt the secrets.
Note that when using service tokens via select client methods like SDK or CLI, cryptographic operations are abstracted for you that is the token is parsed and encryption/decryption operations are handled. If using service tokens with the REST API and end-to-end encryption enabled, then you will have to handle the encryption/decryption operations yourself.