1
0
mirror of https://github.com/bitwarden/server synced 2026-03-02 19:31:24 +00:00

Merge branch 'master' into feature/billing-obfuscation

This commit is contained in:
Rui Tomé
2023-03-06 16:39:42 +00:00
committed by GitHub
226 changed files with 7937 additions and 514 deletions

View File

@@ -8,6 +8,7 @@ using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -4,6 +4,7 @@ using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -1,6 +1,6 @@
using Bit.Core;
using Bit.Core.Jobs;
using Bit.Core.Repositories;
using Bit.Core.Vault.Repositories;
using Microsoft.Extensions.Options;
using Quartz;

View File

@@ -6,6 +6,7 @@ using Bit.Core.Models.Business;
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
namespace Bit.Admin.Models;

View File

@@ -2,6 +2,7 @@
using Bit.Core.Entities.Provider;
using Bit.Core.Enums;
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
using Bit.Core.Vault.Entities;
namespace Bit.Admin.Models;

View File

@@ -3,6 +3,7 @@ using Bit.Core.Entities;
using Bit.Core.Models.Business;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
namespace Bit.Admin.Models;

View File

@@ -1,4 +1,5 @@
using Bit.Core.Entities;
using Bit.Core.Vault.Entities;
namespace Bit.Admin.Models;

View File

@@ -295,6 +295,58 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -3349,6 +3401,7 @@
"Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "[1.0.8, )",

View File

@@ -15,6 +15,8 @@ using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -1,6 +1,7 @@
using Bit.Api.Models.Request;
using Bit.Api.Models.Request.Organizations;
using Bit.Api.Models.Response;
using Bit.Api.Vault.Models.Response;
using Bit.Core.Entities;
using Bit.Core.Exceptions;
using Bit.Core.Repositories;

View File

@@ -4,6 +4,7 @@ using Bit.Core.Exceptions;
using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Vault.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -1,9 +1,11 @@
using Bit.Api.Models.Response;
using Bit.Api.Vault.Models.Response;
using Bit.Core.Context;
using Bit.Core.Entities;
using Bit.Core.Services;
using Bit.Core.Settings;
using Core.Models.Data;
using Bit.Core.Vault.Models.Data;
using Bit.Core.Vault.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -1,4 +1,6 @@
namespace Bit.Api.Models.Request.Accounts;
using Bit.Api.Vault.Models.Request;
namespace Bit.Api.Models.Request.Accounts;
public class ImportCiphersRequestModel
{

View File

@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using Bit.Api.Vault.Models.Request;
namespace Bit.Api.Models.Request.Accounts;

View File

@@ -1,4 +1,6 @@
namespace Bit.Api.Models.Request.Organizations;
using Bit.Api.Vault.Models.Request;
namespace Bit.Api.Models.Request.Organizations;
public class ImportOrganizationCiphersRequestModel
{

View File

@@ -1,9 +1,10 @@
using Bit.Core.Entities;
using Bit.Api.Vault.Models.Response;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Api;
using Bit.Core.Models.Data;
using Bit.Core.Settings;
using Core.Models.Data;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models.Response;

View File

@@ -1,4 +1,5 @@
using Bit.Core.Models.Api;
using Bit.Api.Vault.Models.Response;
using Bit.Core.Models.Api;
namespace Bit.Api.Models.Response;

View File

@@ -4,6 +4,7 @@ using Bit.Api.Models.Public.Response;
using Bit.Core.Context;
using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Vault.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -80,9 +80,10 @@ public class ProjectsController : Controller
}
[HttpGet("projects/{id}")]
public async Task<ProjectResponseModel> GetAsync([FromRoute] Guid id)
public async Task<ProjectPermissionDetailsResponseModel> GetAsync([FromRoute] Guid id)
{
var project = await _projectRepository.GetByIdAsync(id);
var userId = _userService.GetProperUserId(User).Value;
var project = await _projectRepository.GetPermissionDetailsByIdAsync(id, userId);
if (project == null)
{
throw new NotFoundException();
@@ -93,23 +94,34 @@ public class ProjectsController : Controller
throw new NotFoundException();
}
var userId = _userService.GetProperUserId(User).Value;
var orgAdmin = await _currentContext.OrganizationAdmin(project.OrganizationId);
var accessClient = AccessClientHelper.ToAccessClient(_currentContext.ClientType, orgAdmin);
var hasAccess = accessClient switch
bool hasAccess;
var read = project.Read;
var write = project.Write;
switch (accessClient)
{
AccessClientType.NoAccessCheck => true,
AccessClientType.User => await _projectRepository.UserHasReadAccessToProject(id, userId),
_ => false,
};
case AccessClientType.NoAccessCheck:
hasAccess = true;
write = true;
read = true;
break;
case AccessClientType.User:
hasAccess = project.Read;
break;
default:
hasAccess = false;
break;
}
if (!hasAccess)
{
throw new NotFoundException();
}
return new ProjectResponseModel(project);
return new ProjectPermissionDetailsResponseModel(project, read, write);
}
[HttpPost("projects/delete")]

