mirror of
https://github.com/bitwarden/server.git
synced 2024-12-21 16:47:35 +01:00
Run formatting (#2230)
This commit is contained in:
parent
9b7aef0763
commit
7f5f010e1e
@ -13,10 +13,10 @@ using Bit.Core.Settings;
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
|
||||
namespace Bit.Commercial.Core.Services
|
||||
namespace Bit.Commercial.Core.Services;
|
||||
|
||||
public class ProviderService : IProviderService
|
||||
{
|
||||
public class ProviderService : IProviderService
|
||||
{
|
||||
public static PlanType[] ProviderDisllowedOrganizationTypes = new[] { PlanType.Free, PlanType.FamiliesAnnually, PlanType.FamiliesAnnually2019 };
|
||||
|
||||
private readonly IDataProtector _dataProtector;
|
||||
@ -505,5 +505,4 @@ namespace Bit.Commercial.Core.Services
|
||||
throw new BadRequestException($"Providers cannot manage organizations with the requested plan type ({requestedType}). Only Teams and Enterprise accounts are allowed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,12 @@
|
||||
using Bit.Core.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Bit.Commercial.Core.Utilities
|
||||
namespace Bit.Commercial.Core.Utilities;
|
||||
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
public static void AddCommCoreServices(this IServiceCollection services)
|
||||
{
|
||||
services.AddScoped<IProviderService, ProviderService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using Bit.Core.Models.OrganizationConnectionConfigs;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Settings;
|
||||
|
||||
namespace Bit.Scim.Context
|
||||
namespace Bit.Scim.Context;
|
||||
|
||||
public interface IScimContext
|
||||
{
|
||||
public interface IScimContext
|
||||
{
|
||||
ScimProviderType RequestScimProvider { get; set; }
|
||||
ScimConfig ScimConfiguration { get; set; }
|
||||
Guid? OrganizationId { get; set; }
|
||||
@ -17,5 +17,4 @@ namespace Bit.Scim.Context
|
||||
GlobalSettings globalSettings,
|
||||
IOrganizationRepository organizationRepository,
|
||||
IOrganizationConnectionRepository organizationConnectionRepository);
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using Bit.Core.Models.OrganizationConnectionConfigs;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Settings;
|
||||
|
||||
namespace Bit.Scim.Context
|
||||
namespace Bit.Scim.Context;
|
||||
|
||||
public class ScimContext : IScimContext
|
||||
{
|
||||
public class ScimContext : IScimContext
|
||||
{
|
||||
private bool _builtHttpContext;
|
||||
|
||||
public ScimProviderType RequestScimProvider { get; set; } = ScimProviderType.Default;
|
||||
@ -60,5 +60,4 @@ namespace Bit.Scim.Context
|
||||
RequestScimProvider = ScimProviderType.AzureAd;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,11 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Scim.Controllers
|
||||
namespace Bit.Scim.Controllers;
|
||||
|
||||
[AllowAnonymous]
|
||||
public class InfoController : Controller
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class InfoController : Controller
|
||||
{
|
||||
[HttpGet("~/alive")]
|
||||
[HttpGet("~/now")]
|
||||
public DateTime GetAlive()
|
||||
@ -19,5 +19,4 @@ namespace Bit.Scim.Controllers
|
||||
{
|
||||
return Json(CoreHelpers.GetVersion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Scim.Controllers.v2
|
||||
namespace Bit.Scim.Controllers.v2;
|
||||
|
||||
[Authorize("Scim")]
|
||||
[Route("v2/{organizationId}/groups")]
|
||||
public class GroupsController : Controller
|
||||
{
|
||||
[Authorize("Scim")]
|
||||
[Route("v2/{organizationId}/groups")]
|
||||
public class GroupsController : Controller
|
||||
{
|
||||
private readonly ScimSettings _scimSettings;
|
||||
private readonly IGroupRepository _groupRepository;
|
||||
private readonly IGroupService _groupService;
|
||||
@ -324,5 +324,4 @@ namespace Bit.Scim.Controllers.v2
|
||||
|
||||
await _groupRepository.UpdateUsersAsync(group.Id, memberIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,12 +9,12 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Scim.Controllers.v2
|
||||
namespace Bit.Scim.Controllers.v2;
|
||||
|
||||
[Authorize("Scim")]
|
||||
[Route("v2/{organizationId}/users")]
|
||||
public class UsersController : Controller
|
||||
{
|
||||
[Authorize("Scim")]
|
||||
[Route("v2/{organizationId}/users")]
|
||||
public class UsersController : Controller
|
||||
{
|
||||
private readonly IUserService _userService;
|
||||
private readonly IUserRepository _userRepository;
|
||||
private readonly IOrganizationUserRepository _organizationUserRepository;
|
||||
@ -291,5 +291,4 @@ namespace Bit.Scim.Controllers.v2
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Bit.Scim.Utilities;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public abstract class BaseScimGroupModel : BaseScimModel
|
||||
{
|
||||
public abstract class BaseScimGroupModel : BaseScimModel
|
||||
{
|
||||
public BaseScimGroupModel(bool initSchema = false)
|
||||
{
|
||||
if (initSchema)
|
||||
@ -14,5 +14,4 @@ namespace Bit.Scim.Models
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
public string ExternalId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public abstract class BaseScimModel
|
||||
{
|
||||
public abstract class BaseScimModel
|
||||
{
|
||||
public BaseScimModel()
|
||||
{ }
|
||||
|
||||
@ -11,5 +11,4 @@
|
||||
}
|
||||
|
||||
public List<string> Schemas { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Bit.Scim.Utilities;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public abstract class BaseScimUserModel : BaseScimModel
|
||||
{
|
||||
public abstract class BaseScimUserModel : BaseScimModel
|
||||
{
|
||||
public BaseScimUserModel(bool initSchema = false)
|
||||
{
|
||||
if (initSchema)
|
||||
@ -52,5 +52,4 @@ namespace Bit.Scim.Models
|
||||
public string Value { get; set; }
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
using Bit.Scim.Utilities;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimErrorResponseModel : BaseScimModel
|
||||
{
|
||||
public class ScimErrorResponseModel : BaseScimModel
|
||||
{
|
||||
public ScimErrorResponseModel()
|
||||
: base(ScimConstants.Scim2SchemaError)
|
||||
{ }
|
||||
|
||||
public string Detail { get; set; }
|
||||
public int Status { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimGroupRequestModel : BaseScimGroupModel
|
||||
{
|
||||
public class ScimGroupRequestModel : BaseScimGroupModel
|
||||
{
|
||||
public ScimGroupRequestModel()
|
||||
: base(false)
|
||||
{ }
|
||||
@ -27,5 +27,4 @@ namespace Bit.Scim.Models
|
||||
public string Value { get; set; }
|
||||
public string Display { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimGroupResponseModel : BaseScimGroupModel
|
||||
{
|
||||
public class ScimGroupResponseModel : BaseScimGroupModel
|
||||
{
|
||||
public ScimGroupResponseModel()
|
||||
: base(true)
|
||||
{
|
||||
@ -22,5 +22,4 @@ namespace Bit.Scim.Models
|
||||
|
||||
public string Id { get; set; }
|
||||
public ScimMetaModel Meta { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Bit.Scim.Utilities;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimListResponseModel<T> : BaseScimModel
|
||||
{
|
||||
public class ScimListResponseModel<T> : BaseScimModel
|
||||
{
|
||||
public ScimListResponseModel()
|
||||
: base(ScimConstants.Scim2SchemaListResponse)
|
||||
{ }
|
||||
@ -12,5 +12,4 @@ namespace Bit.Scim.Models
|
||||
public int StartIndex { get; set; }
|
||||
public int ItemsPerPage { get; set; }
|
||||
public List<T> Resources { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimMetaModel
|
||||
{
|
||||
public class ScimMetaModel
|
||||
{
|
||||
public ScimMetaModel(string resourceType)
|
||||
{
|
||||
ResourceType = resourceType;
|
||||
@ -10,5 +10,4 @@
|
||||
public string ResourceType { get; set; }
|
||||
public DateTime? Created { get; set; }
|
||||
public DateTime? LastModified { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimPatchModel : BaseScimModel
|
||||
{
|
||||
public class ScimPatchModel : BaseScimModel
|
||||
{
|
||||
public ScimPatchModel()
|
||||
: base() { }
|
||||
|
||||
@ -15,5 +15,4 @@ namespace Bit.Scim.Models
|
||||
public string Path { get; set; }
|
||||
public JsonElement Value { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimUserRequestModel : BaseScimUserModel
|
||||
{
|
||||
public class ScimUserRequestModel : BaseScimUserModel
|
||||
{
|
||||
public ScimUserRequestModel()
|
||||
: base(false)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
namespace Bit.Scim.Models
|
||||
namespace Bit.Scim.Models;
|
||||
|
||||
public class ScimUserResponseModel : BaseScimUserModel
|
||||
{
|
||||
public class ScimUserResponseModel : BaseScimUserModel
|
||||
{
|
||||
public ScimUserResponseModel()
|
||||
: base(true)
|
||||
{
|
||||
@ -25,5 +25,4 @@ namespace Bit.Scim.Models
|
||||
|
||||
public string Id { get; set; }
|
||||
public ScimMetaModel Meta { get; private set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Bit.Core.Utilities;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Bit.Scim
|
||||
namespace Bit.Scim;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Host
|
||||
@ -30,5 +30,4 @@ namespace Bit.Scim
|
||||
.Build()
|
||||
.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
namespace Bit.Scim
|
||||
namespace Bit.Scim;
|
||||
|
||||
public class ScimSettings
|
||||
{
|
||||
public class ScimSettings
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ using IdentityModel;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Stripe;
|
||||
|
||||
namespace Bit.Scim
|
||||
namespace Bit.Scim;
|
||||
|
||||
public class Startup
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IWebHostEnvironment env, IConfiguration configuration)
|
||||
{
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
|
||||
@ -112,5 +112,4 @@ namespace Bit.Scim
|
||||
// Add MVC to the request pipeline.
|
||||
app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Scim.Utilities
|
||||
namespace Bit.Scim.Utilities;
|
||||
|
||||
public class ApiKeyAuthenticationHandler : AuthenticationHandler<ApiKeyAuthenticationOptions>
|
||||
{
|
||||
public class ApiKeyAuthenticationHandler : AuthenticationHandler<ApiKeyAuthenticationOptions>
|
||||
{
|
||||
private readonly IOrganizationRepository _organizationRepository;
|
||||
private readonly IOrganizationApiKeyRepository _organizationApiKeyRepository;
|
||||
private readonly IScimContext _scimContext;
|
||||
@ -86,5 +86,4 @@ namespace Bit.Scim.Utilities
|
||||
|
||||
return AuthenticateResult.Success(ticket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
|
||||
namespace Bit.Scim.Utilities
|
||||
namespace Bit.Scim.Utilities;
|
||||
|
||||
public class ApiKeyAuthenticationOptions : AuthenticationSchemeOptions
|
||||
{
|
||||
public class ApiKeyAuthenticationOptions : AuthenticationSchemeOptions
|
||||
{
|
||||
public const string DefaultScheme = "ScimApiKey";
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
namespace Bit.Scim.Utilities
|
||||
namespace Bit.Scim.Utilities;
|
||||
|
||||
public static class ScimConstants
|
||||
{
|
||||
public static class ScimConstants
|
||||
{
|
||||
public const string Scim2SchemaListResponse = "urn:ietf:params:scim:api:messages:2.0:ListResponse";
|
||||
public const string Scim2SchemaError = "urn:ietf:params:scim:api:messages:2.0:Error";
|
||||
public const string Scim2SchemaUser = "urn:ietf:params:scim:schemas:core:2.0:User";
|
||||
public const string Scim2SchemaGroup = "urn:ietf:params:scim:schemas:core:2.0:Group";
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Scim.Context;
|
||||
|
||||
namespace Bit.Scim.Utilities
|
||||
namespace Bit.Scim.Utilities;
|
||||
|
||||
public class ScimContextMiddleware
|
||||
{
|
||||
public class ScimContextMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
public ScimContextMiddleware(RequestDelegate next)
|
||||
@ -19,5 +19,4 @@ namespace Bit.Scim.Utilities
|
||||
await scimContext.BuildAsync(httpContext, globalSettings, organizationRepository, organizationConnectionRepository);
|
||||
await _next.Invoke(httpContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,10 +22,10 @@ using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Sso.Controllers
|
||||
namespace Bit.Sso.Controllers;
|
||||
|
||||
public class AccountController : Controller
|
||||
{
|
||||
public class AccountController : Controller
|
||||
{
|
||||
private readonly IAuthenticationSchemeProvider _schemeProvider;
|
||||
private readonly IClientStore _clientStore;
|
||||
|
||||
@ -706,5 +706,4 @@ namespace Bit.Sso.Controllers
|
||||
return !context.RedirectUri.StartsWith("https", StringComparison.Ordinal)
|
||||
&& !context.RedirectUri.StartsWith("http", StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Sso.Controllers
|
||||
namespace Bit.Sso.Controllers;
|
||||
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly IIdentityServerInteractionService _interaction;
|
||||
|
||||
public HomeController(IIdentityServerInteractionService interaction)
|
||||
@ -51,5 +51,4 @@ namespace Bit.Sso.Controllers
|
||||
|
||||
return View("Error", vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Sso.Controllers
|
||||
namespace Bit.Sso.Controllers;
|
||||
|
||||
public class InfoController : Controller
|
||||
{
|
||||
public class InfoController : Controller
|
||||
{
|
||||
[HttpGet("~/alive")]
|
||||
[HttpGet("~/now")]
|
||||
public DateTime GetAlive()
|
||||
@ -17,5 +17,4 @@ namespace Bit.Sso.Controllers
|
||||
{
|
||||
return Json(CoreHelpers.GetVersion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Sustainsys.Saml2.AspNetCore2;
|
||||
using Sustainsys.Saml2.WebSso;
|
||||
|
||||
namespace Bit.Sso.Controllers
|
||||
namespace Bit.Sso.Controllers;
|
||||
|
||||
public class MetadataController : Controller
|
||||
{
|
||||
public class MetadataController : Controller
|
||||
{
|
||||
private readonly IAuthenticationSchemeProvider _schemeProvider;
|
||||
|
||||
public MetadataController(
|
||||
@ -66,5 +66,4 @@ namespace Bit.Sso.Controllers
|
||||
ContentType = "text/xml",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using IdentityServer4.Models;
|
||||
|
||||
namespace Bit.Sso.Models
|
||||
namespace Bit.Sso.Models;
|
||||
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
private string _requestId;
|
||||
|
||||
public ErrorMessage Error { get; set; }
|
||||
@ -23,5 +23,4 @@ namespace Bit.Sso.Models
|
||||
_requestId = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
namespace Bit.Sso.Models
|
||||
namespace Bit.Sso.Models;
|
||||
|
||||
public class RedirectViewModel
|
||||
{
|
||||
public class RedirectViewModel
|
||||
{
|
||||
public string RedirectUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Bit.Sso.Models
|
||||
namespace Bit.Sso.Models;
|
||||
|
||||
public class SamlEnvironment
|
||||
{
|
||||
public class SamlEnvironment
|
||||
{
|
||||
public X509Certificate2 SpSigningCertificate { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Sso.Models
|
||||
namespace Bit.Sso.Models;
|
||||
|
||||
public class SsoPreValidateResponseModel : JsonResult
|
||||
{
|
||||
public class SsoPreValidateResponseModel : JsonResult
|
||||
{
|
||||
public SsoPreValidateResponseModel(string token) : base(new
|
||||
{
|
||||
token
|
||||
})
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Bit.Sso
|
||||
namespace Bit.Sso;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Host
|
||||
@ -30,5 +30,4 @@ namespace Bit.Sso
|
||||
.Build()
|
||||
.Run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ using IdentityServer4.Extensions;
|
||||
using Microsoft.IdentityModel.Logging;
|
||||
using Stripe;
|
||||
|
||||
namespace Bit.Sso
|
||||
namespace Bit.Sso;
|
||||
|
||||
public class Startup
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IWebHostEnvironment env, IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
@ -151,5 +151,4 @@ namespace Bit.Sso
|
||||
// Log startup
|
||||
logger.LogInformation(Constants.BypassFiltersEventId, globalSettings.ProjectName + " started.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System.Security.Claims;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public static class ClaimsExtensions
|
||||
{
|
||||
public static class ClaimsExtensions
|
||||
{
|
||||
private static readonly Regex _normalizeTextRegEx =
|
||||
new Regex(@"[^a-zA-Z]", RegexOptions.CultureInvariant | RegexOptions.Singleline);
|
||||
|
||||
@ -42,5 +42,4 @@ namespace Bit.Sso.Utilities
|
||||
}
|
||||
return _normalizeTextRegEx.Replace(text, string.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ using IdentityServer4.Services;
|
||||
using IdentityServer4.Stores;
|
||||
using IdentityServer4.Validation;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public class DiscoveryResponseGenerator : IdentityServer4.ResponseHandling.DiscoveryResponseGenerator
|
||||
{
|
||||
public class DiscoveryResponseGenerator : IdentityServer4.ResponseHandling.DiscoveryResponseGenerator
|
||||
{
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
|
||||
public DiscoveryResponseGenerator(
|
||||
@ -32,5 +32,4 @@ namespace Bit.Sso.Utilities
|
||||
return CoreHelpers.AdjustIdentityServerConfig(dict, _globalSettings.BaseServiceUri.Sso,
|
||||
_globalSettings.BaseServiceUri.InternalSso);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Sustainsys.Saml2.AspNetCore2;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public class DynamicAuthenticationScheme : AuthenticationScheme, IDynamicAuthenticationScheme
|
||||
{
|
||||
public class DynamicAuthenticationScheme : AuthenticationScheme, IDynamicAuthenticationScheme
|
||||
{
|
||||
public DynamicAuthenticationScheme(string name, string displayName, Type handlerType,
|
||||
AuthenticationSchemeOptions options)
|
||||
: base(name, displayName, handlerType)
|
||||
@ -86,5 +86,4 @@ namespace Bit.Sso.Utilities
|
||||
throw new Exception("NoOpenIdConnectMetadataError");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,10 +18,10 @@ using Sustainsys.Saml2.AspNetCore2;
|
||||
using Sustainsys.Saml2.Configuration;
|
||||
using Sustainsys.Saml2.Saml2P;
|
||||
|
||||
namespace Bit.Core.Business.Sso
|
||||
namespace Bit.Core.Business.Sso;
|
||||
|
||||
public class DynamicAuthenticationSchemeProvider : AuthenticationSchemeProvider
|
||||
{
|
||||
public class DynamicAuthenticationSchemeProvider : AuthenticationSchemeProvider
|
||||
{
|
||||
private readonly IPostConfigureOptions<OpenIdConnectOptions> _oidcPostConfigureOptions;
|
||||
private readonly IExtendedOptionsMonitorCache<OpenIdConnectOptions> _extendedOidcOptionsMonitorCache;
|
||||
private readonly IPostConfigureOptions<Saml2Options> _saml2PostConfigureOptions;
|
||||
@ -454,5 +454,4 @@ namespace Bit.Core.Business.Sso
|
||||
_ => Sustainsys.Saml2.WebSso.Saml2BindingType.HttpPost,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System.Collections.Concurrent;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public class ExtendedOptionsMonitorCache<TOptions> : IExtendedOptionsMonitorCache<TOptions> where TOptions : class
|
||||
{
|
||||
public class ExtendedOptionsMonitorCache<TOptions> : IExtendedOptionsMonitorCache<TOptions> where TOptions : class
|
||||
{
|
||||
private readonly ConcurrentDictionary<string, Lazy<TOptions>> _cache =
|
||||
new ConcurrentDictionary<string, Lazy<TOptions>>(StringComparer.Ordinal);
|
||||
|
||||
@ -33,5 +33,4 @@ namespace Bit.Sso.Utilities
|
||||
{
|
||||
return _cache.TryRemove(name ?? Options.DefaultName, out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
using Bit.Core.Enums;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public interface IDynamicAuthenticationScheme
|
||||
{
|
||||
public interface IDynamicAuthenticationScheme
|
||||
{
|
||||
AuthenticationSchemeOptions Options { get; set; }
|
||||
SsoType SsoType { get; set; }
|
||||
|
||||
Task Validate();
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public interface IExtendedOptionsMonitorCache<TOptions> : IOptionsMonitorCache<TOptions> where TOptions : class
|
||||
{
|
||||
public interface IExtendedOptionsMonitorCache<TOptions> : IOptionsMonitorCache<TOptions> where TOptions : class
|
||||
{
|
||||
void AddOrUpdate(string name, TOptions options);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public static class OpenIdConnectOptionsExtensions
|
||||
{
|
||||
public static class OpenIdConnectOptionsExtensions
|
||||
{
|
||||
public static async Task<bool> CouldHandleAsync(this OpenIdConnectOptions options, string scheme, HttpContext context)
|
||||
{
|
||||
// Determine this is a valid request for our handler
|
||||
@ -59,5 +59,4 @@ namespace Bit.Sso.Utilities
|
||||
// This is likely not an appropriate handler
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
/// <summary>
|
||||
/// OpenID Connect Clients use scope values as defined in 3.3 of OAuth 2.0
|
||||
/// [RFC6749]. These values represent the standard scope values supported
|
||||
/// by OAuth 2.0 and therefore OIDC.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See: https://openid.net/specs/openid-connect-basic-1_0.html#Scopes
|
||||
/// </remarks>
|
||||
public static class OpenIdConnectScopes
|
||||
{
|
||||
/// <summary>
|
||||
/// OpenID Connect Clients use scope values as defined in 3.3 of OAuth 2.0
|
||||
/// [RFC6749]. These values represent the standard scope values supported
|
||||
/// by OAuth 2.0 and therefore OIDC.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See: https://openid.net/specs/openid-connect-basic-1_0.html#Scopes
|
||||
/// </remarks>
|
||||
public static class OpenIdConnectScopes
|
||||
{
|
||||
/// <summary>
|
||||
/// REQUIRED. Informs the Authorization Server that the Client is making
|
||||
/// an OpenID Connect request. If the openid scope value is not present,
|
||||
@ -60,5 +60,4 @@
|
||||
/// See: https://openid.net/specs/openid-connect-core-1_0.html#rfc.section.2
|
||||
/// </remarks>
|
||||
public const string Acr = "acr";
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using System.Xml;
|
||||
using Sustainsys.Saml2;
|
||||
using Sustainsys.Saml2.AspNetCore2;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public static class Saml2OptionsExtensions
|
||||
{
|
||||
public static class Saml2OptionsExtensions
|
||||
{
|
||||
public static async Task<bool> CouldHandleAsync(this Saml2Options options, string scheme, HttpContext context)
|
||||
{
|
||||
// Determine this is a valid request for our handler
|
||||
@ -101,5 +101,4 @@ namespace Bit.Sso.Utilities
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public static class SamlClaimTypes
|
||||
{
|
||||
public static class SamlClaimTypes
|
||||
{
|
||||
public const string Email = "urn:oid:0.9.2342.19200300.100.1.3";
|
||||
public const string GivenName = "urn:oid:2.5.4.42";
|
||||
public const string Surname = "urn:oid:2.5.4.4";
|
||||
public const string DisplayName = "urn:oid:2.16.840.1.113730.3.1.241";
|
||||
public const string CommonName = "urn:oid:2.5.4.3";
|
||||
public const string UserId = "urn:oid:0.9.2342.19200300.100.1.1";
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public static class SamlNameIdFormats
|
||||
{
|
||||
public static class SamlNameIdFormats
|
||||
{
|
||||
// Common
|
||||
public const string Unspecified = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified";
|
||||
public const string Email = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress";
|
||||
@ -14,5 +14,4 @@
|
||||
public const string WindowsQualifiedDomainName = "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName";
|
||||
public const string KerberosPrincipalName = "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos";
|
||||
public const string EntityIdentifier = "urn:oasis:names:tc:SAML:2.0:nameid-format:entity";
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public static class SamlPropertyKeys
|
||||
{
|
||||
public static class SamlPropertyKeys
|
||||
{
|
||||
public const string ClaimFormat = "http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format";
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ using IdentityServer4.ResponseHandling;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Sustainsys.Saml2.AspNetCore2;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddSsoServices(this IServiceCollection services,
|
||||
GlobalSettings globalSettings)
|
||||
{
|
||||
@ -74,5 +74,4 @@ namespace Bit.Sso.Utilities
|
||||
|
||||
return identityServerBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
|
||||
using Sustainsys.Saml2.AspNetCore2;
|
||||
|
||||
namespace Bit.Sso.Utilities
|
||||
namespace Bit.Sso.Utilities;
|
||||
|
||||
public class SsoAuthenticationMiddleware
|
||||
{
|
||||
public class SsoAuthenticationMiddleware
|
||||
{
|
||||
private readonly RequestDelegate _next;
|
||||
|
||||
public SsoAuthenticationMiddleware(RequestDelegate next, IAuthenticationSchemeProvider schemes)
|
||||
@ -81,5 +81,4 @@ namespace Bit.Sso.Utilities
|
||||
|
||||
await _next(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using AutoFixture;
|
||||
using AutoFixture.Xunit2;
|
||||
using Bit.Core.Enums.Provider;
|
||||
|
||||
namespace Bit.Commercial.Core.Test.AutoFixture
|
||||
namespace Bit.Commercial.Core.Test.AutoFixture;
|
||||
|
||||
internal class ProviderUser : ICustomization
|
||||
{
|
||||
internal class ProviderUser : ICustomization
|
||||
{
|
||||
public ProviderUserStatusType Status { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
|
||||
@ -22,10 +22,10 @@ namespace Bit.Commercial.Core.Test.AutoFixture
|
||||
.With(o => o.Type, Type)
|
||||
.With(o => o.Status, Status));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ProviderUserAttribute : CustomizeAttribute
|
||||
{
|
||||
public class ProviderUserAttribute : CustomizeAttribute
|
||||
{
|
||||
private readonly ProviderUserStatusType _status;
|
||||
private readonly ProviderUserType _type;
|
||||
|
||||
@ -41,5 +41,4 @@ namespace Bit.Commercial.Core.Test.AutoFixture
|
||||
{
|
||||
return new ProviderUser(_status, _type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,10 +19,10 @@ using NSubstitute.ReturnsExtensions;
|
||||
using Xunit;
|
||||
using ProviderUser = Bit.Core.Entities.Provider.ProviderUser;
|
||||
|
||||
namespace Bit.Commercial.Core.Test.Services
|
||||
namespace Bit.Commercial.Core.Test.Services;
|
||||
|
||||
public class ProviderServiceTests
|
||||
{
|
||||
public class ProviderServiceTests
|
||||
{
|
||||
[Theory, CustomAutoData(typeof(SutProviderCustomization))]
|
||||
public async Task CreateAsync_UserIdIsInvalid_Throws(SutProvider<ProviderService> sutProvider)
|
||||
{
|
||||
@ -546,5 +546,4 @@ namespace Bit.Commercial.Core.Test.Services
|
||||
await sutProvider.GetDependency<IEventService>().Received()
|
||||
.LogProviderOrganizationEventAsync(providerOrganization, EventType.ProviderOrganization_Removed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
namespace Bit.Admin
|
||||
namespace Bit.Admin;
|
||||
|
||||
public class AdminSettings
|
||||
{
|
||||
public class AdminSettings
|
||||
{
|
||||
public virtual string Admins { get; set; }
|
||||
public virtual CloudflareSettings Cloudflare { get; set; }
|
||||
public int? DeleteTrashDaysAgo { get; set; }
|
||||
@ -12,5 +12,4 @@
|
||||
public string AuthEmail { get; set; }
|
||||
public string AuthKey { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Microsoft.AspNetCore.Diagnostics;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
public class ErrorController : Controller
|
||||
{
|
||||
public class ErrorController : Controller
|
||||
{
|
||||
[Route("/error")]
|
||||
public IActionResult Error(int? statusCode = null)
|
||||
{
|
||||
@ -20,5 +20,4 @@ namespace Bit.Admin.Controllers
|
||||
return Redirect("/Home");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
private readonly HttpClient _httpClient = new HttpClient();
|
||||
private readonly ILogger<HomeController> _logger;
|
||||
@ -104,11 +104,10 @@ namespace Bit.Admin.Controllers
|
||||
[JsonProperty("keyConnectorVersion")]
|
||||
public string KeyConnectorVersion { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum ProjectType
|
||||
{
|
||||
public enum ProjectType
|
||||
{
|
||||
Core,
|
||||
Web,
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
public class InfoController : Controller
|
||||
{
|
||||
public class InfoController : Controller
|
||||
{
|
||||
[HttpGet("~/alive")]
|
||||
[HttpGet("~/now")]
|
||||
public DateTime GetAlive()
|
||||
@ -17,5 +17,4 @@ namespace Bit.Admin.Controllers
|
||||
{
|
||||
return Json(CoreHelpers.GetVersion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Bit.Core.Identity;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
public class LoginController : Controller
|
||||
{
|
||||
public class LoginController : Controller
|
||||
{
|
||||
private readonly PasswordlessSignInManager<IdentityUser> _signInManager;
|
||||
|
||||
public LoginController(
|
||||
@ -89,5 +89,4 @@ namespace Bit.Admin.Controllers
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ using Microsoft.Azure.Cosmos;
|
||||
using Microsoft.Azure.Cosmos.Linq;
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class LogsController : Controller
|
||||
{
|
||||
[Authorize]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class LogsController : Controller
|
||||
{
|
||||
private const string Database = "Diagnostics";
|
||||
private const string Container = "Logs";
|
||||
|
||||
@ -89,5 +89,4 @@ namespace Bit.Admin.Controllers
|
||||
return View(response.First());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,11 +11,11 @@ using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
[Authorize]
|
||||
public class OrganizationsController : Controller
|
||||
{
|
||||
[Authorize]
|
||||
public class OrganizationsController : Controller
|
||||
{
|
||||
private readonly IOrganizationRepository _organizationRepository;
|
||||
private readonly IOrganizationUserRepository _organizationUserRepository;
|
||||
private readonly IOrganizationConnectionRepository _organizationConnectionRepository;
|
||||
@ -213,5 +213,4 @@ namespace Bit.Admin.Controllers
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class ProvidersController : Controller
|
||||
{
|
||||
[Authorize]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class ProvidersController : Controller
|
||||
{
|
||||
private readonly IProviderRepository _providerRepository;
|
||||
private readonly IProviderUserRepository _providerUserRepository;
|
||||
private readonly IProviderOrganizationRepository _providerOrganizationRepository;
|
||||
@ -130,5 +130,4 @@ namespace Bit.Admin.Controllers
|
||||
TempData["InviteResentTo"] = ownerId;
|
||||
return RedirectToAction("Edit", new { id = providerId });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,12 +10,12 @@ using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class ToolsController : Controller
|
||||
{
|
||||
[Authorize]
|
||||
[SelfHosted(NotSelfHostedOnly = true)]
|
||||
public class ToolsController : Controller
|
||||
{
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
private readonly IOrganizationRepository _organizationRepository;
|
||||
private readonly IOrganizationService _organizationService;
|
||||
@ -555,5 +555,4 @@ namespace Bit.Admin.Controllers
|
||||
var bytes = Encoding.UTF8.GetBytes(result);
|
||||
return File(bytes, "application/json", "StripeSubscriptionsSearch.json");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,11 +7,11 @@ using Bit.Core.Utilities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bit.Admin.Controllers
|
||||
namespace Bit.Admin.Controllers;
|
||||
|
||||
[Authorize]
|
||||
public class UsersController : Controller
|
||||
{
|
||||
[Authorize]
|
||||
public class UsersController : Controller
|
||||
{
|
||||
private readonly IUserRepository _userRepository;
|
||||
private readonly ICipherRepository _cipherRepository;
|
||||
private readonly IPaymentService _paymentService;
|
||||
@ -107,5 +107,4 @@ namespace Bit.Admin.Controllers
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using Amazon.SQS.Model;
|
||||
using Bit.Core.Settings;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Admin.HostedServices
|
||||
namespace Bit.Admin.HostedServices;
|
||||
|
||||
public class AmazonSqsBlockIpHostedService : BlockIpHostedService
|
||||
{
|
||||
public class AmazonSqsBlockIpHostedService : BlockIpHostedService
|
||||
{
|
||||
private AmazonSQSClient _client;
|
||||
|
||||
public AmazonSqsBlockIpHostedService(
|
||||
@ -80,5 +80,4 @@ namespace Bit.Admin.HostedServices
|
||||
await Task.Delay(TimeSpan.FromSeconds(15));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
using Bit.Core.Settings;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Admin.HostedServices
|
||||
namespace Bit.Admin.HostedServices;
|
||||
|
||||
public class AzureQueueBlockIpHostedService : BlockIpHostedService
|
||||
{
|
||||
public class AzureQueueBlockIpHostedService : BlockIpHostedService
|
||||
{
|
||||
private QueueClient _blockIpQueueClient;
|
||||
private QueueClient _unblockIpQueueClient;
|
||||
|
||||
@ -60,5 +60,4 @@ namespace Bit.Admin.HostedServices
|
||||
await Task.Delay(TimeSpan.FromSeconds(15));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ using Bit.Core.Services;
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Admin.HostedServices
|
||||
namespace Bit.Admin.HostedServices;
|
||||
|
||||
public class AzureQueueMailHostedService : IHostedService
|
||||
{
|
||||
public class AzureQueueMailHostedService : IHostedService
|
||||
{
|
||||
private readonly ILogger<AzureQueueMailHostedService> _logger;
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
private readonly IMailService _mailService;
|
||||
@ -98,5 +98,4 @@ namespace Bit.Admin.HostedServices
|
||||
{
|
||||
return (await _mailQueueClient.ReceiveMessagesAsync(maxMessages: 32))?.Value ?? new QueueMessage[] { };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Bit.Core.Settings;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Bit.Admin.HostedServices
|
||||
namespace Bit.Admin.HostedServices;
|
||||
|
||||
public abstract class BlockIpHostedService : IHostedService, IDisposable
|
||||
{
|
||||
public abstract class BlockIpHostedService : IHostedService, IDisposable
|
||||
{
|
||||
protected readonly ILogger<BlockIpHostedService> _logger;
|
||||
protected readonly GlobalSettings _globalSettings;
|
||||
private readonly AdminSettings _adminSettings;
|
||||
@ -161,5 +161,4 @@ namespace Bit.Admin.HostedServices
|
||||
public string Value { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Bit.Core.Jobs;
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Migrator;
|
||||
|
||||
namespace Bit.Admin.HostedServices
|
||||
namespace Bit.Admin.HostedServices;
|
||||
|
||||
public class DatabaseMigrationHostedService : IHostedService, IDisposable
|
||||
{
|
||||
public class DatabaseMigrationHostedService : IHostedService, IDisposable
|
||||
{
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
private readonly ILogger<DatabaseMigrationHostedService> _logger;
|
||||
private readonly DbMigrator _dbMigrator;
|
||||
@ -60,5 +60,4 @@ namespace Bit.Admin.HostedServices
|
||||
|
||||
public virtual void Dispose()
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Bit.Core.Jobs;
|
||||
using Bit.Core.Settings;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class AliveJob : BaseJob
|
||||
{
|
||||
public class AliveJob : BaseJob
|
||||
{
|
||||
private readonly GlobalSettings _globalSettings;
|
||||
private HttpClient _httpClient = new HttpClient();
|
||||
|
||||
@ -25,5 +25,4 @@ namespace Bit.Admin.Jobs
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: Keep alive, " +
|
||||
response.StatusCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Bit.Core.Jobs;
|
||||
using Bit.Core.Repositories;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class DatabaseExpiredGrantsJob : BaseJob
|
||||
{
|
||||
public class DatabaseExpiredGrantsJob : BaseJob
|
||||
{
|
||||
private readonly IMaintenanceRepository _maintenanceRepository;
|
||||
|
||||
public DatabaseExpiredGrantsJob(
|
||||
@ -23,5 +23,4 @@ namespace Bit.Admin.Jobs
|
||||
await _maintenanceRepository.DeleteExpiredGrantsAsync();
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: DeleteExpiredGrantsAsync");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using Bit.Core.Repositories;
|
||||
using Bit.Core.Settings;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class DatabaseExpiredSponsorshipsJob : BaseJob
|
||||
{
|
||||
public class DatabaseExpiredSponsorshipsJob : BaseJob
|
||||
{
|
||||
private GlobalSettings _globalSettings;
|
||||
private readonly IMaintenanceRepository _maintenanceRepository;
|
||||
|
||||
@ -35,5 +35,4 @@ namespace Bit.Admin.Jobs
|
||||
await _maintenanceRepository.DeleteExpiredSponsorshipsAsync(deleteDate);
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: DeleteExpiredSponsorshipsAsync");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Bit.Core.Jobs;
|
||||
using Bit.Core.Repositories;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class DatabaseRebuildlIndexesJob : BaseJob
|
||||
{
|
||||
public class DatabaseRebuildlIndexesJob : BaseJob
|
||||
{
|
||||
private readonly IMaintenanceRepository _maintenanceRepository;
|
||||
|
||||
public DatabaseRebuildlIndexesJob(
|
||||
@ -23,5 +23,4 @@ namespace Bit.Admin.Jobs
|
||||
await _maintenanceRepository.RebuildIndexesAsync();
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: RebuildIndexesAsync");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Bit.Core.Jobs;
|
||||
using Bit.Core.Repositories;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class DatabaseUpdateStatisticsJob : BaseJob
|
||||
{
|
||||
public class DatabaseUpdateStatisticsJob : BaseJob
|
||||
{
|
||||
private readonly IMaintenanceRepository _maintenanceRepository;
|
||||
|
||||
public DatabaseUpdateStatisticsJob(
|
||||
@ -26,5 +26,4 @@ namespace Bit.Admin.Jobs
|
||||
await _maintenanceRepository.DisableCipherAutoStatsAsync();
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: DisableCipherAutoStatsAsync");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using Bit.Core.Repositories;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class DeleteCiphersJob : BaseJob
|
||||
{
|
||||
public class DeleteCiphersJob : BaseJob
|
||||
{
|
||||
private readonly ICipherRepository _cipherRepository;
|
||||
private readonly AdminSettings _adminSettings;
|
||||
|
||||
@ -33,5 +33,4 @@ namespace Bit.Admin.Jobs
|
||||
await _cipherRepository.DeleteDeletedAsync(deleteDate);
|
||||
_logger.LogInformation(Constants.BypassFiltersEventId, "Finished job task: DeleteDeletedAsync");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using Bit.Core.Repositories;
|
||||
using Bit.Core.Services;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class DeleteSendsJob : BaseJob
|
||||
{
|
||||
public class DeleteSendsJob : BaseJob
|
||||
{
|
||||
private readonly ISendRepository _sendRepository;
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
@ -38,5 +38,4 @@ namespace Bit.Admin.Jobs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,10 @@ using Bit.Core.Jobs;
|
||||
using Bit.Core.Settings;
|
||||
using Quartz;
|
||||
|
||||
namespace Bit.Admin.Jobs
|
||||
namespace Bit.Admin.Jobs;
|
||||
|
||||
public class JobsHostedService : BaseJobsHostedService
|
||||
{
|
||||
public class JobsHostedService : BaseJobsHostedService
|
||||
{
|
||||
public JobsHostedService(
|
||||
GlobalSettings globalSettings,
|
||||
IServiceProvider serviceProvider,
|
||||
@ -92,5 +92,4 @@ namespace Bit.Admin.Jobs
|
||||
services.AddTransient<DeleteSendsJob>();
|
||||
services.AddTransient<DeleteCiphersJob>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
using Bit.Core.Models.Business;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class BillingInformationModel
|
||||
{
|
||||
public class BillingInformationModel
|
||||
{
|
||||
public BillingInfo BillingInfo { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
public Guid? OrganizationId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class ChargeBraintreeModel : IValidatableObject
|
||||
{
|
||||
public class ChargeBraintreeModel : IValidatableObject
|
||||
{
|
||||
[Required]
|
||||
[Display(Name = "Braintree Customer Id")]
|
||||
public string Id { get; set; }
|
||||
@ -24,5 +24,4 @@ namespace Bit.Admin.Models
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class CreateProviderModel
|
||||
{
|
||||
public class CreateProviderModel
|
||||
{
|
||||
public CreateProviderModel() { }
|
||||
|
||||
[Display(Name = "Owner Email")]
|
||||
[Required]
|
||||
public string OwnerEmail { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class CreateUpdateTransactionModel : IValidatableObject
|
||||
{
|
||||
public class CreateUpdateTransactionModel : IValidatableObject
|
||||
{
|
||||
public CreateUpdateTransactionModel() { }
|
||||
|
||||
public CreateUpdateTransactionModel(Transaction transaction)
|
||||
@ -74,5 +74,4 @@ namespace Bit.Admin.Models
|
||||
Type = Type.Value
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class CursorPagedModel<T>
|
||||
{
|
||||
public class CursorPagedModel<T>
|
||||
{
|
||||
public List<T> Items { get; set; }
|
||||
public int Count { get; set; }
|
||||
public string Cursor { get; set; }
|
||||
public string NextCursor { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
using Bit.Core.Settings;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class HomeModel
|
||||
{
|
||||
public class HomeModel
|
||||
{
|
||||
public string CurrentVersion { get; set; }
|
||||
public GlobalSettings GlobalSettings { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class LicenseModel : IValidatableObject
|
||||
{
|
||||
public class LicenseModel : IValidatableObject
|
||||
{
|
||||
[Display(Name = "User Id")]
|
||||
public Guid? UserId { get; set; }
|
||||
[Display(Name = "Organization Id")]
|
||||
@ -31,5 +31,4 @@ namespace Bit.Admin.Models
|
||||
yield return new ValidationResult("Installation Id is required for organization licenses.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using Microsoft.Azure.Documents;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class LogModel : Resource
|
||||
{
|
||||
public class LogModel : Resource
|
||||
{
|
||||
public long EventIdHash { get; set; }
|
||||
public string Level { get; set; }
|
||||
public string Message { get; set; }
|
||||
@ -12,10 +12,10 @@ namespace Bit.Admin.Models
|
||||
public string MessageTemplate { get; set; }
|
||||
public IDictionary<string, object> Properties { get; set; }
|
||||
public string Project => Properties?.ContainsKey("Project") ?? false ? Properties["Project"].ToString() : null;
|
||||
}
|
||||
}
|
||||
|
||||
public class LogDetailsModel : LogModel
|
||||
{
|
||||
public class LogDetailsModel : LogModel
|
||||
{
|
||||
public JObject Exception { get; set; }
|
||||
|
||||
public string ExceptionToString(JObject e)
|
||||
@ -51,5 +51,4 @@ namespace Bit.Admin.Models
|
||||
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class LoginModel
|
||||
{
|
||||
public class LoginModel
|
||||
{
|
||||
[Required]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
public string ReturnUrl { get; set; }
|
||||
public string Error { get; set; }
|
||||
public string Success { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
using Serilog.Events;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class LogsModel : CursorPagedModel<LogModel>
|
||||
{
|
||||
public class LogsModel : CursorPagedModel<LogModel>
|
||||
{
|
||||
public LogEventLevel? Level { get; set; }
|
||||
public string Project { get; set; }
|
||||
public DateTime? Start { get; set; }
|
||||
public DateTime? End { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -6,10 +6,10 @@ using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class OrganizationEditModel : OrganizationViewModel
|
||||
{
|
||||
public class OrganizationEditModel : OrganizationViewModel
|
||||
{
|
||||
public OrganizationEditModel() { }
|
||||
|
||||
public OrganizationEditModel(Organization org, IEnumerable<OrganizationUserUserDetails> orgUsers,
|
||||
@ -149,5 +149,4 @@ namespace Bit.Admin.Models
|
||||
existingOrganization.MaxAutoscaleSeats = MaxAutoscaleSeats;
|
||||
return existingOrganization;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class OrganizationViewModel
|
||||
{
|
||||
public class OrganizationViewModel
|
||||
{
|
||||
public OrganizationViewModel() { }
|
||||
|
||||
public OrganizationViewModel(Organization org, IEnumerable<OrganizationConnection> connections,
|
||||
@ -46,5 +46,4 @@ namespace Bit.Admin.Models
|
||||
public int GroupCount { get; set; }
|
||||
public int PolicyCount { get; set; }
|
||||
public bool HasPublicPrivateKeys { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class OrganizationsModel : PagedModel<Organization>
|
||||
{
|
||||
public class OrganizationsModel : PagedModel<Organization>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string UserEmail { get; set; }
|
||||
public bool? Paid { get; set; }
|
||||
public string Action { get; set; }
|
||||
public bool SelfHosted { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public abstract class PagedModel<T>
|
||||
{
|
||||
public abstract class PagedModel<T>
|
||||
{
|
||||
public List<T> Items { get; set; }
|
||||
public int Page { get; set; }
|
||||
public int Count { get; set; }
|
||||
public int? PreviousPage => Page < 2 ? (int?)null : Page - 1;
|
||||
public int? NextPage => Items.Count < Count ? (int?)null : Page + 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class PromoteAdminModel
|
||||
{
|
||||
public class PromoteAdminModel
|
||||
{
|
||||
[Required]
|
||||
[Display(Name = "Admin User Id")]
|
||||
public Guid? UserId { get; set; }
|
||||
[Required]
|
||||
[Display(Name = "Organization Id")]
|
||||
public Guid? OrganizationId { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
using Bit.Core.Entities.Provider;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class ProviderEditModel : ProviderViewModel
|
||||
{
|
||||
public class ProviderEditModel : ProviderViewModel
|
||||
{
|
||||
public ProviderEditModel() { }
|
||||
|
||||
public ProviderEditModel(Provider provider, IEnumerable<ProviderUserUserDetails> providerUsers, IEnumerable<ProviderOrganizationOrganizationDetails> organizations)
|
||||
@ -30,5 +30,4 @@ namespace Bit.Admin.Models
|
||||
existingProvider.BillingEmail = BillingEmail?.ToLowerInvariant()?.Trim();
|
||||
return existingProvider;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
using Bit.Core.Enums.Provider;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class ProviderViewModel
|
||||
{
|
||||
public class ProviderViewModel
|
||||
{
|
||||
public ProviderViewModel() { }
|
||||
|
||||
public ProviderViewModel(Provider provider, IEnumerable<ProviderUserUserDetails> providerUsers, IEnumerable<ProviderOrganizationOrganizationDetails> organizations)
|
||||
@ -21,5 +21,4 @@ namespace Bit.Admin.Models
|
||||
public Provider Provider { get; set; }
|
||||
public IEnumerable<ProviderUserUserDetails> ProviderAdmins { get; set; }
|
||||
public IEnumerable<ProviderOrganizationOrganizationDetails> ProviderOrganizations { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
using Bit.Core.Entities.Provider;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class ProvidersModel : PagedModel<Provider>
|
||||
{
|
||||
public class ProvidersModel : PagedModel<Provider>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string UserEmail { get; set; }
|
||||
public bool? Paid { get; set; }
|
||||
public string Action { get; set; }
|
||||
public bool SelfHosted { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Models.BitStripe;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class StripeSubscriptionRowModel
|
||||
{
|
||||
public class StripeSubscriptionRowModel
|
||||
{
|
||||
public Stripe.Subscription Subscription { get; set; }
|
||||
public bool Selected { get; set; }
|
||||
|
||||
@ -13,19 +13,19 @@ namespace Bit.Admin.Models
|
||||
{
|
||||
Subscription = subscription;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum StripeSubscriptionsAction
|
||||
{
|
||||
public enum StripeSubscriptionsAction
|
||||
{
|
||||
Search,
|
||||
PreviousPage,
|
||||
NextPage,
|
||||
Export,
|
||||
BulkCancel
|
||||
}
|
||||
}
|
||||
|
||||
public class StripeSubscriptionsModel : IValidatableObject
|
||||
{
|
||||
public class StripeSubscriptionsModel : IValidatableObject
|
||||
{
|
||||
public List<StripeSubscriptionRowModel> Items { get; set; }
|
||||
public StripeSubscriptionsAction Action { get; set; } = StripeSubscriptionsAction.Search;
|
||||
public string Message { get; set; }
|
||||
@ -39,5 +39,4 @@ namespace Bit.Admin.Models
|
||||
yield return new ValidationResult("Bulk cancel is currently only supported for unpaid subscriptions");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class TaxRateAddEditModel
|
||||
{
|
||||
public class TaxRateAddEditModel
|
||||
{
|
||||
public string StripeTaxRateId { get; set; }
|
||||
public string Country { get; set; }
|
||||
public string State { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public decimal Rate { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class TaxRatesModel : PagedModel<TaxRate>
|
||||
{
|
||||
public class TaxRatesModel : PagedModel<TaxRate>
|
||||
{
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,10 @@ using Bit.Core.Models.Business;
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Core.Utilities;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class UserEditModel : UserViewModel
|
||||
{
|
||||
public class UserEditModel : UserViewModel
|
||||
{
|
||||
public UserEditModel() { }
|
||||
|
||||
public UserEditModel(User user, IEnumerable<Cipher> ciphers, BillingInfo billingInfo,
|
||||
@ -70,5 +70,4 @@ namespace Bit.Admin.Models
|
||||
existingUser.PremiumExpirationDate = PremiumExpirationDate;
|
||||
return existingUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class UserViewModel
|
||||
{
|
||||
public class UserViewModel
|
||||
{
|
||||
public UserViewModel() { }
|
||||
|
||||
public UserViewModel(User user, IEnumerable<Cipher> ciphers)
|
||||
@ -14,5 +14,4 @@ namespace Bit.Admin.Models
|
||||
|
||||
public User User { get; set; }
|
||||
public int CipherCount { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
using Bit.Core.Entities;
|
||||
|
||||
namespace Bit.Admin.Models
|
||||
namespace Bit.Admin.Models;
|
||||
|
||||
public class UsersModel : PagedModel<User>
|
||||
{
|
||||
public class UsersModel : PagedModel<User>
|
||||
{
|
||||
public string Email { get; set; }
|
||||
public string Action { get; set; }
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user