@oidfed/leaf
v0.3.0
Published
Leaf Entity toolkit — Entity Configuration serving, authority discovery, and trust chain participation for any entity at the edge of an OpenID Federation.
Maintainers
Readme
@oidfed/leaf
Leaf Entity toolkit — Entity Configuration serving, authority discovery, and trust chain participation for any entity at the edge of an OpenID Federation.
Status:
v0.2.0pre-release — API may change before the first stable1.0release.
Install
npm install @oidfed/core @oidfed/leafQuick Start
import { createLeafEntity } from "@oidfed/leaf";
import { entityId } from "@oidfed/core";
const leaf = createLeafEntity({
entityId: entityId("https://rp.example.com"),
authorityHints: [entityId("https://federation.example.org")],
signingKeys: [mySigningKey],
metadata: {
openid_relying_party: {
redirect_uris: ["https://rp.example.com/callback"],
response_types: ["code"],
client_registration_types: ["automatic"],
},
},
});
const handler = leaf.handler(); // fetch-compatible (Request → Response)What's Included
- Entity Configuration serving at
/.well-known/openid-federation - Authority discovery with branded
DiscoveryResulttype - Automatic key stripping (private fields removed from published JWKS)
- Lazy EC generation with caching and refresh
Documentation
Full API reference: docs/packages/leaf.md
Part of @oidfed
| Package | Role | |---------|------| | @oidfed/core | Federation primitives | | @oidfed/authority | Trust Anchor & Intermediate operations | | @oidfed/leaf | Leaf Entity toolkit (this package) | | @oidfed/oidc | OIDC/OAuth 2.0 federation flows | | @oidfed/cli | CLI for federation debugging |
License
Apache-2.0 — see NOTICE for attribution.
