* [Reset Password] Enterprise Policy
* Created UI for policy/edit policy // Updated TODOs for policy dependent checks
* Updated reset password data model field name to be more descriptive
* Update title to Master Password Reset
* Updated PoliciesModel, Policy Model spacing, and strings
* [Reset Password] Organization Key Pair
* Fixed type in Organization_ReadAbilites sproc
* Fixed broken unit test by making sure premium addon was false
* Updated PublicKey decorator and removed unecessary validation
* Fix password reprompt not working in org view
* Also fix Cipher_UpdateWithCollections and CipherDetails_CreateWithCollections. Rename migration script
* [Reset Password] Admin reset actions
* Updated thrown except for permission collision
* Updated GET/PUT password reset to use orgUser.Id for db operations
* 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.
* Add send HideEmail to tables and models
* Respect HideEmail setting for Sends
* Recreate SendView to include new HideEmail column
* Enforce new Send policy
* Insert default value for new HideEmail column
* Delete c95d7598-71cc-4eab-8b08-aced0045198b.json
* Remove unrelated files
* Revert disableSendPolicy, add sendOptionsPolicy
* Minor style fixes
* Update SQL project with Send.HideEmail column
* unit test SendOptionsPolicy.DisableHideEmail
* Add SendOptionsPolicy to Portal
* Make HideEmail nullable, fix migrator script
* Remove NOT NULL constraint from HideEmail
* Fix style
* Make HideEmail nullable
* minor fixes to model and error message
* Move SendOptionsExemption banner
Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
* 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>
* Push syncs on Send Access
* Revert "Push syncs on Send Access"
This reverts commit 6a3eb7af4f.
* Push update of Send directly since we can't use SaveSendAsync method
* Fix single org policy when creating organization
Exclude owners and admins from policy when creating new org
* Fix single org and 2FA policy on accepting invite
Exclude owners and admins from policies
* Remove looped async calls
* Fix code style and formatting
* 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
* 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
It turns out Singleton DI of interfaces does not use the specified
instance's Singleton, but just creates its own. This fixes the bug
where classes expecting an IGlobalSettings were given an empty GlobaSettings
instance
* 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
* 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
* Revert "Only return policy in TakeoverResponse if Owner"
This reverts commit b20e6f5e85.
* Revert "Return grantor policy info in TakeoverResponse"
This reverts commit 204217a5e0.
* Add endpoint to get grantor policies on takeover
* Add Disable Send policy
* Test DisableSend policy
* PR Review
* Update tests for using CurrentContext
This required making an interface for CurrentContext and mocking out
the members used. The interface can be expanded as needed for tests.
I moved CurrentContext to a folder, which changes the namespace
and causes a lot of file touches, but most are just adding a reference
* Fix failing test
* Update exemption to include all exempt users
* Move all CurrentContext usages to ICurrentContext
* PR review. Match messaging with Web
* Initial commit of welcome email update
* Final revisions and updated hosted image urls
* added dynamic year // updated verbiage // fixed typo in text template
* Updated verbiage // changed mustache accessor // updated how year is generated
* Null checked org invite collections
* Null checked permissions on org invite
* Gave a static seat count to org invite fixture
* Null checked the right way
* Implemented Custom role and permissions
* Converted permissions columns to a json blob
* Code review fixes for Permissions
* sql build fix
* Update Permissions.cs
* formatting
* Update IOrganizationService.cs
* reworked a conditional
* built out tests for relevant organization service methods
* removed unused usings
* fixed a broken test and a bad empty string init
* removed 'Attribute' from some attribute instances
* Return revised ciphers on restore api call
* Return restored date from restore sproc
* Test Restore updates passed in ciphers
This is necessary for CipherController to appropriately return the
up-to-date ciphers without an extra db call to read them.
* Add missing SELECT
* Sorted usings
* Added CoreHelpersTests
* Added CloneObject test
* Added comments to SelfHostedAttributeTests
* Changed private variable declaration to be inline with the rest of the project
* Changed to SUT naming scheme
* Scaffolded AppleIapServiceTests
* Scaffolded I18nServiceTests.cs
* Scaffolded I18nViewLocalizerTests
* Scaffolded LocalSendStorageServiceTests
* Added tests to ReadableBytesSize_Success
* Add more CleanCertificateThumbprint tests
* Added more tests for the ExtendQuery method
* Removed AppleIapServiceTests
* Removed I18nServiceTests
* Removed I18nViewLocalizerTests
* Removed LocalSendStorageServiceTests
* Converted Batch_Success to theory with InlineData
* Simplified Batch_Success so there is less branching and more accuracy
* Switched to using size variable to format readable bytes for any number lower than 1024
* Fixed test data to work in all locales
* Initial commit of provisioning updates
* Updated strings
* removed extra BANG
* Separated orgUsers db lookup - prioritized existing user Id
* Updated create sso record method // Added sproc for org/email retrieval
* Implemented tax collection for subscriptions
* Cleanup for Sales Tax
* Cleanup for Sales Tax
* Changes a constraint to an index for checking purposes
* Added and implemented a ReadById method for TaxRate
* Code review fixes for Tax Rate implementation
* Code review fixes for Tax Rate implementation
* Made the SalesTax migration script rerunnable
* Add last updated validation to cipher replacements
* Add AutoFixture scaffolding.
AutoDataAttributes and ICustomizations are meant to automatically
produce valid test input. Examples are the Cipher customizations,
which enforce the model's mutual exclusivity of UserId and
OrganizationId.
FixtureExtensions create a fluent way to generate SUTs. We currently
use parameter injection to fascilitate service testing, which is nicely
handled by AutoNSubstitute. However, in order to gain access to the
substitutions, we need to Freeze them onto the Fixture. The For fluent
method allows specifying a Freeze to a specific type's constructor and
optionally to a parameter name in that constructor.
* Unit tests for single Cipher update version checks
* Fix test runner
Test runner requires Microsoft.NET.Test.Sdk
* Move to provider model for SUT generation
This model differs from previous in that you no longer need to specify
which dependencies you would like access to. Instead, all are
remembered and can be queried through the sutProvider.
* User cipher provided by Put method reads
Every put method already reads all relevant ciphers from database,
there's no need to re-read them.
JSON serialization of datetimes seems to leave truncate at second
precision. Verify last known date time is within one second rather than
exact.
* validate revision date for share many requests
* Update build script to use Github environment path
Co-authored-by: Matt Gibson <mdgibson@Matts-MBP.lan>