1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 13:08:17 -05:00

Resolve Vault and DB Warnings (#4646)

* Resolve Vault Warnings

* Resolve DB Warnings
This commit is contained in:
Justin Baur 2024-08-27 19:05:34 -04:00 committed by GitHub
parent acb71d87d9
commit 13ad872f51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#nullable enable #nullable enable
using System.Diagnostics;
using Bit.Core.Context; using Bit.Core.Context;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Enums; using Bit.Core.Enums;
@ -98,6 +99,12 @@ public class BulkCollectionAuthorizationHandler : BulkAuthorizationHandler<BulkC
case not null when requirement == BulkCollectionOperations.Delete: case not null when requirement == BulkCollectionOperations.Delete:
authorized = await CanDeleteAsync(resources, org); authorized = await CanDeleteAsync(resources, org);
break; break;
case null:
// requirement isn't actually nullable but since we use the
// not null when trick it makes the compiler think that requirement
// could actually be nullable.
throw new UnreachableException();
} }
if (authorized) if (authorized)

View File

@ -1,6 +1,8 @@
using Bit.Api.Vault.Models.Response; using Bit.Api.Vault.Models.Response;
using Bit.Core.Models.Api; using Bit.Core.Models.Api;
#nullable enable
public class OptionalCipherDetailsResponseModel : ResponseModel public class OptionalCipherDetailsResponseModel : ResponseModel
{ {
public bool Unavailable { get; set; } public bool Unavailable { get; set; }

View File

@ -12,7 +12,9 @@ namespace Bit.SqliteMigrations.Migrations
{ {
[DbContext(typeof(DatabaseContext))] [DbContext(typeof(DatabaseContext))]
[Migration("20221212154007_initial")] [Migration("20221212154007_initial")]
#pragma warning disable CS8981 // We unfortunately can't rename migrations
partial class initial partial class initial
#pragma warning restore CS8981
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {

View File

@ -4,7 +4,9 @@
namespace Bit.SqliteMigrations.Migrations; namespace Bit.SqliteMigrations.Migrations;
#pragma warning disable CS8981 // We unfortunately can't rename migrations
public partial class initial : Migration public partial class initial : Migration
#pragma warning restore CS8981
{ {
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {