* Add Microsoft Teams integration
* Fix method naming error
* Expand and clean up unit test coverage
* Update with PR feedback
* Add documentation, add In Progress logic/tests for Teams
* Fixed lowercase Slack
* Added docs; Updated PR suggestions;
* Fix broken tests
* ignore serena
* removing unused properties from org metadata
* removing further properties that can already be fetched on the client side using available data
* new vnext endpoint for org metadata plus caching metadata first pass
including new feature flag
# Conflicts:
# src/Core/Constants.cs
* [PM-25379] decided against cache and new query shouldn't use the service
* pr feedback
removing unneeded response model
* run dotnet format
* Refactor Slack Callback
* Add more safety to state param, clarify if logic, update tests
* Added an additional 2 possible cases to test: integration is not a slack integration, and the integration has already been claimed
* Implement SonarQube suggestion
* Adjusted org hash to include timestamp; addressed PR feedback
* Adding new logging for secrets
* fixing secrest controller tests
* fixing the tests
* Server side changes for adding ProjectId to Event table, adding Project event logging to projectsController
* Rough draft with TODO's need to work on EventRepository.cs, and ProjectRepository.cs
* Undoing changes to make projects soft delete, we want those to be fully deleted still. Adding GetManyTrashedSecretsByIds to secret repo so we can get soft deleted secrets, getSecrets in eventsController takes in orgdId, so that we can check the permission even if the secret was permanently deleted and doesn' thave the org Id set. Adding Secret Perm Deleted, and Restored to event logs
* db changes
* fixing the way we log events
* Trying to undo some manual changes that should have been migrations
* adding migration files
* fixing test
* setting up userid for project controller tests
* adding sql
* sql
* Rename file
* Trying to get it to for sure add the column before we try and update sprocs
* Adding code to refresh the view to include ProjectId I hope
* code improvements
* Suggested changes
* suggested changes
* trying to fix sql issues
* fixing swagger issue
* Update src/Core/SecretsManager/Repositories/Noop/NoopSecretRepository.cs
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Suggested changes
* Adding event logging for machine accounts
* fixing two tests
* trying to fix all tests
* trying to fix tests
* fixing test
* Migrations
* fix
* updating eps
* adding migration
* Adding missing SQL changes
* updating sql
* fixing sql
* running migration again
* fixing sql
* adding query to add grantedSErviceAccountId to event table
* Suggested improvements
* removing more migrations
* more removal
* removing all migrations to them redo them
* redoing migration
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Added MasterPasswordUnlock to UserDecryptionOptions as part of identity response
* Implement support for authentication data and unlock data in kdf change
* Extract to kdf command and add tests
* Fix namespace
* Delete empty file
* Fix build
* Clean up tests
* Fix tests
* Add comments
* Cleanup
* Cleanup
* Cleanup
* Clean-up and fix build
* Address feedback; force new parameters on KDF change request
* Clean-up and add tests
* Re-add logger
* Update logger to interface
* Clean up, remove Kdf Request Model
* Remove kdf request model tests
* Fix types in test
* Address feedback to rename request model and re-add tests
* Fix namespace
* Move comments
* Rename InnerKdfRequestModel to KdfRequestModel
---------
Co-authored-by: Maciej Zieniuk <mzieniuk@bitwarden.com>
If a user approves an invalid auth request, on the Requesting Device they currently they get stuck on the `LoginViaAuthRequestComponent` with a spinning wheel.
This PR makes it so that when an Approving Device attempts to approve an invalid auth request, the Approving Device receives an error toast and the `UpdateAuthRequestAsync()` operation is blocked.
- create vNext command
- restructure command to simplify logic
- move validation to a separate class
- implement result types using OneOf library and demo
their use here
* PM-23754 initial commit
* pm-23754 fixing controller tests
* pm-23754 adding commands and queries
* pm-23754 adding endpoints, command/queries, repositories, and sql migrations
* pm-23754 add new sql scripts
* PM-23754 adding sql scripts
* pm-23754
* PM-23754 fixing migration script
* PM-23754 fixing migration script again
* PM-23754 fixing migration script validation
* PM-23754 fixing db validation script issue
* PM-23754 fixing endpoint and db validation
* PM-23754 fixing unit tests
* PM-23754 fixing implementation based on comments and tests
* PM-23754 updating logging statements
* PM-23754 making changes based on PR comments.
* updating migration scripts
* removing old migration files
* update code based testing for whole data object for OrganizationReport and add a stored procedure.
* updating services, unit tests, repository tests
* fixing unit tests
* fixing migration script
* fixing migration script again
* fixing migration script
* another fix
* fixing sql file, updating controller to account for different orgIds in the url and body.
* updating error message in controllers without a body
* making a change to the command
* Refactor ReportsController by removing organization reports
The IDropOrganizationReportCommand is no longer needed
* will code based on PR comments.
* fixing unit test
* fixing migration script based on last changes.
* adding another check in endpoint and adding unit tests
* fixing route parameter.
* PM-23754 updating data fields to return just the column
* PM-23754 fixing repository method signatures
* PM-23754 making change to orgId parameter through out code to align with api naming
---------
Co-authored-by: Tom <144813356+ttalty@users.noreply.github.com>
* Event integration updates and cleanups
* Add Datadog integration
* Update README to include link to Datadog PR
* Move doc update into the Datadog PR; Fix empty message on ArgumentException
* Adjust exception message
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Removed unnecessary nullable enable; Moved Docs link to PR into this PR
* Remove unnecessary nullable enable calls
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Add new event types for collection management settings in EventType enum
* Refactor collection management settings update process in OrganizationsController and IOrganizationService.
Introduced UpdateCollectionManagementSettingsAsync method to streamline updates and logging for collection management settings.
* Add unit tests for collection management settings updates in OrganizationsController and OrganizationService.
Implemented tests to verify the successful update of collection management settings and the logging of specific events when settings are changed. Added error handling for cases where the organization is not found.
* Refactor collection management settings handling in OrganizationsController and IOrganizationService.
Updated the UpdateCollectionManagementSettingsAsync method to accept a single settings object, simplifying the parameter list and improving code readability. Introduced a new OrganizationCollectionManagementSettings model to encapsulate collection management settings. Adjusted related tests to reflect these changes.
* Add Obsolete attribute to Organization_CollectionManagement_Updated event in EventType enum
* Improve swagger OperationIDs: Part 1
* Fix tests and fmt
* Improve docs and add more tests
* Fmt
* Improve Swagger OperationIDs for Auth
* Fix review feedback
* Use generic getcustomattributes
* Format
* replace swaggerexclude by split+obsolete
* Format
* Some remaining excludes
* Move PushType to Platform Folder
- Move the PushType next to the rest of push notification code
- Specifically exclude it from needing Platform code review
- Add tests establishing rules Platform has for usage of this enum, making it safe to have no owner
* Move NotificationHub code into Platform/Push directory
* Update NotificationHub namespace imports
* Add attribute for storing push type metadata
* Rename Push Engines to have PushEngine suffix
* Move Push Registration items to their own directory
* Push code move
* Add expected usage comment
* Add Push feature registration method
- Make method able to be called multipes times with no ill effects
* Add Push Registration service entrypoint and tests
* Use new service entrypoints
* Test changes
* Adding new logging for secrets
* fixing secrest controller tests
* fixing the tests
* Server side changes for adding ProjectId to Event table, adding Project event logging to projectsController
* Rough draft with TODO's need to work on EventRepository.cs, and ProjectRepository.cs
* Undoing changes to make projects soft delete, we want those to be fully deleted still. Adding GetManyTrashedSecretsByIds to secret repo so we can get soft deleted secrets, getSecrets in eventsController takes in orgdId, so that we can check the permission even if the secret was permanently deleted and doesn' thave the org Id set. Adding Secret Perm Deleted, and Restored to event logs
* db changes
* fixing the way we log events
* Trying to undo some manual changes that should have been migrations
* adding migration files
* fixing test
* setting up userid for project controller tests
* adding sql
* sql
* Rename file
* Trying to get it to for sure add the column before we try and update sprocs
* Adding code to refresh the view to include ProjectId I hope
* code improvements
* Suggested changes
* suggested changes
* trying to fix sql issues
* fixing swagger issue
* Update src/Core/SecretsManager/Repositories/Noop/NoopSecretRepository.cs
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* Suggested changes
---------
Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
* migrate default collection to a shared collection when users are removed
* remove redundant logic
* fix test
* fix tests
* fix test
* clean up
* add migrations
* run dotnet format
* clean up, refactor duplicate logic to sproc, wip integration test
* fix sql
* add migration for new sproc
* integration test wip
* integration test wip
* integration test wip
* integration test wip
* fix integration test LINQ expression
* fix using wrong Id
* wip integration test for DeleteManyAsync
* fix LINQ
* only set DefaultUserEmail when it is null in sproc
* check for null
* spelling, separate create and update request models
* fix test
* fix child class
* refactor sproc
* clean up
* more cleanup
* fix tests
* fix user email
* remove unneccesary test
* add DefaultUserCollectionEmail to EF query
* fix test
* fix EF logic to match sprocs
* clean up logic
* cleanup
* Adding job to update stripe subscriptions and increment seat count when inviting a user.
* Updating name
* Added ef migrations
* Fixing script
* Fixing procedures. Added repo tests.
* Fixed set stored procedure. Fixed parameter name.
* Added tests for database calls and updated stored procedures
* Fixed build for sql file.
* fixing sproc
* File is nullsafe
* Adding view to select from instead of table.
* Updating UpdateSubscriptionStatus to use a CTE and do all the updates in 1 statement.
* Setting revision date when incrementing seat count
* Added feature flag check for the background job.
* Fixing nullable property.
* Removing new table and just adding the column to org. Updating to query and command. Updated tests.
* Adding migration script rename
* Add SyncSeats to Org.sql def
* Adding contraint name
* Removing old table files.
* Added tests
* Upped the frequency to be at the top of every 3rd hour.
* Updating error message.
* Removing extension method
* Changed to GuidIdArray
* Added xml doc and switched class to record
* Implement unit tests for PostPurge method in CiphersController to handle various scenarios
* Refactor PostPurge method in CiphersController to use Guid for organizationId parameter and update related unit tests
* Refactor PostPurge method in CiphersController to skip checking if user is claimed if its purging the org vault
* Refactor ICollectionRepository.GetManyByOrganizationIdAsync logic to include default user collections
* Add stored procedure Collection_ReadSharedCollectionsByOrganizationId to retrieve collections by organization ID, excluding default user collections.
* Add GetManySharedCollectionsByOrganizationIdAsync method to ICollectionRepository and its implementations to retrieve collections excluding default user collections.
* Add unit test for GetManySharedCollectionsByOrganizationIdAsync method in CollectionRepositoryTests to verify retrieval of collections excluding default user collections.
* Refactor controllers to use GetManySharedCollectionsByOrganizationIdAsync for retrieving shared collections
* Update unit tests to use GetManySharedCollectionsByOrganizationIdAsync for verifying shared collections retrieval
* Revert CiphersController.CanEditItemsInCollections to use GetManyByOrganizationIdAsync for retrieving organization collections
* Update stored procedures to retrieve only DefaultUserCollection by modifying the WHERE clause in Collection_ReadSharedCollectionsByOrganizationId.sql and its corresponding migration script.
* Update EF CollectionRepository.GetManySharedCollectionsByOrganizationIdAsync to filter collections by SharedCollection
* Update OrganizationUserRepository.GetManyDetailsByOrganizationAsync_vNext to only include Shared collections
* Update comments in stored procedure and migration script to clarify filtering for SharedCollections only
* Added MasterPasswordUnlock to UserDecryptionOptions as part of identity response
* Added UserDecryption with MasterPasswordUnlock as part of /sync response
* [NO LOGIC] Move query to core
* Check for unverified bank account in free trial and inactive subscription warnings
* Run dotnet format
* fix test
* Run dotnet format
* Remove errant file
* feat: exclude DefaultUserCollection from GetManyByOrganizationIdWithPermissionsAsync
Updated EF implementation, SQL procedure, and unit test to verify that default user collections are filtered from results
* Update the public CollectionsController.Get method to return a NotFoundResult for collections of type DefaultUserCollection.
* Add unit tests for the public CollectionsController
* Update ICollectionRepository.GetManyByOrganizationIdAsync to exclude results of the type DefaultUserCollection
Modified the SQL stored procedure and the EF query to reflect this change and added a new integration test to ensure the functionality works as expected.
* Refactor CollectionsController to remove unused IApplicationCacheService dependency
* Update IOrganizationUserRepository.GetDetailsByIdWithCollectionsAsync to exclude DefaultUserCollections
* Update IOrganizationUserRepository.GetManyDetailsByOrganizationAsync to exclude DefaultUserCollections
* Undo change to GetByIdWithCollectionsAsync
* Update integration test to verify exclusion of DefaultUserCollection in OrganizationUserRepository.GetDetailsByIdWithCollectionsAsync
* Clarify documentation in ICollectionRepository to specify that GetManyByOrganizationIdWithAccessAsync returns only shared collections belonging to the organization.
* Add Arrange, Act, and Assert comments to CollectionsControllerTests
* Created ReadAllOrganizationUsersBasicInformationRequirement for use with Authorize attribute.
* Removed unused req and Handler and tests. Moved to new auth attribute
* Moved tests to integration tests with new response.
* Removed tests that were migrated to integration tests.
* Made string params Guids instead of parsing them manually in methods.
* Admin and Owner added to requirement.
* Added XML docs for basic get endpoint. Removed unused. Added another auth check. Inverted if check.
* Removed unused endpoint
* Added tests for requirement
* Added checks for both User and Custom
* Added org id check to validate the user being requested belongs to the org in the route.
* typo
* Moved license models to billing
* Moved LicensingService to billing
* Moved license command and queries to billing
* Moved LicenseController to billing
* Add feature flag
* Further establish billing command pattern and use in PreviewTaxAmountCommand
* Add billing address models/commands/queries/tests
* Update TypeReadingJsonConverter to account for new union types
* Add payment method models/commands/queries/tests
* Add credit models/commands/queries/tests
* Add command/query registrations
* Add new endpoints to support new command model and payment functionality
* Run dotnet format
* Add InjectUserAttribute for easier AccountBillilngVNextController handling
* Add InjectOrganizationAttribute for easier OrganizationBillingVNextController handling
* Add InjectProviderAttribute for easier ProviderBillingVNextController handling
* Add XML documentation for billing command pipeline
* Fix StripeConstants post-nullability
* More nullability cleanup
* Run dotnet format
* [PM-17562] Add HEC integration support
* Re-ordered parameters per PR suggestion
* Apply suggestions from code review
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Refactored webhook request model validation to be more clear
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Feat(pm-20348):
* Add migration scripts for Read Pending Auth Requests by UserId stored procedure and new `view` for pending AuthRequest.
* View only returns the most recent pending authRequest, or none at all if the most recent is answered.
* Implement stored procedure in AuthRequestRepository for both Dapper and Entity Framework.
* Update AuthRequestController to query the new View to get a user's most recent pending auth requests response includes the requesting deviceId.
* Doc:
* Move summary xml comments to interface.
* Added comments for the AuthRequestService.
* Test:
* Added testing for AuthRequestsController.
* Added testing for repositories.
* Added integration tests for multiple auth requests but only returning the most recent.
* [PM-17562] Add integration filter support
* Repond to PR feedback; Remove Date-related filters
* Use tables to format the filter class descriptions
* [PM-17562] Add database support for integration filters (#5988)
* [PM-17562] Add database support for integration filters
* Respond to PR review - fix database scripts
* Further database updates; fix Filters to be last in views, stored procs, etc
* Fix for missing nulls in stored procedures in main migration script
* Reorder Filters to the bottom of OrganizationIntegrationConfiguration
* Separate out the creation of filters from the IntegrationFilterService to IntegrationFIlterFactory
* Move properties to static readonly field
* Fix unit tests failing from merge
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* [PM-17562] Update documentation for event integrations
* Fix SonarQube suggestion, bring ASB event listener in line with integration listener
* Apply suggestions from code review
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* Updates to README - PR fixes, additional context, tense alignment
* Add links to different sections; remove inline code formatting in favor of single bacticks for JSON
* [PM-17562] Add aupport for Auth on Webhook integration requests
* Repsond to PR feedback - move optional params to end, add tests for optional cases
---------
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
* PM-20574 fixing namespaces on reporting work that got moved over from tools
* PM-20574 adding tables, stored procedures, and migration files
* PM-20574 adding dapper and ef repos and migrations
* PM-20574 changing table and repo names as requested
* PM-20574 updating sql scripts to new names
* PM-20574 updating sql scripts
* PM-20574 updating migration script for org delete by id
* PM-20574 adding mysql migration
* PM-20574 updating sql migration to fix database test
* PM-20574 fixing migration script
* PM-20574 fixing migration script
* PM-20574 fixing table scripts
* PM-20574 fixing table scripts
* PM-20574 fixing migration script formatting
* PM-20574 fixing syntax in migration script
* PM-20574 fixing file names and extensions
* PM-20574 fixing sql file
* PM-20574 fixing sql
* PM-20574 fixing directory for entities and removing scripts from other databases
* PM-20574 generating new migration scripts
* PM-20574 fixed reference to a stored proc
* PM-20574 adding index in scripts and missing table
* PM-20574 fixing merge conflicts
* PM-20574 set OUTPUT param for Id property in create and update proc
* PM-20574 add CreateDate to the update proc
* PM-20574 amend update proc for OrganizationApplication by adding createDate
* PM-20576 Created OrganizationReportRepo and unit tests
* PM-20576 Commands and Query for OrganizationReport
* PM-20576 added additional unit tests to fix CodeCoverage report
* PM-20574 formatted sql and updated as per PR comments
* PM-20574 updated script to fix build error
* PM-20574 fixed inconsistency in db script
* PM-20577 organization-reports endpoints
* PM-20574 removed revisionDate, update procedures and used views
* PM-20574 removed RevisionDate from designer files
* PM-20574 removed revisionDate column that was missed previously
* PM-20574 added revision date back into the mix
* PM-20574 updated database script to fix build error
* PM-20574 fixed a procedure issue
* PM-20574 fix dB build error
* PM-020574 fixed additional PR comments - files cleaned up
* PM-20574 updated procedure was inconsistent
* PM-20576 added logs and updated errors as per PR comments
* PM-20576 fixed a build error
* PM-20576 removed RevisionDate from Repo and tests
* PM-20576 added dependency
* PM-20576 removed unwanted line from csproj file
---------
Co-authored-by: Graham Walker <gwalker@bitwarden.com>
Co-authored-by: Tom <144813356+ttalty@users.noreply.github.com>