Skip to main content

Module mint

Module mint 

Source
Expand description

Getting credentials on the host for a grant (spec §7). srv never runs a shell: a recipe is an argument vector, a placeholder is substituted whole into one argument, and the program’s output is parsed and dropped.

Structs§

HostRunner
Runs the recipe as a child of srv with a clean environment.
MintCtx
Minted
Credentials as credential_process prints them. The secret and the token are zeroed when dropped.
RunOutput
RunSpec

Enums§

MintError
Why a mint failed, in the words the person is told (spec §10).
RunError

Constants§

RECIPE_TIMEOUT
How long a recipe may take: a cached login is instant, a fresh one is a round trip or two, and a slow one on a busy machine has been seen to take 20 to 26 seconds, so the limit is well past that (a recipe that is stopped part way leaves nothing behind, and the next ask starts it over). It stays under the container’s own wait (ASK_TIMEOUT in crates/bashwrap/src/aws.rs), so the container is always answered, with the credentials or with the reason they were not.

Traits§

Runner
How a recipe’s program is found and run: the real one below, a fake in the tests.

Functions§

clean_reason
Cleaned for a session tag: letters, digits, spaces and _.:/=+-@, one line, at most [REASON_MAX] characters.
mint
Run the grant’s recipe and parse what it prints.
parse_process_json
The credentials in a recipe’s stdout: the last non-empty line, which must be the JSON object (a tool may print a banner first). Long-lived keys, with no session token or no expiry, are refused: nothing that does not expire is ever handed to a container.
recipe_argv
The recipe’s program and arguments, with the placeholders filled in.