OpsDev.nz Utilities¶
Reference material generated from the op_opsdevnz package. These helpers
power the OctoDNS Metaname provider integration and other internal automation.
1Password helper¶
1Password helpers for OpsDev.nz.
Provides a thin wrapper around the official Service Account SDK with an optional
fallback to the op CLI so local developers can resolve op:// references
without additional tooling.
SecretError
¶
Bases: RuntimeError
Raised when secret resolution fails.
Source code in opsdevnz/onepassword.py
21 22 | |
get_secret(*, secret_ref_env=None, secret_ref=None, env_override=None, prefer_cli=False, timeout=10.0)
¶
Resolve a 1Password secret.
Resolution order
- Return
env_overridewhen set (local overrides, CI tests). - Resolve the provided
secret_refor the value fromsecret_ref_env(must point to anop://reference). - Use the Service Account SDK by default, falling back to the CLI when
prefer_cliis true or the SDK path fails and the CLI is available.
Source code in opsdevnz/onepassword.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
1Password SDK utilities¶
Async helpers for resolving 1Password secrets via the official SDK.
get_secret_from_ref_env(ref_env, *, env_override=None)
¶
Synchronously resolve a secret reference stored in an env var.
Source code in opsdevnz/onepassword_sdk.py
33 34 35 36 37 38 39 40 41 42 43 | |
OctoDNS hooks¶
Integration helpers between OctoDNS Metaname provider and opsdevnz secrets.
resolve(name, reference=None)
¶
Resolve secrets via 1Password using the opsdevnz helper.
Parameters¶
name:
Logical name of the secret (e.g., METANAME_API_TOKEN).
reference:
Optional reference retrieved from <NAME>_REF. When present this is
passed directly to 1Password; otherwise we rely on opsdevnz_get_secret
to look up any matching reference env variable.
Source code in opsdevnz/octodns_hooks.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |