1
0
mirror of https://github.com/bitwarden/server synced 2025-12-16 08:13:33 +00:00
Commit Graph

14 Commits

Author SHA1 Message Date
Matt Gibson
c2d34d7271 Fix send file length always zero (#1175)
* HttpStream must be read prior to knowing it length

We also need to create the send prior to saving the stream so we
have well defined save location. Solve chicken-and-egg problem by saving
the Send twice. This also allows for validation that the stream received
is the same length as that promissed by the content-length header

* Get encrypted file length from request
2021-03-02 09:27:11 -06:00
Matt Gibson
8d5fc21b51 Prepare for send direct upload (#1174)
* Add sendId to path

Event Grid returns the blob path, which will be used to grab a Send and verify file size

* Re-validate access upon file download

Increment access count only when file is downloaded. File
name and size are leaked, but this is a good first step toward
solving the access-download race
2021-03-01 15:01:04 -06:00
Addison Beck
b21c9042ca added expiration date and creator identifier to the Send access response model (#1166) 2021-02-25 17:04:53 -05:00
Matt Gibson
e350daeeee Use sas token for send downloads (#1157)
* Remove Url from SendFileModel

Url is now generated on the fly with limited lifetime.

New model houses the download url generated

* Create API endpoint for getting Send file download url

* Generate limited-life Azure download urls

* Lint fix
2021-02-24 13:03:16 -06:00
Matt Gibson
5537470703 Use sas token for attachment downloads (#1153)
* Get limited life attachment download URL

This change limits url download to a 1min lifetime.
This requires moving to a new container to allow for non-public blob
access.

Clients will have to call GetAttachmentData api function to receive the download
URL. For backwards compatibility, attachment URLs are still present, but will not
work for attachments stored in non-public access blobs.

* Make GlobalSettings interface for testing

* Test LocalAttachmentStorageService equivalence

* Remove comment

* Add missing globalSettings using

* Simplify default attachment container

* Default to attachments containe for existing methods

A new upload method will be made for uploading to attachments-v2.
For compatibility for clients which don't use these new methods, we need
to still use the old container. The new container will be used only for
new uploads

* Remove Default MetaData fixture.

* Keep attachments container blob-level security for all instances

* Close unclosed FileStream

* Favor default value for noop services
2021-02-22 15:35:16 -06:00
Kyle Spearrin
c3a99402f8 adjust date validation for send (#1137) 2021-02-11 14:39:21 -05:00
Addison Beck
b8a2158626 enabled send and added send sync notifications (#1106) 2021-01-22 16:16:40 -05:00
Chad Scharf
dd207aa840 disable send (#1096) 2021-01-19 16:46:59 -05:00
Kyle Spearrin
d96da37e2a validate send model parameters (#1067) 2020-12-30 16:25:00 -05:00
Kyle Spearrin
25dff79527 enable send 2020-12-11 16:44:39 -05:00
Chad Scharf
36195eb0c9 disable send for release (#1019) 2020-12-02 17:15:08 -05:00
Chad Scharf
faf909479e re-enable send (#1004) 2020-11-18 12:43:58 -05:00
Kyle Spearrin
ac1defc97a bump versions and disabled send creation 2020-11-12 21:43:10 -05:00
Kyle Spearrin
82dd364e65 Send APIs (#979)
* send work

* fix sql proj file

* update

* updates

* access id

* delete job

* fix delete job

* local send storage

* update sprocs for null checks
2020-11-02 15:55:49 -05:00