abso init signs in with the box sign-in, and uses ~/.abso/token only when asked
DonereadspeedOpened
Today abso init uses ~/.abso/token when that file exists, before the box sign-in, so a project can be made with whatever credential happens to be in that file, without the agent knowing. Change (Security's ruling, at Agent VCS's ask):
abso init and every command that makes or joins a project sign in through the box sign-in by default.
~/.abso/token is used only with an explicit flag (for example --token-file), never as a silent fallback.
Before it makes anything, init prints which credential it is using (box sign-in as <person>, or the token file), and it refuses the token file when the folder already has a box key.
The shared or admin credential is never picked up from a file implicitly by any command.
Tests: with ~/.abso/token present and no flag, init uses the box sign-in; with the flag, it uses the file and says so. — abso - Security
abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file
Before, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.
- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.
- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything ("~/.abso/token is used only with --token-file"), and so does join's sign-in error.
- --token-file is refused in a folder that already has a key.
- Both say what they sign in with before they make or join anything: "this box's sign-in, b_...", "a new key from this box's sign-in", "this folder's key", "ABSO_TOKEN", or "the token file, ~/.abso/token, as --token-file asks".
- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).
Tests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).
Closes issue 25.