4.1. Publish partial metadata without confusing it with effective metadata
Feature guides / 4. Metadata · Example context
Umeå University OP knows its issuer identifier before eduGAIN supplies a federation registration value. Its publication can be partial while the eventual effective OP metadata must be complete.
How to use it
Use a publication parser for a draft. Use the effective parser only after superior metadata and policy have been applied. The parsers return success/data or success: false/error, rather than Result.ok. Superior completion; Metadata.
import { OidcProviderRole } from "@oidfed/oidc";
export function validateUmeaOpDraft(input: unknown) {
const parsed = OidcProviderRole.parsePublicationMetadata(input);
if (!parsed.success) return { accepted: false as const, issues: parsed.error.issues };
return { accepted: true as const, metadata: parsed.data };
}
What your application owns
A successful draft parse does not authenticate its author or guarantee that a chain can complete it. The host composition hook validates attached roles before publication. Preserve unknown extension fields where the relevant schema permits them. Core rejects a null metadata map, null entity-type blocks, and null direct metadata parameters. Nested values follow their protocol's rules.
Save a draft and preview its effect
A dashboard for Umeå University OP can run publication parsing as the operator edits metadata and show errors beside the affected fields. Missing fields may legitimately come from a Superior, so the editor should distinguish a valid partial publication from a complete effective OP configuration.
After saving the draft through the host's configuration mechanism, resolve the entity as a consumer and inspect the effective metadata. That preview reveals Superior overrides and policy effects the local editor cannot infer alone. Keep the submitted draft for editing, and use the validated resolved result for protocol decisions; the two objects have different purposes.
Host and role constructors capture metadata, including nested values. Changing the original object afterward does not update publication. Construct a replacement host for general metadata changes; dedicated Trust Mark and subordinate APIs still update their own resources. Roles contribute initialized metadata in order, overriding matching host parameters.
Next: 4.2. Validate protocol metadata for forms and consumers