Repository navigation
fix: [OCSRE-1629] read the NATS creds file once for each connection attempt - #828
Merged
Merged
Conversation
…ttempt NATS always calls UserJWT before SignatureCB for one connection attempt. Before, both callbacks read the .creds file on their own. A rotated file could change between the two reads. The JWT and the signature then came from different files. UserJWT now reads the file and keeps the content. SignatureCB uses this content and wipes it after the signature. If NATS calls SignatureCB first, it reads the file as before. Backport of #793 from stable-8.0. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
mzner
approved these changes
Nov 20, 2026
deyankiteworks
approved these changes
Nov 20, 2026
This was referenced Nov 20, 2026
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 23, 2026
* chore(deps): [OCISDEV-1685] bump reva Update reva to the main branch at cbb65e2fd. The update includes these changes: 1. owncloud/reva#830 handles transient storage errors in the retry path of the received share cache. 2. owncloud/reva#828 reads the NATS credentials file once for each connection attempt. The pull request for OCISDEV-1685 needs the first change. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]> * fix: [OCISDEV-1685] keep the blob read message in the blobstore CLI The reva change owncloud/reva#830 changes the ocis blobstore. When the blob file does not exist, Download now returns a NotFound error. Before, it returned an error with the text "could not read blob". The command `ocis storage-users blobstore get` printed only the NotFound text. The acceptance scenario cliCommands/blobstore.feature:44 expects the text "download failed: could not read blob". Add the text "could not read blob" to the message when the error is NotFound. The message keeps the NotFound error in the chain. Add a unit test for downloadBlob. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]> --------- Signed-off-by: Roman Perekhod <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Backport of #793 to
main.Problem
NATS always calls
UserJWTbeforeSignatureCBfor one connection attempt. Before this change, both callbacks inpkg/natsauth/natsauth.goread the.credsfile on their own. A rotated file can change between the two reads. Then the JWT and the signature come from different files and the connection fails.Change
UserJWTreads the file and keeps the content.SignatureCBuses this content and wipes it after the signature.SignatureCBfirst, it reads the file as before.The code is the same as in #793. The patch applies without conflicts.
Tests
go test -racefor./pkg/natsauth/. All tests pass.Changelog
No new entry. The feature from #799 has its own unreleased entry
changelog/unreleased/nats-jwt-credentials.md.🤖 Generated with Claude Code