View File

@@ -33,7 +33,7 @@ public class SecretsManagerPortingController : Controller
{
if (!await _currentContext.OrganizationAdmin(organizationId))
{
throw new UnauthorizedAccessException();
throw new NotFoundException();
}
var userId = _userService.GetProperUserId(User).Value;
@@ -53,7 +53,7 @@ public class SecretsManagerPortingController : Controller
{
if (!await _currentContext.OrganizationAdmin(organizationId))
{
throw new UnauthorizedAccessException();
throw new NotFoundException();
}
if (importRequest.Projects?.Count() > 1000 || importRequest.Secrets?.Count() > 6000)

View File

@@ -0,0 +1,22 @@
using Bit.Core.SecretsManager.Entities;
namespace Bit.Api.SecretsManager.Models.Response;
public class ProjectPermissionDetailsResponseModel : ProjectResponseModel
{
private const string _objectName = "projectPermissionDetails";
public ProjectPermissionDetailsResponseModel(Project project, bool read, bool write, string obj = _objectName) : base(project, obj)
{
Read = read;
Write = write;
}
public ProjectPermissionDetailsResponseModel()
{
}
public bool Read { get; set; }
public bool Write { get; set; }
}

View File

@@ -7,8 +7,8 @@ public class ProjectResponseModel : ResponseModel
{
private const string _objectName = "project";
public ProjectResponseModel(Project project)
: base(_objectName)
public ProjectResponseModel(Project project, string obj = _objectName)
: base(obj)
{
if (project == null)
{

View File

@@ -1,24 +1,27 @@
using System.Text.Json;
using Azure.Messaging.EventGrid;
using Bit.Api.Models.Request;
using Bit.Api.Models.Request.Accounts;
using Bit.Api.Models.Request.Organizations;
using Bit.Api.Models.Response;
using Bit.Api.Utilities;
using Bit.Api.Vault.Models.Request;
using Bit.Api.Vault.Models.Response;
using Bit.Core;
using Bit.Core.Context;
using Bit.Core.Entities;
using Bit.Core.Exceptions;
using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Core.Models.Data;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
using Bit.Core.Vault.Repositories;
using Bit.Core.Vault.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Controllers;
namespace Bit.Api.Vault.Controllers;
[Route("ciphers")]
[Authorize("Application")]

View File

@@ -1,12 +1,14 @@
using Bit.Api.Models.Request;
using Bit.Api.Models.Response;
using Bit.Api.Models.Response;
using Bit.Api.Vault.Models.Request;
using Bit.Api.Vault.Models.Response;
using Bit.Core.Exceptions;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Vault.Repositories;
using Bit.Core.Vault.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Controllers;
namespace Bit.Api.Vault.Controllers;
[Route("folders")]
[Authorize("Application")]

View File

@@ -1,4 +1,4 @@
using Bit.Api.Models.Response;
using Bit.Api.Vault.Models.Response;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Enums.Provider;
@@ -7,10 +7,11 @@ using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Vault.Repositories;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Controllers;
namespace Bit.Api.Vault.Controllers;
[Route("sync")]
[Authorize("Application")]

View File

@@ -1,7 +1,7 @@
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Bit.Core.Utilities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models;
namespace Bit.Api.Vault.Models;
public class CipherAttachmentModel
{

View File

@@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models;
namespace Bit.Api.Vault.Models;
public class CipherCardModel
{

View File

@@ -1,8 +1,8 @@
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Bit.Core.Utilities;
using Bit.Core.Vault.Enums;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models;
namespace Bit.Api.Vault.Models;
public class CipherFieldModel
{

View File

@@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models;
namespace Bit.Api.Vault.Models;
public class CipherIdentityModel
{

View File

@@ -1,8 +1,8 @@
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models;
namespace Bit.Api.Vault.Models;
public class CipherLoginModel
{

View File

@@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models;
namespace Bit.Api.Vault.Models;
public class CipherPasswordHistoryModel
{

View File

@@ -1,7 +1,7 @@
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Vault.Enums;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models;
namespace Bit.Api.Vault.Models;
public class CipherSecureNoteModel
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Api.Models.Request;
namespace Bit.Api.Vault.Models.Request;
public class AttachmentRequestModel
{

View File

@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace Bit.Api.Models.Request;
namespace Bit.Api.Vault.Models.Request;
public class CipherPartialRequestModel
{

View File

@@ -1,14 +1,13 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Core.Models.Data;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Enums;
using Bit.Core.Vault.Models.Data;
using NS = Newtonsoft.Json;
using NSL = Newtonsoft.Json.Linq;
namespace Bit.Api.Models.Request;
namespace Bit.Api.Vault.Models.Request;
public class CipherRequestModel
{

View File

@@ -1,8 +1,8 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Entities;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
namespace Bit.Api.Models.Request;
namespace Bit.Api.Vault.Models.Request;
public class FolderRequestModel
{

View File

@@ -1,11 +1,11 @@
using System.Text.Json.Serialization;
using Bit.Core.Entities;
using Bit.Core.Models.Api;
using Bit.Core.Models.Data;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models.Response;
namespace Bit.Api.Vault.Models.Response;
public class AttachmentResponseModel : ResponseModel
{

View File

@@ -1,7 +1,7 @@
using Bit.Core.Enums;
using Bit.Core.Models.Api;
namespace Bit.Api.Models.Response;
namespace Bit.Api.Vault.Models.Response;
public class AttachmentUploadDataResponseModel : ResponseModel
{

View File

@@ -1,12 +1,12 @@
using System.Text.Json;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Api;
using Bit.Core.Models.Data;
using Bit.Core.Settings;
using Core.Models.Data;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Enums;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models.Response;
namespace Bit.Api.Vault.Models.Response;
public class CipherMiniResponseModel : ResponseModel
{

View File

@@ -1,7 +1,7 @@
using Bit.Core.Entities;
using Bit.Core.Models.Api;
using Bit.Core.Models.Api;
using Bit.Core.Vault.Entities;
namespace Bit.Api.Models.Response;
namespace Bit.Api.Vault.Models.Response;
public class FolderResponseModel : ResponseModel
{

View File

@@ -1,11 +1,13 @@
using Bit.Core.Entities;
using Bit.Api.Models.Response;
using Bit.Core.Entities;
using Bit.Core.Models.Api;
using Bit.Core.Models.Data;
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
using Bit.Core.Settings;
using Core.Models.Data;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Api.Models.Response;
namespace Bit.Api.Vault.Models.Response;
public class SyncResponseModel : ResponseModel
{

View File

@@ -259,6 +259,58 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -2783,15 +2835,15 @@
"commercial.core": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )"
"Core": "[2023.2.0, )"
}
},
"commercial.infrastructure.entityframework": {
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2023.1.0, )",
"Infrastructure.EntityFramework": "[2023.1.0, )"
"Core": "[2023.2.0, )",
"Infrastructure.EntityFramework": "[2023.2.0, )"
}
},
"core": {
@@ -2811,6 +2863,7 @@
"Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
@@ -2838,7 +2891,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Dapper": "[2.0.123, )"
}
},
@@ -2846,7 +2899,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.12, )",
@@ -2858,9 +2911,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Infrastructure.Dapper": "[2023.1.0, )",
"Infrastructure.EntityFramework": "[2023.1.0, )"
"Core": "[2023.2.0, )",
"Infrastructure.Dapper": "[2023.2.0, )",
"Infrastructure.EntityFramework": "[2023.2.0, )"
}
}
}

View File

@@ -256,6 +256,58 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -3262,6 +3314,7 @@
"Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
@@ -3289,7 +3342,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Dapper": "[2.0.123, )"
}
},
@@ -3297,7 +3350,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.12, )",
@@ -3309,9 +3362,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Infrastructure.Dapper": "[2023.1.0, )",
"Infrastructure.EntityFramework": "[2023.1.0, )"
"Core": "[2023.2.0, )",
"Infrastructure.Dapper": "[2023.2.0, )",
"Infrastructure.EntityFramework": "[2023.2.0, )"
}
}
}

View File

@@ -56,6 +56,7 @@
<PackageReference Include="Otp.NET" Version="1.2.2" />
<PackageReference Include="YubicoDotNetClient" Version="1.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.6" />
<PackageReference Include="LaunchDarkly.ServerSdk" Version="7.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,6 +1,7 @@
using Bit.Core.Utilities;
using Bit.Core.Entities;
using Bit.Core.Utilities;
namespace Bit.Core.Entities;
namespace Bit.Core.Vault.Entities;
public class Folder : ITableObject<Guid>
{

View File

@@ -1,5 +1,5 @@
using Bit.Core.Entities;
using Core.Models.Data;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Models.Data;

View File

@@ -1,5 +1,5 @@
using Bit.Core.Entities;
using Bit.Core.Models.Data;
using Bit.Core.Models.Data;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Repositories;

View File

@@ -1,7 +1,7 @@
using Bit.Core.Entities;
using Bit.Core.Models.Data;
using Bit.Core.Models.Data;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
using Microsoft.Azure.Cosmos.Table;
namespace Bit.Core.Repositories.TableStorage;

View File

@@ -0,0 +1,9 @@
using Bit.Core.SecretsManager.Entities;
namespace Bit.Core.SecretsManager.Models.Data;
public class ProjectPermissionDetails : Project
{
public bool Read { get; set; }
public bool Write { get; set; }
}

View File

@@ -1,5 +1,6 @@
using Bit.Core.Enums;
using Bit.Core.SecretsManager.Entities;
using Bit.Core.SecretsManager.Models.Data;
namespace Bit.Core.SecretsManager.Repositories;
@@ -8,6 +9,7 @@ public interface IProjectRepository
Task<IEnumerable<Project>> GetManyByOrganizationIdAsync(Guid organizationId, Guid userId, AccessClientType accessType);
Task<IEnumerable<Project>> GetManyByOrganizationIdWriteAccessAsync(Guid organizationId, Guid userId, AccessClientType accessType);
Task<IEnumerable<Project>> GetManyByIds(IEnumerable<Guid> ids);
Task<ProjectPermissionDetails> GetPermissionDetailsByIdAsync(Guid id, Guid userId);
Task<Project> GetByIdAsync(Guid id);
Task<Project> CreateAsync(Project project);
Task ReplaceAsync(Project project);

View File

@@ -1,6 +1,7 @@
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Enums;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Services;

View File

@@ -1,6 +1,7 @@
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Services;

View File

@@ -2,6 +2,7 @@
using Bit.Core.Entities.Provider;
using Bit.Core.Enums;
using Bit.Core.SecretsManager.Entities;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Services;

View File

@@ -0,0 +1,6 @@
namespace Bit.Core.Services;
public interface IFeatureService
{
bool IsOnline();
}

View File

@@ -1,5 +1,6 @@
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Services;

View File

@@ -3,6 +3,7 @@ using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Models.Business;
using Bit.Core.Vault.Entities;
using Fido2NetLib;
using Microsoft.AspNetCore.Identity;

View File

@@ -6,6 +6,7 @@ using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
using Microsoft.AspNetCore.Http;
namespace Bit.Core.Services;

View File

@@ -7,6 +7,9 @@ using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Bit.Core.Tokens;
using Bit.Core.Vault.Models.Data;
using Bit.Core.Vault.Repositories;
using Bit.Core.Vault.Services;
using Microsoft.AspNetCore.Identity;
namespace Bit.Core.Services;

View File

@@ -7,6 +7,7 @@ using Bit.Core.Models.Data.Organizations;
using Bit.Core.Repositories;
using Bit.Core.SecretsManager.Entities;
using Bit.Core.Settings;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Services;

View File

@@ -0,0 +1,54 @@
using Bit.Core.Settings;
using LaunchDarkly.Sdk.Server;
using LaunchDarkly.Sdk.Server.Integrations;
namespace Bit.Core.Services;
public class LaunchDarklyFeatureService : IFeatureService, IDisposable
{
private readonly LdClient _client;
public LaunchDarklyFeatureService(
IGlobalSettings globalSettings)
{
var ldConfig = Configuration.Builder(globalSettings.LaunchDarkly?.SdkKey);
if (string.IsNullOrEmpty(globalSettings.LaunchDarkly?.SdkKey))
{
// support a file to load flag values
if (File.Exists(globalSettings.LaunchDarkly?.FlagDataFilePath))
{
ldConfig.DataSource(
FileData.DataSource()
.FilePaths(globalSettings.LaunchDarkly?.FlagDataFilePath)
.AutoUpdate(true)
);
// do not provide analytics events
ldConfig.Events(Components.NoEvents);
}
else
{
// when a file-based fallback isn't available, work offline
ldConfig.Offline(true);
}
}
else if (globalSettings.SelfHosted)
{
// when self-hosted, work offline
ldConfig.Offline(true);
}
_client = new LdClient(ldConfig.Build());
}
public bool IsOnline()
{
return _client.Initialized && !_client.IsOffline();
}
public void Dispose()
{
_client?.Dispose();
}
}

View File

@@ -3,6 +3,7 @@ using Bit.Core.Enums;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;

View File

@@ -7,6 +7,7 @@ using Bit.Core.Models;
using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Bit.Core.Vault.Entities;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.NotificationHubs;
using Microsoft.Extensions.Logging;

View File

@@ -3,6 +3,7 @@ using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Settings;
using Bit.Core.Vault.Entities;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;

View File

@@ -6,6 +6,7 @@ using Bit.Core.Models;
using Bit.Core.Models.Api;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Bit.Core.Vault.Entities;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;

View File

@@ -9,6 +9,8 @@ using Bit.Core.Models.Business;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Repositories;
using Fido2NetLib;
using Fido2NetLib.Objects;
using Microsoft.AspNetCore.DataProtection;

View File

@@ -2,6 +2,7 @@
using Bit.Core.Entities.Provider;
using Bit.Core.Enums;
using Bit.Core.SecretsManager.Entities;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Services;

View File

@@ -1,5 +1,6 @@
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Services;

View File

@@ -77,6 +77,7 @@ public class GlobalSettings : IGlobalSettings
new DistributedIpRateLimitingSettings();
public virtual IPasswordlessAuthSettings PasswordlessAuth { get; set; } = new PasswordlessAuthSettings();
public virtual IDomainVerificationSettings DomainVerification { get; set; } = new DomainVerificationSettings();
public virtual ILaunchDarklySettings LaunchDarkly { get; set; } = new LaunchDarklySettings();
public string BuildExternalUri(string explicitValue, string name)
{
@@ -538,4 +539,10 @@ public class GlobalSettings : IGlobalSettings
public int VerificationInterval { get; set; } = 12;
public int ExpirationPeriod { get; set; } = 7;
}
public class LaunchDarklySettings : ILaunchDarklySettings
{
public string SdkKey { get; set; }
public string FlagDataFilePath { get; set; } = "flags.json";
}
}

View File

@@ -17,4 +17,5 @@ public interface IGlobalSettings
ILogLevelSettings MinLogLevel { get; set; }
IPasswordlessAuthSettings PasswordlessAuth { get; set; }
IDomainVerificationSettings DomainVerification { get; set; }
ILaunchDarklySettings LaunchDarkly { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Bit.Core.Settings;
public interface ILaunchDarklySettings
{
public string SdkKey { get; set; }
public string FlagDataFilePath { get; set; }
}

View File

@@ -1,8 +1,9 @@
using System.Text.Json;
using Bit.Core.Models.Data;
using Bit.Core.Entities;
using Bit.Core.Utilities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Entities;
namespace Bit.Core.Vault.Entities;
public class Cipher : ITableObject<Guid>, ICloneable
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Enums;
namespace Bit.Core.Vault.Enums;
public enum CipherRepromptType : byte
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Enums;
namespace Bit.Core.Vault.Enums;
public enum CipherStateAction
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Enums;
namespace Bit.Core.Vault.Enums;
public enum CipherType : byte
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Enums;
namespace Bit.Core.Vault.Enums;
public enum FieldType : byte
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Enums;
namespace Bit.Core.Vault.Enums;
public enum SecureNoteType : byte
{

View File

@@ -1,6 +1,6 @@
using Bit.Core.Entities;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class AttachmentResponseData
{

View File

@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherAttachment
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherCardData : CipherData
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public abstract class CipherData
{

View File

@@ -1,4 +1,4 @@
namespace Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherDetails : CipherOrganizationDetails
{

View File

@@ -1,6 +1,6 @@
using Bit.Core.Enums;
using Bit.Core.Vault.Enums;
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherFieldData
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherIdentityData : CipherData
{

View File

@@ -1,6 +1,6 @@
using Bit.Core.Enums;
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherLoginData : CipherData
{

View File

@@ -1,6 +1,6 @@
using Bit.Core.Entities;
using Bit.Core.Vault.Entities;
namespace Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherOrganizationDetails : Cipher
{

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherPasswordHistoryData
{

View File

@@ -1,6 +1,6 @@
using Bit.Core.Enums;
using Bit.Core.Vault.Enums;
namespace Bit.Core.Models.Data;
namespace Bit.Core.Vault.Models.Data;
public class CipherSecureNoteData : CipherData
{

View File

@@ -1,8 +1,9 @@
using Bit.Core.Entities;
using Bit.Core.Models.Data;
using Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Repositories;
namespace Bit.Core.Vault.Repositories;
public interface ICipherRepository : IRepository<Cipher, Guid>
{

View File

@@ -1,6 +1,7 @@
using Bit.Core.Entities;
using Bit.Core.Repositories;
using Bit.Core.Vault.Entities;
namespace Bit.Core.Repositories;
namespace Bit.Core.Vault.Repositories;
public interface IFolderRepository : IRepository<Folder, Guid>
{

View File

@@ -1,8 +1,8 @@
using Bit.Core.Entities;
using Bit.Core.Models.Data;
using Core.Models.Data;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Services;
namespace Bit.Core.Vault.Services;
public interface ICipherService
{

View File

@@ -1,13 +1,14 @@
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;
using Azure.Storage.Sas;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
using Microsoft.Extensions.Logging;
namespace Bit.Core.Services;
namespace Bit.Core.Vault.Services;
public class AzureAttachmentStorageService : IAttachmentStorageService
{

View File

@@ -4,13 +4,15 @@ using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Exceptions;
using Bit.Core.Models.Business;
using Bit.Core.Models.Data;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Utilities;
using Core.Models.Data;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
using Bit.Core.Vault.Repositories;
namespace Bit.Core.Services;
namespace Bit.Core.Vault.Services;
public class CipherService : ICipherService
{
@@ -90,7 +92,7 @@ public class CipherService : ICipherService
{
await _cipherRepository.CreateAsync(cipher);
}
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Created);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_Created);
// push
await _pushService.PushSyncCipherCreateAsync(cipher, null);
@@ -100,7 +102,7 @@ public class CipherService : ICipherService
ValidateCipherLastKnownRevisionDateAsync(cipher, lastKnownRevisionDate);
cipher.RevisionDate = DateTime.UtcNow;
await _cipherRepository.ReplaceAsync(cipher);
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Updated);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_Updated);
// push
await _pushService.PushSyncCipherUpdateAsync(cipher, collectionIds);
@@ -138,7 +140,7 @@ public class CipherService : ICipherService
}
await _cipherRepository.CreateAsync(cipher);
}
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Created);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_Created);
if (cipher.OrganizationId.HasValue)
{
@@ -154,7 +156,7 @@ public class CipherService : ICipherService
ValidateCipherLastKnownRevisionDateAsync(cipher, lastKnownRevisionDate);
cipher.RevisionDate = DateTime.UtcNow;
await _cipherRepository.ReplaceAsync(cipher);
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Updated);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_Updated);
// push
await _pushService.PushSyncCipherUpdateAsync(cipher, collectionIds);
@@ -236,7 +238,7 @@ public class CipherService : ICipherService
};
await _cipherRepository.UpdateAttachmentAsync(attachment);
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_AttachmentCreated);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_AttachmentCreated);
cipher.AddAttachment(attachmentId, data);
if (!await ValidateCipherAttachmentFile(cipher, data))
@@ -436,7 +438,7 @@ public class CipherService : ICipherService
throw new NotFoundException();
}
await _cipherRepository.DeleteByOrganizationIdAsync(organizationId);
await _eventService.LogOrganizationEventAsync(org, Enums.EventType.Organization_PurgedVault);
await _eventService.LogOrganizationEventAsync(org, Bit.Core.Enums.EventType.Organization_PurgedVault);
}
public async Task MoveManyAsync(IEnumerable<Guid> cipherIds, Guid? destinationFolderId, Guid movingUserId)
@@ -505,7 +507,7 @@ public class CipherService : ICipherService
}
updatedCipher = true;
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Shared);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_Shared);
if (hasOldAttachments)
{
@@ -614,7 +616,7 @@ public class CipherService : ICipherService
await _collectionCipherRepository.UpdateCollectionsAsync(cipher.Id, savingUserId, collectionIds);
}
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_UpdatedCollections);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_UpdatedCollections);
// push
await _pushService.PushSyncCipherUpdateAsync(cipher, collectionIds);
@@ -913,7 +915,7 @@ public class CipherService : ICipherService
await _cipherRepository.DeleteAttachmentAsync(cipher.Id, attachmentData.AttachmentId);
cipher.DeleteAttachment(attachmentData.AttachmentId);
await _attachmentStorageService.DeleteAttachmentAsync(cipher.Id, attachmentData);
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_AttachmentDeleted);
await _eventService.LogCipherEventAsync(cipher, Bit.Core.Enums.EventType.Cipher_AttachmentDeleted);
// push
await _pushService.PushSyncCipherUpdateAsync(cipher, null);

