MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / matchesCollections

Method matchesCollections

server/src/validator.ts:265–282  ·  view source on GitHub ↗
(
    selectors: CollectionSelector[] | undefined,
    normalizedDomain: string,
    collectionIds: string[] | undefined
  )

Source from the content-addressed store, hash-verified

263 }
264
265 private matchesCollections(
266 selectors: CollectionSelector[] | undefined,
267 normalizedDomain: string,
268 collectionIds: string[] | undefined
269 ): boolean {
270 if (!selectors?.length) {
271 return true;
272 }
273
274 if (!collectionIds?.length) {
275 return false;
276 }
277
278 return selectors.some((selector) =>
279 this.normalizeDomain(selector.publisher_domain) === normalizedDomain &&
280 this.hasIntersection(selector.collection_ids, collectionIds)
281 );
282 }
283
284 private resolveAuthorizedProperties(
285 agent: AuthorizedAgentEntry,

Callers 1

matchesAuthorizationMethod · 0.95

Calls 2

normalizeDomainMethod · 0.95
hasIntersectionMethod · 0.95

Tested by

no test coverage detected