hegemony-secret-1password
1Password secret backend plugin for Hegemony, packaged as an out-of-tree wheel.
It is discovered at runtime via the hegemony.secret_backends entry-point group
(onepassword = "hegemony_secret_1password:register") and contributes two
backend types:
| Backend type | Notes |
|---|---|
onepassword_connect |
Authenticates against a self-hosted 1Password Connect server |
onepassword_service_account |
Authenticates with a 1Password Service Account token |
Both types resolve a {{ secret('scheme://vault/item/field') }} reference's
path as "<vault>/<item>" (vault title/id and item title/id, split on the
first /) and return a mapping of item field name to field value. Per the
SecretBackend contract, read returns None — rather than raising — when
the vault or item cannot be found; a malformed path (not exactly two
non-empty parts) still raises ValueError, since that is an input error
rather than a missing secret.
Multi-tenant (organization) path layout
Hegemony namespaces per-organization secrets as orgs/<slug>/secrets/<folder>
and enforces that confinement host-side, before any backend call. Under the
split-on-first-/ rule above such a path maps to the 1Password vault named
orgs with the item title "<slug>/secrets/<folder>": reads and writes work
and stay distinct per organization (the slug is part of the item title), but
every organization's items land in that single orgs vault, and list does
not browse below one path segment, so backend folder discovery is unavailable
for org namespaces.
A plain <vault>/<item> path is outside orgs/. Hegemony gives such paths to
the default organization only, so every other organization has to use the
orgs/<slug>/… form above. Registering one 1Password backend per organization
does not keep organizations apart: every backend is available to every
organization, and only the path decides who may read a secret. For
multi-tenant deployments prefer the Vault backend, which maps the org
namespace onto a real path hierarchy.
Secret backends are leaf components: unlike notification transports, the host
injects no services or context into a backend. The registered factory receives
only an already-resolved configuration dict and returns a backend instance whose
read/write/delete/list/test methods talk directly to 1Password. Writes
upsert an item at "<vault>/<item>": a new item is created as a Secure Note whose
concealed custom fields are the written keys, and an existing item has its fields
replaced. To prevent Hegemony from modifying a 1Password vault, mark the configured
backend as read-only in its Hegemony backend settings.
The Service Account backend wraps the official onepassword-sdk, which is
asynchronous; it authenticates and runs all subsequent SDK calls on a dedicated
background event-loop thread so its synchronous methods remain safe to call even
from inside a host event loop.
This package depends only on hegemony-secret-sdk,
onepasswordconnectsdk (the
official Connect client, used by onepassword_connect), and
onepassword-sdk (the official
Service Account SDK, used by onepassword_service_account); it never imports
Hegemony platform internals. Both third-party SDKs are pulled in as direct
dependencies of this wheel — no separate install step is needed for either
backend type.
Install
The wheel is opt-in — it is not bundled in the default images. See the root
Install From A Release guide for Docker
commands, checksum and attestation verification, and local-wheel development
installs. Both the API (to list/validate the backend type and resolve secrets) and the
worker (to resolve secrets at run time) need the wheel installed into
/opt/venv; restart both after installing so each registry reloads its entry
points.
The package is on PyPI from 0.3.6 on:
uv pip install hegemony-secret-1password==X.Y.Z or pip install hegemony-secret-1password==X.Y.Z.
Earlier releases are only on this repository's GitHub
Releases. For local development, work from a checkout of this repository,
where the package is a workspace member:
uv sync --all-packages
Configure
Create a secret backend using whichever type matches your 1Password
deployment. The form is schema-driven, so each field below is rendered
automatically and auth-material fields (connect_token,
service_account_token) get a secret/variable picker.
onepassword_connect
Requires a running 1Password Connect server and an issued Connect API token (a Connect access token, not an account password).
| Field | Required | Default | Notes |
|---|---|---|---|
connect_host |
yes | — | 1Password Connect server address, e.g. https://connect.example.com |
connect_token |
yes | — | Connect API token |
{
"connect_host": "https://connect.example.com",
"connect_token": "{{ env('OP_CONNECT_TOKEN') }}"
}
onepassword_service_account
Requires a 1Password Service Account
token (ops_...) with access to the vaults it should read from. No separate
host to run — the SDK talks to 1Password's cloud API directly.
| Field | Required | Default | Notes |
|---|---|---|---|
service_account_token |
yes | — | 1Password Service Account token, e.g. ops_... |
integration_name |
no | Hegemony |
Integration name reported to 1Password |
{
"service_account_token": "{{ env('OP_SERVICE_ACCOUNT_TOKEN') }}"
}
Auth tokens may also come from a bootstrap secret backend instead of the
environment: any backend whose own config uses env()/file() exclusively
(e.g. the platform's internal Vault) can be referenced with
{{ secret('vault://orgs/default/secrets/op/token') }}.
Usage
Once a backend of either type is registered under a name (the scheme, e.g.
onepassword), reference an item field from any Hegemony template field with:
{{ secret('onepassword://Engineering/Database/password') }}
The portion after scheme:// splits on the last /: everything before it is
the path passed to read(path) — here Engineering/Database, split on the
first / into vault (Engineering) and item (Database) title-or-id — and
the final segment is the key looked up by field name in the item (here
password). Both backend types also implement write — it upserts the item at
path (creating a Secure Note, or replacing an existing Secure Note's fields),
as described above; mark the backend read-only in its Hegemony settings to keep
a 1Password vault from being modified.
Metadata
Release files for hegemony-secret-1password 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hegemony_secret_1password-0.3.7.tar.gz | 24.9 kB | With provenance | Details for hegemony_secret_1password-0.3.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hegemony_secret_1password-0.3.7-py3-none-any.whl | Python 3 | none | any | Details for hegemony_secret_1password-0.3.7-py3-none-any.whl |
Total release size: 51.8 kB
Release files / hegemony_secret_1password-0.3.7.tar.gz
| Download URL | hegemony_secret_1password-0.3.7.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c447767bbdc672169238f3ec8cedaf3be3e64e438a1da174a9682e78ef56e22
|
|
BLAKE2b-256 checksum How to use checksums |
9ac9f3aac453519e37ec3770d58ee37768fa7edfc3bc22d54f1bfc88d71c5975
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / hegemony_secret_1password-0.3.7-py3-none-any.whl
| Download URL | hegemony_secret_1password-0.3.7-py3-none-any.whl |
|---|---|
| Size | 26.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2f8041c1da96faf8e026e84e7be8ab9f0fcc489ab6c4e4d19f6cae64cc01984
|
|
BLAKE2b-256 checksum How to use checksums |
56833c439e0b81332781ba9a2ec4c9b1b1f0a7af54e9d04adc37717ba598e77c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for hegemony-secret-1password 0.3.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hegemony_secret_1password-0.3.7.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.