View File

@@ -1,9 +1,10 @@
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Enums;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Services;
namespace Bit.Core.Vault.Services;
public class LocalAttachmentStorageService : IAttachmentStorageService
{

View File

@@ -1,8 +1,9 @@
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Enums;
using Bit.Core.Services;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Models.Data;
namespace Bit.Core.Services;
namespace Bit.Core.Vault.Services;
public class NoopAttachmentStorageService : IAttachmentStorageService
{

View File

@@ -144,6 +144,20 @@
"Microsoft.AspNetCore.Authentication.JwtBearer": "3.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Direct",
"requested": "[7.0.0, )",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"MailKit": {
"type": "Direct",
"requested": "[3.2.0, )",
@@ -476,6 +490,45 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -1310,8 +1363,8 @@
},
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "1.7.0",
"contentHash": "RVSM6wZUo6L2y6P3vN6gjUtyJ2IF2RVtrepF3J7nrDKfFQd5u/SnSUFclchYQis8/k5scHy9E+fVeKVQLnnkzw=="
"resolved": "1.7.1",
"contentHash": "B43Zsz5EfMwyEbnObwRxW5u85fzJma3lrDeGcSAV1qkhSRTNY5uXAByTn9h9ddNdhM+4/YoLc/CI43umjwIl9Q=="
},
"System.Collections.NonGeneric": {
"type": "Transitive",

View File

@@ -1,8 +1,9 @@
using Bit.Core.Context;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Vault.Entities;
using Bit.Core.Vault.Repositories;
using Bit.Events.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

View File

@@ -236,6 +236,58 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -2743,6 +2795,7 @@
"Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
@@ -2770,7 +2823,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Dapper": "[2.0.123, )"
}
},
@@ -2778,7 +2831,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.12, )",
@@ -2790,9 +2843,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Infrastructure.Dapper": "[2023.1.0, )",
"Infrastructure.EntityFramework": "[2023.1.0, )"
"Core": "[2023.2.0, )",
"Infrastructure.Dapper": "[2023.2.0, )",
"Infrastructure.EntityFramework": "[2023.2.0, )"
}
}
}

