1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-29 00:32:18 -05:00

44 Commits

Author SHA1 Message Date
Kyle Spearrin
7cc7b84eaf
use fixed-time comparison of secrets (#1698) 2021-11-08 15:55:42 -05:00
Matt Gibson
022e404cc5
Attachment blob upload (#1229)
* Add Cipher attachment upload endpoints

* Add validation bool to attachment storage data

This bool is used to determine whether or not to renew upload links

* Add model to request a new attachment to be made for later upload

* Add model to respond with created attachment.

The two cipher properties represent the two different
cipher model types that can be returned. Cipher Response from
personal items and mini response from organizations

* Create Azure SAS-authorized upload links for both one-shot and block uploads

* Add service methods to handle delayed upload and file size validation

* Add emergency access method for downloading attachments direct from Azure

* Add new attachment storage methods to other services

* Update service interfaces

* Log event grid exceptions

* Limit Send and Attachment Size to 500MB

* capitalize Key property

* Add key validation to Azure Event Grid endpoint

* Delete blob for unexpected blob creation events

* Set Event Grid key at API startup

* Change renew attachment upload url request path to match Send

* Shore up attachment cleanup method.

As long as we have the required information, we should always delete
attachments from each the Repository, the cipher in memory, and the
file storage service to ensure they're all synched.
2021-03-30 18:41:14 -05:00
Matt Gibson
989d4df599
Direct upload to Azure/Local (#1188)
* Direct upload to azure

To validate file sizes in the event of a rogue client, Azure event webhooks
will be hooked up to AzureValidateFile.
Sends outside of a grace size will be deleted as non-compliant.

TODO: LocalSendFileStorageService direct upload method/endpoint.

* Quick respond to no-body event calls

These shouldn't happen, but might if some errant get requests occur

* Event Grid only POSTS to webhook

* Enable local storage direct file upload

* Increase file size difference leeway

* Upload through service

* Fix LocalFileSendStorage

It turns out that multipartHttpStreams do not have a length
until read. this causes all long files to be "invalid". We need to
write the entire stream, then validate length, just like Azure.

the difference is, We can return an exception to local storage
admonishing the client for lying

* Update src/Api/Utilities/ApiHelpers.cs

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>

* Do not delete directory if it has files

* Allow large uploads for self hosted instances

* Fix formatting

* Re-verfiy access and increment access count on download of Send File

* Update src/Core/Services/Implementations/SendService.cs

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>

* Add back in original Send upload

* Update size and mark as validated upon Send file validation

* Log azure file validation errors

* Lint fix

Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
2021-03-21 23:01:19 -05: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
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
Kyle Spearrin
f23a8edc45
Update stripe lib (#793) 2020-06-24 21:24:19 -04:00
Chad Scharf
9800b752c0 Changed all C# control flow block statements to include space between keyword and open paren 2020-03-27 14:36:37 -04:00
Kyle Spearrin
fa1322599f remove using 2020-01-10 16:24:16 -05:00
Kyle Spearrin
77180e0c82 update DisableFormValueModelBindingAttribute 2020-01-10 16:23:56 -05:00
Kyle Spearrin
e13f022c90 upgrade swagger 2020-01-10 09:36:12 -05:00
Kyle Spearrin
7fd6e4359d fix warnings 2020-01-10 08:47:58 -05:00
Kyle Spearrin
2684de0fff add more metadata to swaggergen 2019-03-07 14:06:02 -05:00
Kyle Spearrin
8d51700120 modelstate and exception handling for public apis 2019-03-01 17:30:44 -05:00
Kyle Spearrin
e0d7da892e xml documentation for swaggergen 2019-03-01 09:34:07 -05:00
Kyle Spearrin
c02f732056 camelcase swagger/public apis 2019-02-28 20:50:40 -05:00
Kyle Spearrin
1c71af47bb swagger specs for public api 2019-02-28 14:20:14 -05:00
Kyle Spearrin
7cda459127 support for attachments keys
load existing items and set attachments on key update
2018-11-14 17:19:04 -05:00
Kyle Spearrin
86aa342bad Return not support extension messages 2018-09-17 12:53:52 -04:00
Kyle Spearrin
2cf9127ef1 limit edit functions to cloud hosted 2018-03-23 09:44:48 -04:00
Kyle Spearrin
9cb1047f2b setup to receive & process event postings 2017-12-04 10:59:07 -05:00
Kyle Spearrin
a63ad7772e support Bearer3 still 2017-10-17 08:54:49 -04:00
Kyle Spearrin
f2183246d2 update libs, aspnet core 20, & id server 2.0 2017-10-06 11:38:47 -04:00
Kyle Spearrin
16e5ba5a76 Accept "Content-Language" header for JWT token 2017-09-14 10:11:48 -04:00
Kyle Spearrin
18b60e5350 wrap file body stream in using block 2017-08-31 09:25:54 -04:00
Kyle Spearrin
5259b07889 create org with license file 2017-08-14 20:57:45 -04:00
Kyle Spearrin
18cbc79dd2 update premium license and self host attr checks 2017-08-14 12:08:57 -04:00
Kyle Spearrin
082b53e133 refactor for addtnl. payment service (braintree) 2017-07-28 12:09:12 -04:00
Kyle Spearrin
6cea556ae1 post, upload, and save cipher attachment 2017-06-30 11:15:58 -04:00
Kyle Spearrin
06ca566be1 attachment apis and azure storage service 2017-06-15 15:34:12 -04:00
Kyle Spearrin
ef3d5ee10c user null checks for unauthorized 2017-06-02 13:17:46 -04:00
Kyle Spearrin
c4293afe57 typos 2017-05-06 09:12:45 -04:00
Kyle Spearrin
c4abe765ba move TokenRetrieval to api 2017-05-05 23:21:58 -04:00
Kyle Spearrin
d69ad2e32e handle stripe card errors 2017-04-11 12:27:13 -04:00
Kyle Spearrin
8bcd4e0463 move all models into core 2017-03-08 21:55:08 -05:00
Kyle Spearrin
52b8fef26f identitysever cleanup 2017-01-20 22:26:19 -05:00
Kyle Spearrin
9e17c2e50c Allow mac for EncryptedString 2017-01-02 21:52:48 -05:00
Kyle Spearrin
b04843b124 remove unused usings 2016-10-20 22:56:28 -04:00
Kyle Spearrin
e7a7b946be suppress logs for bad security token 2016-10-14 21:29:09 -04:00
Kyle Spearrin
fefe541251 cipher revision update. fixed exception handler logging issue. added logger to push service. 2016-06-30 21:31:12 -04:00
Kyle Spearrin
afa37f5ab1 Log errors with full exception 2016-06-21 23:55:21 -04:00
Kyle Spearrin
585d7b4afd Fixed null check. 2016-06-02 10:08:26 -04:00
Kyle Spearrin
79f507fe68 Upgrade to ASP.NET Core RC2 release. 2016-05-19 23:17:01 -04:00
Kyle Spearrin
ef3853d507 Added loggr logging for production environment. 2016-02-06 23:45:33 -05:00
Kyle Spearrin
437b971003 initial commit of source 2015-12-08 22:57:38 -05:00