You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: implement atomic secret provisioning in userSecretRepositoryExtension - #1891
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
📝 Walkthrough
The user-secret repository adds conflict-tolerant secret creation. The Sitenova authentication service uses the persisted secret as its signing key. End-to-end tests cover concurrent requests, key reuse, visitor-token validation, and unauthenticated requests.
The repository interface and extension add createSecretUnlessExists. It attempts an insert while ignoring conflicts, then returns the row matching the slug and company ID, or throws if no row is found.
Persisted signing key and endpoint tests backend/src/microservices/sitenova-microservice/services/sitenova-enduser-auth.service.ts, backend/test/ava-tests/non-saas-tests/non-saas-sitenova-microservice-e2e.test.ts
The service decrypts the secret returned by the repository. Tests check that eight concurrent authenticated requests return the same key, that one matching secret is stored, that a visitor token validates with the key, that a later request returns the stored key, and that a request without a microservice JWT returns 401.
This change makes first-time signing key creation consistent under concurrent requests, so all callers use the same stored key. No merge-blocking risk was found in the supplied context.
Pre-merge checks · 6
Passed checks (6 passed)
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly describes the main change: adding atomic secret provisioning to userSecretRepositoryExtension to address concurrent secret creation.
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Security Check
No OWASP-relevant security regression is introduced. The new repository method uses TypeORM parameter binding and the existing unique (companyId, slug) index with conflict-ignore, then reads the exa…
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
Commit to this branch
Create a new PR
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This rabbit watched eight requests arrive, One stored key kept each reply alive. A visitor token passed the test, Later calls found the same secret. I twitch my nose and hop away!
Comment @coderabbitai help to get the list of available commands.
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
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 by CodeRabbit