Introduce health checking functionality with liveness and readiness
endpoints to monitor the application's status. Implement a health
checker that verifies database connectivity and provides a simple
liveness check. Update service routing to use the new health
checker functionality. Add corresponding unit tests for validation.
Implement read-write mutex locks for cache functions to ensure
concurrency safety. Add debug logging for cache updates to enhance
traceability of operations. Optimize user addition logic to prevent
duplicates. Introduce a new test file for comprehensive cache
functionality testing, ensuring reliable behavior.
Adds a new hashed key storage mechanism for API keys in the cache.
Replaces direct mapping to API keys with composite keys based on
organizationId and name. Implements searching of API keys using
hash comparisons for improved security. Updates related tests to
ensure correct functionality and validate the hashing. Also,
adds support for a new dependency `golang.org/x/crypto`.
Adds CLAUDE.md to provide comprehensive documentation for the
GraphQL schema registry service, covering architecture, event
sourcing, GraphQL layer, schema merging, authentication,
Cosmo Router integration, and development workflow. Updates
.gitignore to include the claude directory.
Introduce the CommandExecutor interface to abstract command execution,
allowing for easier mocking in tests. Implement DefaultCommandExecutor
to use the os/exec package for executing commands. Update the
GenerateCosmoRouterConfig function to utilize the new
GenerateCosmoRouterConfigWithExecutor function that accepts a command
executor parameter. Add a MockCommandExecutor for simulating command
execution in unit tests with realistic behavior based on input YAML
files. This enhances test coverage and simplifies error handling.
Update version check to validate it is a non-empty string. Improve
assertions for the subscription configuration by ensuring the presence
of required fields and correct types. Adapt checks for routing URLs
and decentralize subscription validation for more robust testing.
These changes ensure better verification of configuration
integrity and correctness in test scenarios.
Implements the `latestSchema` query to fetch the latest schema
updates for an organization. This change enhances the GraphQL API by
allowing clients to retrieve the most recent schema version and its
associated subgraphs. The resolver performs necessary access checks,
logs relevant information, and generates the Cosmo router configuration
from fetched subgraph SDLs, returning structured schema update details.
Adds unit tests for the WebSocket initialization function to validate
behavior with valid, invalid, and absent API keys. Introduces a mock
cache implementation to simulate organization retrieval based on
hashed API keys. Ensures proper context value setting upon
initialization, enhancing test coverage and reliability for API key
handling in WebSocket connections.
Refactor API key processing to improve clarity and reduce code
duplication. Introduce detailed logging for schema updates and
initializations, capturing relevant context information. Use
background context for async operations to avoid blocking.
Implement organization lookup logic in the WebSocket init
function for consistent API key handling across connections.
Creates a new `GenerateCosmoRouterConfig` function to build and
serialize a Cosmo Router configuration from subgraphs. Implements
PubSub mechanism for managing schema updates, allowing
subscription to updates. Adds Subscription resolver and updates
existing structures to accommodate new functionalities. This
enhances the system's capabilities for dynamic updates and
configuration management.