1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
Commit Graph

3407 Commits

Author SHA1 Message Date
Vince Grassia
2ec10cfd2a
Standardize '/version' endpoint on all services (#1755) 2021-12-09 15:45:45 -05:00
Oscar Hinton
d3673cdc85
Remove support for PascalCase (Use camelCase in prod) (#1753) 2021-12-09 14:38:18 +01:00
github-actions[bot]
605632fcb7
Bumped version to 1.45.1 (#1751)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-08 13:15:24 -05:00
Oscar Hinton
71c4b53999
Fix recursive call in TwoFactorWebAuthnDeleteRequestModel (#1750)
* Fix recursive call in TwoFactorwebAuthnDeleteRequestModel

* Add new befoer IEnumerable

* Use virtual and override
2021-12-08 12:43:21 -05:00
Vince Grassia
4ccbf091fb
Remove check for EventsProcessor (#1749) 2021-12-08 00:19:15 -05:00
Vince Grassia
dae0029dbb
Switch from AWS ECR to Azure ACR in our workflows (#1747) 2021-12-07 23:28:13 -05:00
github-actions[bot]
2e580e86cb
Bumped version to 1.45.0 (#1748)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-07 18:45:24 -08:00
Joseph Flinn
61c9a1b573
fixing the build-docker script (#1746)
* fixing the build-docker script

* fixing some typos

* fixing one more typo
2021-12-07 10:30:18 -08:00
Matt Gibson
d7e92dae5b
Determine self hosted from global settings (#1744) 2021-12-07 10:52:36 -06:00
Matt Gibson
9177ad1ca8
Parse enqueued mail message model to object (#1742)
* Parse enqueued mail message model to object

The model of an MailQueueMessage is of type object to enable enqueueing
of any message. However, this means the we are not able to parse a
serialized json object back into the original object.
Provide the model type to enable this deserialization

* Use ExpandoObject for deserialized queue message model
2021-12-03 12:12:46 -06:00
Oscar Hinton
71229c2366
Streamline error message for removed user account with CME (#1741) 2021-12-02 18:38:27 +00:00
Matt Gibson
a70564cea8
Families for enterprise/fix new org sponsorship after deleted sponsored org (#1740)
* Sponsorship exists only if sponsored org is not null

* Replace existing sponsorship if necessary

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

Co-authored-by: Robyn MacCallum <nickersthecat@gmail.com>

* Fix tests

Co-authored-by: Robyn MacCallum <nickersthecat@gmail.com>
2021-12-02 10:27:41 -06:00
Matt Gibson
dc3d70cf3a
Pay 0 cost invoices that have not been paid (#1739) 2021-12-01 14:41:05 -06:00
Matt Gibson
757927e02a
Null org, org user ids, and friendly name to indicate invalid, unused sponsorship state (#1738)
* Null org, org user ids, and friendly name to indicate invalid, unused sponsorship state

* Match EF queries to MSSQL sprocs
2021-12-01 14:34:56 -06:00
Daniel James Smith
ad18adf471
Migrate deprecated Microsoft.Azure.EventGrid to Azure.Messaging.EventGrid (#1731)
* Migrate from deprecated Microsoft.Azure.EventGrid to Azure.Messaging.EventGrid

* Fixed retrieval/parsing of EventGridEvents

* Fixed an issue where the events where not handled by the registered event handlers
2021-11-30 19:47:56 +01:00
Micaiah Martin
cc490a76de
Ci/version bump action (#1737)
* Added version bump workflow

* Updated action to use newly merged PR version

* Formatted YAML

* Refactored workflow to reduce runtime and move away from third party actions
2021-11-30 08:52:18 -07:00
Thomas Rittson
90a2a55438
Fix Stripe object lock timeouts (#1735)
* Fix Stripe object lock timeouts

* Move stripe config into globalSetting.stripe
* add MaxNetworkRetries config option with smart defaults

* Rename stripeApiKey to apiKey
2021-11-29 10:01:51 +10:00
Matt Gibson
8dffb27667
Families for enterprise/add sponsorship prevalidate (#1734)
* Add sponsorship prevalidate endpoint

* Test pre validate endpoint

* Fix tests

* Rename variable
2021-11-24 14:18:52 -06:00
Oscar Hinton
0ae9e28884
Use Azure SQL Edge for development (#1709) 2021-11-24 19:08:36 +01:00
Matt Gibson
fa3f1ad0ce
Null out sponsorship values when foreign key deleted (#1733)
This allows us to maintain record of sponsorships up
until they are explicitly removed. Fixes issues where removing
sponsorships from organizations with invalid sponsorships would error
2021-11-24 08:26:11 -06:00
Thomas Rittson
29d3e1fd2b
Fix null error when leaving organization (#1730)
* Fix null error when leaving organization

* Update tests
2021-11-22 19:55:25 +10:00
Thomas Rittson
7e3e87ed39
Update error message for leaving org with CME (#1729) 2021-11-22 08:22:28 +10:00
Matt Gibson
33edc8eba0
Families for Enterprise (#1714)
* Create common test infrastructure project

* Add helpers to further type PlanTypes

* Enable testing of ASP.net MVC controllers

Controller properties have all kinds of validations in the background.
In general, we don't user properties on our Controllers, so the easiest
way to allow for Autofixture-based testing of our Controllers is to just
omit setting all properties on them.

* Workaround for broken MemberAutoDataAttribute

https://github.com/AutoFixture/AutoFixture/pull/1164 shows that only
the first test case is pulled for this attribute.

This is a workaround that populates the provided parameters, left to
right, using AutoFixture to populate any remaining.

* WIP: Organization sponsorship flow

* Add Attribute to use the Bit Autodata dependency chain

BitAutoDataAttribute is used to mark a Theory as autopopulating
parameters.

Extract common attribute methods to to a helper class. Cannot
inherit a common base, since both require inheriting from different
Xunit base classes to work.

* WIP: scaffolding for families for enterprise sponsorship flow

* Fix broken tests

* Create sponsorship offer (#1688)

* Initial db work (#1687)

* Add organization sponsorship databases to all providers

* Generalize create and update for database, specialize in code

* Add PlanSponsorshipType to db model

* Write valid json for test entries

* Initial scaffolding of emails (#1686)

* Initial scaffolding of emails

* Work on adding models for FamilyForEnterprise emails

* Switch verbage

* Put preliminary copy in emails

* Skip test

* Families for enterprise/stripe integrations (#1699)

* Add PlanSponsorshipType to static store

* Add sponsorship type to token and creates sponsorship

* PascalCase properties

* Require sponsorship for remove

* Create subscription sponsorship helper class

* Handle Sponsored subscription changes

* Add sponsorship id to subscription metadata

* Make sponsoring references nullable

This state indicates that a sponsorship has lapsed, but was not able to
be reverted for billing reasons

* WIP: Validate and remove subscriptions

* Update sponsorships on organization and org user delete

* Add friendly name to organization sponsorship

* Add sponsorship available boolean to orgDetails

* Add sponsorship service to DI

* Use userId to find org users

* Send f4e offer email

* Simplify names of f4e mail messages

* Fix Stripe org default tax rates

* Universal sponsorship redeem api

* Populate user in current context

* Add product type to organization details

* Use upgrade path to change sponsorship

Sponsorships need to be annual to match the GB add-on charge rate

* Use organization and auth to find organization sponsorship

* Add resend sponsorship offer api endpoint

* Fix double email send

* Fix sponsorship upgrade options

* Add is sponsored item to subscription response

* Add sponsorship validation to upcoming invoice webhook

* Add sponsorship validation to upcoming invoice webhook

* Fix organization delete sponsorship hooks

* Test org sponsorship service

* Fix sproc

* Create common test infrastructure project

* Add helpers to further type PlanTypes

* Enable testing of ASP.net MVC controllers

Controller properties have all kinds of validations in the background.
In general, we don't user properties on our Controllers, so the easiest
way to allow for Autofixture-based testing of our Controllers is to just
omit setting all properties on them.

* Workaround for broken MemberAutoDataAttribute

https://github.com/AutoFixture/AutoFixture/pull/1164 shows that only
the first test case is pulled for this attribute.

This is a workaround that populates the provided parameters, left to
right, using AutoFixture to populate any remaining.

* WIP: Organization sponsorship flow

* Add Attribute to use the Bit Autodata dependency chain

BitAutoDataAttribute is used to mark a Theory as autopopulating
parameters.

Extract common attribute methods to to a helper class. Cannot
inherit a common base, since both require inheriting from different
Xunit base classes to work.

* WIP: scaffolding for families for enterprise sponsorship flow

* Fix broken tests

* Create sponsorship offer (#1688)

* Initial db work (#1687)

* Add organization sponsorship databases to all providers

* Generalize create and update for database, specialize in code

* Add PlanSponsorshipType to db model

* Write valid json for test entries

* Initial scaffolding of emails (#1686)

* Initial scaffolding of emails

* Work on adding models for FamilyForEnterprise emails

* Switch verbage

* Put preliminary copy in emails

* Skip test

* Families for enterprise/stripe integrations (#1699)

* Add PlanSponsorshipType to static store

* Add sponsorship type to token and creates sponsorship

* PascalCase properties

* Require sponsorship for remove

* Create subscription sponsorship helper class

* Handle Sponsored subscription changes

* Add sponsorship id to subscription metadata

* Make sponsoring references nullable

This state indicates that a sponsorship has lapsed, but was not able to
be reverted for billing reasons

* WIP: Validate and remove subscriptions

* Update sponsorships on organization and org user delete

* Add friendly name to organization sponsorship

* Add sponsorship available boolean to orgDetails

* Add sponsorship service to DI

* Use userId to find org users

* Send f4e offer email

* Simplify names of f4e mail messages

* Fix Stripe org default tax rates

* Universal sponsorship redeem api

* Populate user in current context

* Add product type to organization details

* Use upgrade path to change sponsorship

Sponsorships need to be annual to match the GB add-on charge rate

* Use organization and auth to find organization sponsorship

* Add resend sponsorship offer api endpoint

* Fix double email send

* Fix sponsorship upgrade options

* Add is sponsored item to subscription response

* Add sponsorship validation to upcoming invoice webhook

* Add sponsorship validation to upcoming invoice webhook

* Fix organization delete sponsorship hooks

* Test org sponsorship service

* Fix sproc

* Fix build error

* Update emails

* Fix tests

* Skip local test

* Add newline

* Fix stripe subscription update

* Finish emails

* Skip test

* Fix unit tests

* Remove unused variable

* Fix unit tests

* Switch to handlebars ifs

* Remove ending email

* Remove reconfirmation template

* Switch naming convention

* Switch naming convention

* Fix migration

* Update copy and links

* Switch to using Guid in the method

* Remove unneeded css styles

* Add sql files to Sql.sqlproj

* Removed old comments

* Made name more verbose

* Fix SQL error

* Move unit tests to service

* Fix sp

* Revert "Move unit tests to service"

This reverts commit 1185bf3ec8.

* Do repository validation in service layer

* Fix tests

* Fix merge conflicts and remove TODO

* Remove unneeded models

* Fix spacing and formatting

* Switch Org -> Organization

* Remove single use variables

* Switch method name

* Fix Controller

* Switch to obfuscating email

* Fix unit tests

Co-authored-by: Justin Baur <admin@justinbaur.com>
2021-11-19 17:25:06 -05:00
Oscar Hinton
be164967b3
Add usesKeyConnector to organizationUserUserDetailsResponseModel (#1726) 2021-11-19 15:04:23 +01:00
Thomas Rittson
cfd6123974
[Key Connector] Add event logging for first SSO login (#1724)
* Add null checks to fix logging from SSO controller

* Add FirstSsoLogin event logging
2021-11-19 07:42:35 +10:00
Oscar Hinton
6008715abc
Add check to ensure admins or owners arn't enrolled in key connector (#1725) 2021-11-18 21:56:13 +01:00
Thomas Rittson
2dc29e51d1
Fix bug preventing user from leaving org (#1721) 2021-11-18 21:15:22 +10:00
Thomas Rittson
9f96e4ce90
Disable EA Takeover if grantor uses Key Connector (#1718) 2021-11-18 07:47:43 +10:00
Micaiah Martin
faa8abb3dc
Updated SETUP.md to direct user with correct file name. (#1719) 2021-11-17 07:54:38 -07:00
Oscar Hinton
f866b25e43
Key Connector feature toggle (#1716) 2021-11-17 11:46:35 +01:00
Joseph Flinn
3a22f91ff5
Enable key connector selfhost (#1707)
* initial commit

* Add code for Key Connector feature

* Add help URL to config

* Fix folders for key-connector service

* Fix paths for key-connector

* fixing the env file builder when disabling the key connector

* swapping a variable name

Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-11-16 09:52:02 -08:00
Thomas Rittson
cdb622d4aa
Add ApiUseKeyConnector flag to token response (#1710) 2021-11-16 06:54:28 +10:00
Vince Grassia
c660f8bf00
Fix Docker Notary (#1717) 2021-11-15 13:53:53 -05:00
Vince Grassia
27351762de
Upload Docker images to AWS ECR Nonprod Repositories (#1713) 2021-11-15 13:23:51 -05:00
Thomas Rittson
e3143271d7
[Key Connector] Prevent user from leaving org (#1715)
* Block user from leaving org using Key Connector

* Add tests
2021-11-15 19:46:13 +10:00
Thomas Rittson
c2975b003d
[Key Connector] Fix policy checks and other pre-reqs (#1711)
* Require SSO Policy to enable Key Connector

* Require that SSO is enabled to use Key Connector

* Fix error messages

"Key Connector" instead of "KeyConnector"

* Refactor dependent policy checks to handle expansion

* Block disabling Sso Policy if using Key Connector

* Update tests for policies required by Key Connector

* Fix tests

* Add test for Key Connector to require Sso Policy

* Add test: Sso config must be enabled to use Key Connector
2021-11-15 19:25:10 +10:00
Oscar Hinton
f1c41257b3
Allow disabling key connector if no user is enrolled (#1712) 2021-11-12 14:38:31 +01:00
Addison Beck
6b629feb03
[bug] Drop unused db column UsesCryptoAgent (#1704) 2021-11-09 12:33:18 -05:00
Kyle Spearrin
77f9f5fe72
remove dynamic names from admin confirm dialogs (#1703) 2021-11-09 12:13:23 -05:00
Kyle Spearrin
327e784336
Added middleware for general security headers (#1700) 2021-11-09 11:37:14 -05:00
Kyle Spearrin
f26a235964
set MaxResponseContentBufferSize to 5 MB (#1702) 2021-11-09 11:32:23 -05:00
Kyle Spearrin
2f0638ce8c
sanitize notification hub tag inputs (#1697) 2021-11-09 11:25:18 -05:00
Kyle Spearrin
fcc1a4e10c
add missing csrf token validation to admin (#1696) 2021-11-09 11:22:08 -05:00
Kyle Spearrin
9582e94232
add ::ffff: to internal ip check (#1701)
* add ::ffff: to internal ip check

* check StartsWith
2021-11-09 11:16:54 -05:00
Oscar Hinton
fd37cb5a12
Add support for Key Connector OTP and account migration (#1663)
Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
2021-11-09 16:37:32 +01:00
Thomas Rittson
f6bc35b2d0
Fix typos in EF migrations (#1693)
* Fix typos in postgres migrations

* Fix extension of migration script
2021-11-09 07:40:01 +10:00
Kyle Spearrin
7cc7b84eaf
use fixed-time comparison of secrets (#1698) 2021-11-08 15:55:42 -05:00
Vince Grassia
c07794e907
Change Release workflow to allow releases from 'rc' and 'hotfix' branches (#1690) 2021-11-08 13:39:32 -05:00
Kyle Spearrin
5aa492e886
validate service url schema (#1695) 2021-11-08 11:47:03 -05:00
Oscar Hinton
1aa25f2712
Add checks for vault timeout policy (#1694) 2021-11-08 14:37:40 +01:00