Skip to content

fix: [stable-9.0][OCSRE-1629] read the NATS creds file once for each connection attempt - #829

Merged
2403905 merged 1 commit into
stable-9.0from
fix/OCSRE-1629-userjwt-stable-9.0
Nov 20, 2026
Merged

2403905 merged 1 commit into
stable-9.0from
fix/OCSRE-1629-userjwt-stable-9.0

Conversation

@2403905

@2403905 2403905 commented Nov 20, 2026

Copy link
Copy Markdown

Backport of #793 to stable-9.0.

Problem

NATS always calls UserJWT before SignatureCB for one connection attempt. Before this change, both callbacks in pkg/natsauth/natsauth.go read the .creds file 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

  • UserJWT 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.

The code is the same as in #793. The patch applies without conflicts.

Tests

Changelog

No new entry. The feature from #798 has its own unreleased entry changelog/unreleased/nats-jwt-credentials.md.

🤖 Generated with Claude Code

…connection attempt

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]>
@2403905
2403905 requested a review from a team as a code owner November 20, 2026 14:45
@kw-security

kw-security commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@2403905
2403905 merged commit 02f6aa4 into stable-9.0 Nov 20, 2026
14 checks passed
@2403905
2403905 deleted the fix/OCSRE-1629-userjwt-stable-9.0 branch November 20, 2026 15:05
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 23, 2026
* chore(deps): [stable-9.0][OCISDEV-1685] bump reva

Update reva to the stable-9.0 branch at f6b50353c. The update includes these
changes:

1. owncloud/reva#831 handles transient storage errors in the retry path of
   the received share cache.
2. owncloud/reva#829 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]>
(cherry picked from commit 4f104bb)
Signed-off-by: Roman Perekhod <[email protected]>

* docs: [stable-9.0][OCISDEV-1685] add the changelog for the reva bump

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants