Skip to content

Ensure user is logged in to Vault - #2105

Merged
rolandwalker merged 1 commit into
mainfrom
RW/ensure-vault-login
Aug 7, 2026
Merged

Ensure user is logged in to Vault#2105
rolandwalker merged 1 commit into
mainfrom
RW/ensure-vault-login

Conversation

@rolandwalker

@rolandwalker rolandwalker commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Ensure user is logged in to Vault before trying to read credentials from Vault, and raise with a specific error message if not.

This could probably be refined for more cases, such as the lack of a connection.

We assume that all exit codes represent an error, though Vault has a habit of encoding information into different exit codes.

The test command is

vault taken lookup -format=json

though any JSON output is currently not parsed.

We use functools to ensure that the check is only performed once, though vault kv could be run twice: once for the username and once for the password.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

before trying to read credentials from Vault, and raise with a specific
error message if not.

This could probably be refined for more cases, such as the lack of a
connection.

We assume that all exit codes represent an error, though Vault has a
habit of encoding information into different exit codes.

The test command is

    vault taken lookup -format=json

though any JSON output is currently not parsed.

We use functools to ensure that the check is only performed once, though
"vault kv" could be run twice: once for the username and once for the
password.
@rolandwalker rolandwalker self-assigned this Aug 7, 2026
@rolandwalker
rolandwalker merged commit bf1b9d0 into main Aug 7, 2026
19 of 20 checks passed
@rolandwalker
rolandwalker deleted the RW/ensure-vault-login branch August 7, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant