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

Method resolveAuthorizedProperties

server/src/validator.ts:284–322  ·  view source on GitHub ↗
(
    agent: AuthorizedAgentEntry,
    normalizedDomain: string,
    scope: NormalizedScope,
    properties: PropertyDefinition[]
  )

Source from the content-addressed store, hash-verified

282 }
283
284 private resolveAuthorizedProperties(
285 agent: AuthorizedAgentEntry,
286 normalizedDomain: string,
287 scope: NormalizedScope,
288 properties: PropertyDefinition[]
289 ): PropertyDefinition[] {
290 switch (agent.authorization_type) {
291 case "property_ids":
292 if (!agent.property_ids?.length) {
293 return [];
294 }
295 return this.resolveScopedTopLevelProperties(normalizedDomain, scope, properties).filter((property) =>
296 !!property.property_id && agent.property_ids?.includes(property.property_id)
297 );
298 case "property_tags":
299 if (!agent.property_tags?.length) {
300 return [];
301 }
302 return this.resolveScopedTopLevelProperties(normalizedDomain, scope, properties).filter((property) =>
303 this.hasIntersection(agent.property_tags || [], property.tags || [])
304 );
305 case "inline_properties":
306 if (!agent.properties?.length) {
307 return [];
308 }
309 return this.resolveScopedProperties(normalizedDomain, scope, agent.properties);
310 case "publisher_properties":
311 return this.resolveAuthorizedPublisherProperties(
312 agent.publisher_properties,
313 normalizedDomain,
314 scope,
315 properties
316 );
317 case undefined:
318 return this.resolveScopedTopLevelProperties(normalizedDomain, scope, properties);
319 default:
320 return [];
321 }
322 }
323
324 private resolveAuthorizedPublisherProperties(
325 selectors: PublisherPropertySelector[] | undefined,

Callers 1

matchesAuthorizationMethod · 0.95

Tested by

no test coverage detected