Skip to main content

Salmon

@dataverket/salmonv2026.10.27.1· AGPL-3.0-only(was none)· 1d agoBEHAVIORSACCEPTED WARNINGS
01README

A throwaway Salmon for end-to-end tests of anything that takes Salmon's tokens: database validators, message brokers, services. @dataverket/salmon/stack runs the published Salmon image with a Postgres and an OpenLDAP seeded with Salmon's reference directory, as one docker compose project generated in code, and waits until Salmon's discovery document answers. @dataverket/salmon/fixture writes the team, apps, trust and grants a test needs into that Salmon, with ids stable across runs, and revokes a grant to test refusals. @dataverket/salmon/token-exchange mints a Kubernetes ServiceAccount token, exchanges it at Salmon (RFC 8693) for a token for one app, and records the token's subject and roles, never the token.

02Behaviors3
@dataverket/salmon/stackv2026.10.26.1stack.ts

Global Arguments

ArgumentTypeDescription
project?stringdocker compose project name; one stack per name
image?stringSalmon image; pin a sha-<short> tag for reproducible runs
issuerUrl?stringSalmon's issuer URL as its clients will reach it
port?numberHost port Salmon is published on
networks?arrayExisting docker networks Salmon also joins, e.g. kind, so it can fetch a cluster's ServiceAccount keys
startTimeoutSeconds?number
fn ensure()
Start Salmon, Postgres and the seeded LDAP, or leave them running, and wait for discovery
fn stop()
Remove the stack's containers, network and volumes

Resources

stack(infinite)— The stack's project, image and issuer URLs
@dataverket/salmon/fixturev2026.10.26.1fixture.ts

Global Arguments

ArgumentTypeDescription
project?stringThe stack's docker compose project
name?stringFixture name; ids are derived from it
teamobject
appsarray
trustobject
grantsarray
fn seed(timeoutSeconds?: number)
Replace the fixture's team, apps, trust and grants in the stack's database
ArgumentTypeDescription
timeoutSeconds?numberHow long to wait for Salmon to have migrated its schema
fn revoke(app: string)
Delete the trust's grants at one app
ArgumentTypeDescription
appstringKey of the app whose grants to delete

Resources

fixture(infinite)— Ids of the seeded team, apps, trust and grants
@dataverket/salmon/token-exchangev2026.10.26.1token_exchange.ts

Global Arguments

ArgumentTypeDescription
issuerUrl?stringSalmon issuer URL; the token endpoint is read from its discovery document
kubeContextstringkubeconfig context of the cluster that mints the subject token
namespace?string
serviceAccount?string
trustIdstringSalmon trust id, sent as client_id
requestAudience?stringApp id sent as the RFC 8693 audience; its roles are recorded
audience?stringAudience of the minted ServiceAccount token (defaults to issuerUrl with a trailing slash)
scope?string
tokenDuration?string
kubectlBinary?string
fn test()
Exchange a ServiceAccount token for a Salmon access token and fail unless one is issued

Resources

result(infinite)— Outcome of the last successful token exchange
03Previous Versions2
2026.10.26.2
2026.10.26.1
04Stats
A
100 / 100
Downloads
3
Archive size
30.1 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

06Platforms
07Labels