Sync
Sync your local variables with the authority.
Modes
Process
- The agent compiles the envdata into a JSON object with the following structure:
- The agent stringifies the object and splits it into chunks of 255 characters.
- The agent encrypts each chunk with the authority's public key.
- The agent joins the encrypted chunks into a single string with a delimiter of
::
, postfixed with a\n\r\n
sequence followed by the user's public key. - The agent contacts
POST:/api/projects/:project_id/sync?strategy=<?SyncStrategy>
, authenticated with thebearer
key, and with the encrypted chunks as the body. - The authority responds with a body in the same format, containing updated values. At the end of the body, a
\n\r\n
sequence followed by newline-terminated strings containsmessages
which may be shown to the user. - The agent decrypts the chunks with the user's private key and joins them into a single string.
- The agent parses the string into a JSON object.
- The agent writes the new envdata.