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

Method propertyMatchesDomain

server/src/validator.ts:474–498  ·  view source on GitHub ↗
(property: PropertyDefinition, normalizedDomain: string)

Source from the content-addressed store, hash-verified

472 }
473
474 private propertyMatchesDomain(property: PropertyDefinition, normalizedDomain: string): boolean {
475 if (property.publisher_domain && this.normalizeDomain(property.publisher_domain) === normalizedDomain) {
476 return true;
477 }
478
479 return (property.identifiers || []).some((identifier) => {
480 if (identifier.type !== "domain") {
481 return false;
482 }
483
484 const identifierValue = this.normalizeDomain(identifier.value);
485 if (identifierValue.startsWith("*.")) {
486 const baseDomain = identifierValue.slice(2);
487 return normalizedDomain.endsWith(`.${baseDomain}`) && normalizedDomain !== baseDomain;
488 }
489
490 if (identifierValue === normalizedDomain) {
491 return true;
492 }
493
494 return !identifierValue.includes(".") ?
495 false :
496 this.matchesBaseDomain(identifierValue, normalizedDomain);
497 });
498 }
499
500 private matchesBaseDomain(identifierValue: string, normalizedDomain: string): boolean {
501 if (identifierValue === normalizedDomain) {

Callers 1

propertyMatchesScopeMethod · 0.95

Calls 2

normalizeDomainMethod · 0.95
matchesBaseDomainMethod · 0.95

Tested by

no test coverage detected