12.1. Browse registrations with Extended Listing
Feature guides / 12. Extended Subordinate Listing · Example context
eduGAIN's operator wants to page through registrations changed since a particular date, while Research Portal needs more than a flat identifier list.
How to use it
For the operator's own authority, use listSubordinatesExtended(). Configure extendedListing, advertise federation_extended_list_endpoint, and serve it through handleRequest() for remote clients. Local calls are administrative operations and do not perform HTTP client authentication. Keep the response's next unchanged as the following from value. Extended Listing Draft 03.
import type { TrustAnchor, Intermediate } from "@oidfed/authority";
export function campusRegistrationPage(campus: TrustAnchor | Intermediate, from?: string) {
return campus.listSubordinatesExtended({
limit: 50, auditTimestamps: true,
...(from === undefined ? {} : { from }),
});
}
Query a remote authority
Core supplies the remote HTTP client; there is no reason to construct a local authority for another entity's endpoint:
import type { CryptoEngine } from "@oidfed/crypto";
import { fetchExtendedSubordinatesList } from "@oidfed/core";
export function remoteCampusRegistrationPage(engine: CryptoEngine, from?: string) {
return fetchExtendedSubordinatesList("https://edugain.example/extended-list", {
limit: 50, auditTimestamps: true,
...(from === undefined ? {} : { from }),
}, { engine });
}
Both local and remote operations return a Result. Keep filters and selectors stable while following a cursor. Selected Subordinate Statements still need chain validation before use.
Browse your own registration fields
eduGAIN can store additionalClaims: { campus: "north" } with a subordinate registration and return it with claims: ["campus"]. The same claim remains in the signed subordinate_statement; the listing is a convenient view of that data, not new evidence of trust.
Configure extendedListing.requestFilters.campus on the authority to interpret a campus selector. Its parse(values, context) callback returns a Result once per request, and matches(record, parsedValue, context) selects records before page limits are applied. Both may be asynchronous; honor context.signal. The authority guide includes a complete configuration example.
import type { CryptoEngine } from "@oidfed/crypto";
import { fetchExtendedSubordinatesList } from "@oidfed/core";
export async function listNorthCampus(engine: CryptoEngine) {
const page = await fetchExtendedSubordinatesList("https://edugain.example/extended-list", {
claims: ["campus"], limit: 25,
}, {
engine,
additionalParameters: { campus: "north" },
});
if (!page.ok) throw new Error(page.error.description);
return page;
}
Keep filters unchanged while following next. A page may be empty when the server reaches its scan limit before finding a match; a next value means there is still a position to continue scanning. Without a configured campus filter the server ignores that selector, so agree on supported filters with the federation operator.
What your application owns
Keep storage ordering and cursor behavior consistent. Do not interpret the cursor as an Entity Identifier or increment it locally. Repeated Trust Mark type filters have OR semantics here, unlike Entity Collection's AND requirement. Additional claim selection is subject to the endpoint's configuration. Disabled endpoints must not remain advertised as available.
An authority can decline explicit audit_timestamps=true requests while still returning timestamps with supported time filters, as the specification recommends. supportAuditTimestamps controls the former; supportTimeFilters controls the latter. A caller can use audit_timestamps=false to suppress timestamps with a time-filtered request. The client accepts shared authentication options when access requires an authenticated POST.
Keep one query across its pages
When eduGAIN exposes a large enrollment set, a client chooses filters and selected claims before following the returned pagination links. Keep those choices consistent for the traversal and treat the server's cursor as opaque.
Operational timestamps help identify changes, but they do not replace signed trust-chain validation. If a query is rejected because a capability is unsupported, adjust it using the published deployment contract rather than silently pretending the requested filter ran. Custom claims and filters need an agreed definition on both sides; their names alone do not make them standardized metadata.
Select stored extension claims
A subordinate's additionalClaims can be requested directly, without downloading its signed statement. For example, after registering a subordinate with additionalClaims: { campus: "north" }, request claims: ["campus"]. The field also remains inside subordinate_statement when that statement is requested.
Only selected fields are projected. Missing claims are omitted, and claims: [] still gives identifier-only entries. Standard listing fields keep their meanings: an extension named id, registered, updated, or subordinate_statement cannot replace the listing's own field. Such extensions remain available in the signed statement where permitted. All projected values count toward the response byte limit. This uses the extension allowance in Extended Listing §3.2–3.3; it does not introduce another metadata store.
Filter by your federation's own fields
eduGAIN can let callers ask for registrations from a particular campus. Configure the filter on TrustAnchor or Intermediate through extendedListing.requestFilters:
import type { ExtendedListingConfig } from "@oidfed/authority";
import { err, federationError, FederationErrorCode, fetchExtendedSubordinatesList, ok } from "@oidfed/core";
const extendedListing: ExtendedListingConfig = {
requestFilters: {
campus: {
parse(values) {
if (!values.length || values.some(value => !["north", "south"].includes(value))) {
return err(federationError(FederationErrorCode.InvalidRequest, "Unknown campus"));
}
return ok([...values]);
},
matches(record, campuses) {
return Array.isArray(campuses) && campuses.includes(record.additionalClaims?.campus);
},
},
},
};
// Pass extendedListing alongside the authority's other construction options.
The library parses each present registered parameter once, even when there are no registrations. The parser returns a Result; an error becomes HTTP 400 invalid_request. The parsed value must be JSON data, or undefined for a flag. A predicate returns a boolean. Both callbacks may be asynchronous and receive a second/third context argument containing an AbortSignal.
Filters see frozen copies of records and parsed values. Honor the signal when doing asynchronous work. One options.httpTimeoutMs deadline covers the whole custom-filter operation; cancellation releases the caller even when a callback does not settle. Exceptions, rejected promises, and malformed callback results produce generic server_error responses.
Different custom filters are combined with AND, alongside the standard filters. Each parser decides how repeated values of its own parameter work; the example treats campuses as alternatives. This is an oidfed extension convention, not a new specification rule. Unknown, unregistered parameters remain ignored. Filter names cannot replace standard protocol selectors or registered authentication credentials.
For an HTTP client, use the existing additionalParameters option:
import type { CryptoEngine } from "@oidfed/crypto";
import { fetchExtendedSubordinatesList } from "@oidfed/core";
export async function listCustomServices(engine: CryptoEngine, endpoint: string) {
const page = await fetchExtendedSubordinatesList(endpoint, {
entityType: "custom_academic_service",
claims: ["campus"],
limit: 25,
}, {
engine,
additionalParameters: { campus: ["north", "south"] },
});
if (!page.ok) throw new Error(page.error.description);
}
For a local call, use the optional second argument:
import { type TrustAnchor } from "@oidfed/authority";
export async function listCampusRecords(authority: TrustAnchor, signal: AbortSignal) {
const page = await authority.listSubordinatesExtended(
{ claims: ["campus"], limit: 25 },
{ additionalParameters: { campus: "north" }, signal },
);
if (!page.ok) throw new Error(page.error.description);
}
Keep the same filters when following next. Custom predicates run before counting matches toward the page limit, but scanning remains bounded by maxStorePagesPerRequest. A sparse page can be empty and still have next; continue until next is absent. Storage adapters need no new methods, and still apply the standard filters. For large datasets, account for the cost of examining records that custom predicates exclude.
An unknown from value returns page_not_found. A failed storage lookup instead returns server_error, including through the local Result API; a database outage is not evidence that a cursor is unknown.
Extended Listing bounds the UTF-8 JSON success response, including its continuation cursor, through extendedListing.maxResponseBytes (default: 512 KiB). This complements the count and scan limits and follows Draft 03 §3.1.2. A full byte budget produces a shorter page with next pointing to the first omitted entity. An entry that cannot fit alone returns server_error; reduce the requested claims or increase the server and client byte budgets. The endpoint preserves the requested claims and stops building further entries when the page is full.
Build extension selectors and bound host work
fetchExtendedSubordinatesList accepts extension Entity Type identifiers and sends custom selectors through options.additionalParameters. The authority API uses the same ExtendedListRequestParams type and serializer. buildExtendedListRequestParameters(endpoint, params) returns standard selectors as a Result<URLSearchParams>; prepareEndpointParameters(selectors, additional, fixed) copies selectors and adds extensions, throwing on reserved names or conflicts. These are the shared utilities used by the existing endpoint client and local authority calls; applications normally use the higher-level APIs.
freezeSnapshot(value) freezes an already detached data graph in place; it does not clone it. setOwn(object, name, value) defines an own data property without invoking prototype setters. They are shared infrastructure for protocol packages. endpointCredentialParameterNames(authentication) identifies assertion and plugin credential parameters, while isReservedEndpointParameter(name) identifies protocol selectors and standard credential names. These helpers keep extension handling consistent across packages.
waitForOperation(pending, signals) releases a caller when a supplied signal aborts without imposing a timeout or cancelling an independently owned operation. It observes the pending promise even after cancellation. Extended Listing uses it for storage waits, alongside runAsyncOperation for the custom-filter deadline.
Server filters, claims, and pagination limits
The endpoint implements Draft 03. Advertise federation_extended_list_endpoint in metadata.federation_entity to mount it, and leave extendedListing.enabled enabled. Enabling the handler alone does not add the metadata or route.
Read next from each response and pass it unchanged as from to resume from that entry, inclusive. Treat it as an opaque string; its encoding is chosen by the server. Unknown cursors return HTTP 404 with the JSON error page_not_found.
Continue while next is present, including after an empty response page. The handler scans through empty storage pages until it fills the response, exhausts storage, or reaches maxStorePagesPerRequest. At that work limit it returns the continuation, as required when more results remain by Extended Listing §3.3. Repeated or backward storage cursors return server_error.
import type { TrustAnchor } from "@oidfed/authority";
export async function readTwoPages(ta: TrustAnchor) {
const first = await ta.listSubordinatesExtended({ limit: 50, claims: [] });
if (!first.ok || first.value.next === undefined) return first;
return ta.listSubordinatesExtended({ from: first.value.next, limit: 50, claims: [] });
}
The same parameters are supported by fetchExtendedSubordinatesList in @oidfed/core. trustMarkType accepts a string or an array of strings. An entity matches if the authority has issued a still-valid mark of any requested type. On the wire, send one trust_mark_type parameter per type. Custom storage adapters must apply the same OR semantics to ListFilter.trustMarkType; adapters that filter scanned batches follow the storage continuation rules.
Repeated entity_type values filter with union semantics: an entity matches when it has any of the requested types. This is the matching behavior implemented by the standard authority storage adapter and required of custom adapters. Entity Type Identifier values are open-ended (Federation §5.1 permits additional identifiers and no registry exists): both listing endpoints accept any non-empty identifier and return an empty result when no subordinate carries it, rather than rejecting unknown values. Custom storage adapters must apply the same union, open-value semantics to ListFilter.entityTypes.
Both listing endpoints treat trust_marked=true as requiring a valid issued mark. They treat false as adding no mark restriction; any supplied trust_mark_type filter still applies. The base specification defines the true case and leaves the false case unspecified. Custom storage adapters should follow the same policy for ListFilter.trustMarked. For intermediate, true selects intermediates, false selects non-intermediates, and omission selects both. These false-value meanings are oidfed policies; Federation §8.2.1 specifies the true cases.
Extended Listing time filters and audit timestamps use NumericDate seconds. Fractional and negative values are accepted, and updated_after and updated_before include records exactly at the boundary. Query values also accept decimal exponent notation. Values must be finite numbers.
Omitting claims uses defaultClaims. An explicit claims: [] sends claims= and suppresses the default statements. If a claim selection is present, subordinate_statement is returned only when requested; other requested statement claims are included when available.
claims=trust_marks returns references with trust_mark_type and the original trust_mark JWT, following Federation §3.1.2. An undecodable JWT, wrong Trust Mark typ, or inconsistent reference type or subject produces server_error. These references appear in the listing JSON; the embedded signed Subordinate Statement retains Federation's claim restrictions. Subjects with no currently valid marks have an empty trust_marks array. The same empty array is returned when no Trust Mark store is configured. Trust Mark filters still require that store and otherwise return unsupported_parameter.
Requested jwks values pass the same public-key publication checks as signed Subordinate Statements. This follows Draft 03 §3.2 and Federation §3.1.1. If a stored set contains private material or fails validation, the whole request returns HTTP 500 with a generic JSON server_error; listSubordinatesExtended() returns an error Result. This handling of invalid server data uses Federation §8.9. Validation preserves stored records and publishes a detached snapshot of valid keys, including their JSON extension members.
Leaf entities cannot advertise this endpoint.
The extendedListing object supports:
enabled(boolean): Whether the advertised endpoint accepts requests. Defaults totrue.maxPageSize(number): Upper limit on page sizes. Defaults to500.maxResponseBytes(number): UTF-8 JSON success-response limit, includingnext. Defaults to524288(512 KiB).defaultPageSize(number): Default page size if the client omitslimit. Defaults to the smaller of100andmaxPageSize.supportTimeFilters(boolean): Whether to honorupdated_afterandupdated_beforequeries. Defaults totrue.supportAuditTimestamps(boolean): Whether to honoraudit_timestampsquery. Defaults totrue.defaultClaims(ReadonlyArray<string>): Claims fetched when the client sends noclaimsquery. Defaults to["subordinate_statement"].maxStorePagesPerRequest(number): Maximum index page lookups allowed per request to protect performance. Defaults to16.storeBatchSize(number): Page batch sizes retrieved during filtering. Defaults todefaultPageSize.
All five numeric limits must be positive safe integers. An explicit defaultPageSize must not exceed maxPageSize. Invalid configuration fails when the handler is created.
For raw HTTP requests, claims accepts repeated parameters (claims=a&claims=b), comma-separated names (claims=a,b), or mixed encoding (claims=a,b&claims=c). Names are trimmed and empty tokens are dropped; an explicit empty claims value requests identifier-only entries. The typed client accepts a claims array and handles its encoding.
Extended Listing accepts repeated entity_type filters. The CLI mirrors this with repeated --entity-type options. Use --claims "" for identifier-only entries. supportAuditTimestamps controls explicit timestamp requests; time filters can also include timestamps unless the caller sends audit_timestamps=false. Disable both timestamp requests and time filters when neither facility should disclose dates.