Update test setup to leverage legacy hash for API keys in order
to avoid the performance impact of bcrypt. Replace the API key
based test with a user subscription-based test to enhance
concurrency and reliability. Replace `OrganizationByAPIKey`
with `OrganizationsByUser` to optimize the retrieval process.
Remove bcrypt hashing for API keys to speed up concurrent tests and
replace it with a legacy hashing function. Reduce the number of
concurrent readers and writers in the test to improve performance
while retaining essential functionality checks. Use a more efficient
method to fetch organizations within the concurrency test block.
Introduce `AddUserToOrganization`, `RemoveAPIKey`, and
`RemoveOrganization` commands to enhance organization
management. Implement validation for user addition and
API key removal. Update GraphQL schema to support new
mutations and add caching for the new events, ensuring
that organizations and their relationships are accurately
represented in the cache.
Decrease the number of goroutines in concurrent read and write tests to
minimize race conditions during testing. This ensures more reliable
test results and makes it easier to identify concurrency issues.
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.