Repository navigation
make datagateway optional in events - #778
Merged
Merged
Conversation
rhafer
reviewed
Aug 19, 2026
rhafer
left a comment
Member
There was a problem hiding this comment.
Sorry, but I can't really make sense of this PR. The commit message talks about events, but the codes only touches the URL() method. I suspect the result of URL() is used for sending some event. But it's not really clear. Some more context in the commit message would help.
The PR description/braindump, doesn't really help either.
Our current code actually only works with a datagateway. When a BytesReceived event is published the storage driver always wraps the DataProvider URL in a JWT and prepends the datagateway URL. This PR makes that datagateway optional, which allows actually exposing the dataprovider to other services directly. Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
butonic
force-pushed
the
make-tokens-in-events-optional
branch
from
August 19, 2026 11:54
4845d1c to
164274c
Compare
rhafer
approved these changes
Aug 19, 2026
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.
Part of opencloud-eu/opencloud#3289
Our current code actually only works with a datagateway. When a BytesReceived event is published the storage driver always wraps the DataProvider URL in a JWT and prepends the datagateway URL. This PR makes the datagateway optional.
Once this is merged I will rebase the opencloud PR and remove any config options for this.
We could delete the datagateway and token related code from the storage drivers later if we can assume that only internal services will consume events. Or replace the config option with an events "middleware"? nah ... just get rid of it.
🤔 wait ... In kubernetes the antivirus service lives in another pod. references to localhost won't work. Why do we even go through another HTTP download to read the bytes? Well because not all upload implementations might store the upload on disk. Ok, so reading via HTTP makes sense.
I still don't like that the storagedriver has to know its url, only so it can create a download url when emitting events. The dataprovider currently handles the datagateway wrapping if it is configured to not expose the data provider. But it currently cannot do that.
If we really need to wrap urls in events in the future we should use a custom events.Stream implementation to wrap the underlying stream. The storageproider can then inject this wrapper into the storage drivers:
We could even always wrap the stream and let the storageprovider write the URL. The storage driver only sets the upload ID. Then it would not need to know the host and port of the storage provider. 🤩