WPB-22814 allow ephemeral users to upload files#5016
WPB-22814 allow ephemeral users to upload files#5016battermann wants to merge 16 commits intodevelopfrom
Conversation
de3759d to
543af8f
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates Cargohold’s asset upload/download authorization logic to treat ephemeral (temporary guest) accounts as eligible for file transfers, and adds a Brig-side mechanism intended to enforce ephemeral expiry via internal status lookups.
Changes:
- Allow
AccountStatus.Ephemeralusers to upload and download assets (same allowance asActive). - Add a shared
getUserStatushelper in Cargohold that queries Brig’s internal “user status” endpoint (with a newgcquery param). - Extend integration coverage for ephemeral upload/download and add an expiry-focused test case.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| services/cargohold/src/CargoHold/API/V3.hs | Adds account-status gating to the V3 download flow to allow Ephemeral. |
| services/cargohold/src/CargoHold/API/Util.hs | Introduces getUserStatus helper calling Brig internal status endpoint with gc=true. |
| services/cargohold/src/CargoHold/API/Public.hs | Updates upload status checks to allow Ephemeral via getUserStatus. |
| services/brig/src/Brig/API/Internal.hs | Adds optional gc param handling to enqueue deletion for expired ephemeral users when requested. |
| libs/wire-api/src/Wire/API/Routes/Internal/Brig.hs | Updates the internal Brig route type to include the new gc query param. |
| integration/test/Test/Cargohold/AssetUpload.hs | Removes an unverified-user upload test; retains verified/unknown-user coverage. |
| integration/test/Test/Cargohold/AssetDownload.hs | Adds ephemeral upload/download tests, including an expiry scenario. |
| changelog.d/2-features/WPB-22814 | Changelog entry for allowing ephemeral users to upload/download files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
services/cargohold/src/CargoHold/Options.hs:158
maxTotalBytesStrictis a new non-optionalSettingsfield derived viaderiveFromJSON defaultOptions, so existing cargohold.yaml configs that only specifymaxTotalByteswill fail to parse at startup. To keep backward compatibility, consider parsingmaxTotalBytesStrictas optional and defaulting it tomaxTotalBytes(or provide a sensible default in the decoder) and update any remaining repo configs accordingly.
data Settings = Settings
{ -- | Maximum allowed size for uploads, in bytes (applies to team users)
maxTotalBytes :: !Int,
-- | Maximum allowed size for uploads, in bytes (more restrictive setting, applies to non-team users)
maxTotalBytesStrict :: !Int,
-- | TTL for download links, in seconds
downloadLinkTTL :: !Word,
-- | Enable audit logging for asset uploads/downloads.
-- When enabled, the backend will collect and log asset metadata
-- as part of the asset audit log feature.
assetAuditLogEnabled :: !Bool,
-- | FederationDomain is required, even when not wanting to federate with other backends
-- (in that case the 'allowedDomains' can be set to empty in Federator)
-- Federation domain is used to qualify local IDs and handles,
-- e.g. 0c4d8944-70fa-480e-a8b7-9d929862d18c@wire.com and somehandle@wire.com.
-- It should also match the SRV DNS records under which other wire-server installations can find this backend:
-- _wire-server-federator._tcp.<federationDomain>
-- Once set, DO NOT change it: if you do, existing users may have a broken experience and/or stop working
-- Remember to keep it the same in all services.
-- This is referred to as the 'backend domain' in the public documentation; See
-- https://docs.wire.com/how-to/install/configure-federation.html#choose-a-backend-domain-name
federationDomain :: !Domain,
disabledAPIVersions :: !(Set VersionExp)
}
deriving (Show, Generic)
deriveFromJSON defaultOptions ''Settings
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://wearezeta.atlassian.net/browse/WPB-22814
Checklist
changelog.dAcceptance Criteria