* Add Sqlite as EF DB provider
Note: In-memory sqlite does not work across projects, since the migrator
only runs on the Admin project
Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
* Include example sqlite connection string
* Add migrator assembly to sqlite connection
* Update initial migration to current schema state
* dotnet format 🤖
* Update package locks
* Respect name set in BW_SSL_KEY for cert generation (#2490)
(cherry picked from commit 2469e10110)
* [PS-2016] Add ability to change UID/GID for Bitwarden unified (#2495)
(cherry picked from commit c6fbe8cc44)
* Add SqliteMigrations project to unified Dockerfile
Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
Co-authored-by: accolon <mail@accolon.net>
Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
* Add self host notification launch settings
* Exclude current context from push for password updates
This is needed to allow the current context to process a key
rotation if one is being done.
Does not change any other call to `PushLogOut`.
* Revert inverted exclude logic
This exclude is referring to exempting the requesting client
from the notification push.
* Added "internal" to non-user-based request types to avoid failing validation.
* Added handling of unsuccessful response so that JSON parsing eror doesn't occur.
* Added logging for token errors.
(cherry picked from commit dad143b3e42247bc6b397b60803e25d243bd83a5)
* Fixed bug in next auth attempt handling.
* Fixed linting.
* Added deserialization options to handle case insensitivity.
* Added a new method for SendAsync that does not expect a result from the client.
* hasJsonResult param to make Send more reusable
* some cleanup
* fix lint problems
* Added launch config for Notifications.
* Added Notifications to Full Server config.
Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com>
* Add logging to token usages
* Add settings manipulation of log levels
* Maintain no logging for dev
* Log exception causing Token failure in TryUnprotect
* dotnet format 🤖
* Added deconstruction operator on new debug logs.
* Split off log level settings into separate files
* Improve log messages
* dotnet format 🤖
* Fix token serialization
* Final review notes
Co-authored-by: Todd Martin <>
* [SG-549] Commit Initial AuthRequest Repository (#2174)
* Model Passwordless
* Scaffold database for Passwordless
* Implement SQL Repository
* [SG-167] Base Passwordless API (#2185)
* Implement Passwordless notifications
* Implement Controller
* Add documentation to BaseRequestValidator
* Register AuthRequestRepo
* Remove ExpirationDate from the AuthRequest table
* [SG-407] Create job to delete expired requests (#2187)
* chore: init
* remove exp date
* fix: log name
* [SG-167] Added fingerprint phrase to response model. (#2233)
* Remove FailedLoginAttempt logic
* Block unknown devices
* Add EF Support for passwordless
* Got SignalR working for responses
* Added delete job method to EF repo
* Implement a GetMany API endpoint for AuthRequests
* Ran dotnet format
* Fix a merge issues
* Redated migration scripts
* tried sorting sqlproj
* Remove FailedLoginAttempts from SQL
* Groom Postgres script
* Remove extra commas from migration script
* Correct isSpent()
* [SG-167] Adde identity validation for passwordless requests. Registered IAuthRepository.
* [SG-167] Added origin of the request to response model
* Use display name for device identifier in response
* Add datetime conversions back to postgres migration script
* [SG-655] Add anonymous endpoint for checking if a device & user combo match
* [review] Consolidate error conditions
Co-authored-by: Brandon Maharaj <107377945+BrandonM-Bitwarden@users.noreply.github.com>
Co-authored-by: André Filipe da Silva Bispo <andrefsbispo@hotmail.com>
Co-authored-by: André Bispo <abispo@bitwarden.com>
* Add config endpoint with version and gitHash in response
* Remove gitHash from version, formatting and other improvements
* change name of variable in ConfigController
* Update to properly get gitHash
* SM-94: Add global settings for api url
* SM-94: ConfigController cleanup
* SM-94: Make version and gitHash available for all projects, using AssemblyHelper
* Update ConfigResponseModel GetVersion() call
* Change AssemblyHelpers.cs to use the UTF-8 charset
* SM-94: Use AssemblyHelpers.GetVersion and deprecate CoreHelpers.GetVersion
* SM-90: Add other BaseServiceUriSettings urls
* SM-94: Fix dotnet format issue
* remove old GetVersion method
* Add back the linebreak
* Fix typo in Directory.Build.props
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
* Upgrade AspNetCoreRateLimiter and enable redis distributed cache for rate limiting.
- Upgrades AspNetCoreRateLimiter to 4.0.2, which required updating NewtonSoft.Json to 13.0.1.
- Replaces Microsoft.Extensions.Caching.Redis with Microsoft.Extensions.Caching.StackExchangeRedis as the original was deprecated and conflicted with the latest AspNetCoreRateLimiter
- Adds startup task to Program.cs for Api/Identity projects to support AspNetCoreRateLimiters breaking changes for seeding its stores.
- Adds a Redis connection string option to GlobalSettings
Signed-off-by: Shane Melton <smelton@bitwarden.com>
* Cleanup Redis distributed cache registration
- Add new AddDistributedCache service collection extension to add either a Memory or Redis distributed cache.
- Remove distributed cache registration from Identity service collection extension.
- Add IpRateLimitSeedStartupService.cs to run at application startup to seed the Ip rate limiting policies.
Signed-off-by: Shane Melton <smelton@bitwarden.com>
* Add caching configuration to SSO Startup.cs
Signed-off-by: Shane Melton <smelton@bitwarden.com>
* Add ProjectName as an instance name for Redis options
Signed-off-by: Shane Melton <smelton@bitwarden.com>
* Use distributed cache in CustomIpRateLimitMiddleware.cs
Signed-off-by: Shane Melton <smelton@bitwarden.com>
* Undo changes to Program.cs and launchSettings.json
* Move new service collection extensions to SharedWeb
* Upgrade Caching.StackExchangeRedis package to v6
* Cleanup and fix leftover merge conflicts
* Remove use of Newtonsoft.Json in distributed cache extensions
* Cleanup more formatting
* Fix formatting
* Fix startup issue caused by merge and fix integration test
Signed-off-by: Shane Melton <smelton@bitwarden.com>
* Linting fix
Signed-off-by: Shane Melton <smelton@bitwarden.com>
* scim project stub
* some scim models and v2 controllers
* implement some v2 scim endpoints
* fix spacing
* api key auth
* EC-261 - SCIM Org API Key and connection type config
* EC-261 - Fix lint errors/formatting
* updates for okta implementation testing
* fix var ref
* updates from testing with Okta
* implement scim context via provider parsing
* support single and list of ids for add/remove groups
* log ops not handled
* touch up scim context
* group list filtering
* EC-261 - Additional SCIM provider types
* EC-265 - UseScim flag and license update
* EC-265 - SCIM provider type of default (0)
* EC-265 - Add Scim URL and update connection validation
* EC-265 - Model validation and cleanup for SCIM keys
* implement scim org connection
* EC-265 - Ensure ServiceUrl is not persisted to DB
* EC-265 - Exclude provider type from DB if not configured
* EC-261 - EF Migrations for SCIM
* add docker builds for scim
* EC-261 - Fix failing permissions tests
* EC-261 - Fix unit tests and pgsql migrations
* Formatting fixes from linter
* EC-265 - Remove service URL from scim config
* EC-265 - Fix unit tests, removed wayward validation
* EC-265 - Require self-hosted for billing sync org conn
* EC-265 - Fix formatting issues - whitespace
* EC-261 - PR feedback and cleanup
* scim constants rename
* no scim settings right now
* update project name
* delete package lock
* update appsettings configs for scim
* use default scim provider for context
Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com>
* Add api integration tests
* Add some stuff
* Make program mockable
* Work on IntegrationTests for Identity
* Formatting
* Update packages.lock.json
* Update more packages.lock.json
* Update all packages.lock.json
* Fix InMemory configuration
* Actually fix test configuration
* Fix tests for CI
* Fix event service
* Force EF EventRepository
* Add client_credentials test
* Remove Api.IntegrationTest
* Remove Api Program changes
* Cleanup
* Add more Auth-Email tests
* Run formatting
* Address some PR feedback
* Move integration stuff to it's own common project
* Ran linter
* Add shared project to test solution
* Remove sln changes
* Clean usings
* Add more coverage
* Address PR feedback
* Add self-host option to migration runner
* Add Self-host launch options
* Add self-hosted settings override
Let's a single secrets/env config file control both
cloud and self-hosted settings by allowing
overrides to cloud settings with self-hosted
* Allow dev-signed licenses on dev self-hosted
* Allow setting bitwarden cloud api url
Useful for testing api integration between installations and cloud
* Remove testing echoes
* Remove run config property groups
* Use `getopts` for options
* Pass in full environment
* Start switch to System.Text.Json
* Work on switching to System.Text.Json
* Main work on STJ refactor
* Fix build errors
* Run formatting
* Delete unused file
* Use legacy for two factor providers
* Run formatter
* Add TokenProviderTests
* Run formatting
* Fix merge issues
* Switch to use JsonSerializer
* Address PR feedback
* Fix formatting
* Ran formatter
* Switch to async
* Ensure Enums are serialized as strings
* Fix formatting
* Enqueue single items as arrays
* Remove CreateAsync method on AzureQueueService
* Adding a QA environment specific configuration
* separating the bitwarden environment and stripe environment checks
* adding a logging statement for the PayPal webhook key check
* adding more logging
* switched logging type
* Changing the log level on the PayPal webhook. Removing the debugging log from the Stripe Controller
* increasing the log levels on all of the services to prevent logging successes
* resetting the default logging and adding in constraints in logging in Production
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* Revert "Encode into b64 to avoid illegal xml encoding when sending to Azure (#1425)"
This reverts commit 2c9a5bb4ab.
* Azure queue to use base64 encoding universally
* Ensure byte size calc is using encoded byte count
* Remove message text extension from blockIP svc
* Remove unused using on blockIp hosted service