View File

@@ -236,6 +236,58 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -2743,6 +2795,7 @@
"Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
@@ -2770,7 +2823,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Dapper": "[2.0.123, )"
}
},
@@ -2778,7 +2831,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.12, )",
@@ -2790,9 +2843,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Infrastructure.Dapper": "[2023.1.0, )",
"Infrastructure.EntityFramework": "[2023.1.0, )"
"Core": "[2023.2.0, )",
"Infrastructure.Dapper": "[2023.2.0, )",
"Infrastructure.EntityFramework": "[2023.2.0, )"
}
}
}

View File

@@ -246,6 +246,58 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -2753,6 +2805,7 @@
"Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
@@ -2780,7 +2833,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Dapper": "[2.0.123, )"
}
},
@@ -2788,7 +2841,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.12, )",
@@ -2800,9 +2853,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Infrastructure.Dapper": "[2023.1.0, )",
"Infrastructure.EntityFramework": "[2023.1.0, )"
"Core": "[2023.2.0, )",
"Infrastructure.Dapper": "[2023.2.0, )",
"Infrastructure.EntityFramework": "[2023.2.0, )"
}
}
}

View File

@@ -245,6 +245,58 @@
"IdentityModel": "4.4.0"
}
},
"LaunchDarkly.Cache": {
"type": "Transitive",
"resolved": "1.0.2",
"contentHash": "0bEnUVFVeW1TTDXb/bW6kS3FLQTLeGtw7Xh8yt6WNO56utVmtgcrMLvcnF6yeTn+N4FXrKfW09KkLNmK8YYQvw=="
},
"LaunchDarkly.CommonSdk": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "YYYq+41gZRMQ8dIoMC6HOq/dI+4RY3HsexLLAaE9T1+1tVMeQkbCqak7sVeKX4QcE7xlXx23lWgipYUkRoRUyw==",
"dependencies": {
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.EventSource": {
"type": "Transitive",
"resolved": "5.0.1",
"contentHash": "DN44Ry5M4lyrjiF7LEu0Ijco7Wm8R7mJopN+giYsYjkQlszsXdFvm3POoehIDAOtL1HHl5bZvF9k9xK034u3IA==",
"dependencies": {
"LaunchDarkly.Logging": "[1.0.1, 3.0.0)"
}
},
"LaunchDarkly.InternalSdk": {
"type": "Transitive",
"resolved": "3.1.0",
"contentHash": "jW8VEfFciuCcJUEuvSzmrbMVYYXwGL/ZWHUZLiA4aDOQ1LcEXp32uK405NQW/izEypUfWB+9TaSjPpFIC+5Wzw==",
"dependencies": {
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.Logging": "[2.0.0, 3.0.0)",
"System.Collections.Immutable": "1.7.1"
}
},
"LaunchDarkly.Logging": {
"type": "Transitive",
"resolved": "2.0.0",
"contentHash": "lsLKNqAZ7HIlkdTIrf4FetfRA1SUDE3WlaZQn79aSVkLjYWEhUhkDDK7hORGh4JoA3V2gXN+cIvJQax2uR/ijA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0"
}
},
"LaunchDarkly.ServerSdk": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "gkTWb+f5QlsXIqFAciBef3qKZU2y0Hy3Fpt4pvZoxNcnBKg2PNTDSnbpbYEKPeQ1yk1avNaI/tKprnahfrmJFg==",
"dependencies": {
"LaunchDarkly.Cache": "1.0.2",
"LaunchDarkly.CommonSdk": "6.0.0",
"LaunchDarkly.EventSource": "5.0.1",
"LaunchDarkly.InternalSdk": "3.1.0",
"LaunchDarkly.Logging": "2.0.0",
"System.Collections.Immutable": "1.7.1"
}
},
"libsodium": {
"type": "Transitive",
"resolved": "1.0.18.2",
@@ -2765,6 +2817,7 @@
"Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
@@ -2792,7 +2845,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Dapper": "[2.0.123, )"
}
},
@@ -2800,7 +2853,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[11.0.0, )",
"Core": "[2023.1.0, )",
"Core": "[2023.2.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[6.0.12, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[6.0.12, )",
@@ -2812,9 +2865,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "[2023.1.0, )",
"Infrastructure.Dapper": "[2023.1.0, )",
"Infrastructure.EntityFramework": "[2023.1.0, )"
"Core": "[2023.2.0, )",
"Infrastructure.Dapper": "[2023.2.0, )",
"Infrastructure.EntityFramework": "[2023.2.0, )"
}
}
}

Some files were not shown because too many files have changed in this diff Show More