Repository navigation
Add product-based agent authorization validation - #356
Merged
Merged
Conversation
Implement validation endpoints that accept the Product schema's publisher_properties format, allowing clients to validate agent authorization against product inventory selectors (all/by_id/by_tag). Includes endpoint to expand selectors to concrete identifiers for real-time caching. Changes: - Database layer: validateAgentForProduct() validates against product selectors with per-selector breakdown - Database layer: expandPublisherPropertiesToIdentifiers() expands selectors to flat identifier list for caching - Service layer: expose validation methods with clear use cases - HTTP endpoints: POST /api/registry/validate/product-authorization and /api/registry/expand/product-identifiers - Agent list response: return property_summary (counts, not full list) for sales agents only - Migration: new discovered_properties and agent_property_authorizations tables 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Fix N+1 query in tag validation: Replace per-tag queries with single query using unnest() to find covered tags - Add AgentType type guard: New isValidAgentType() function for safe runtime validation of agent_type values - Change default agent type: Use 'unknown' instead of 'sales' for discovered agents with missing/invalid type - Fix NULL handling in UNIQUE constraint: Use partial unique index for property_id to properly handle NULLs - Improve agent lookup in registry.html: Replace fragile url.includes() fallback with structured matching strategies - Use type guard consistently in http.ts for FederatedAgent conversion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement validation endpoints that accept Product schema's
publisher_propertiesformat, allowing clients to validate agent authorization against product inventory selectors. Added database layer for querying and expanding selectors to concrete identifiers for real-time caching.Changes
validateAgentForProduct()validates against product selectors with per-selector breakdown showing coverage percentage and unauthorized itemsexpandPublisherPropertiesToIdentifiers()expands selectors (all/by_id/by_tag) to flat identifier list for real-time cachingPOST /api/registry/validate/product-authorizationandPOST /api/registry/expand/product-identifiersproperty_summary(counts, not full list) for sales agents to avoid millions of recordsTest Plan
discovered_propertiesandagent_property_authorizationstables🤖 Generated with Claude Code