1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00
Files
bitwarden/src/Api/Controllers/ConfigController.cs
2023-03-10 08:11:11 -05:00

33 lines
862 B
C#

using Bit.Api.Models.Response;
using Bit.Core.Context;
using Bit.Core.Services;
using Bit.Core.Settings;
using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Controllers;
[Route("config")]
public class ConfigController : Controller
{
private readonly IGlobalSettings _globalSettings;
private readonly ICurrentContext _currentContext;
private readonly IFeatureService _featureService;
public ConfigController(
IGlobalSettings globalSettings,
ICurrentContext currentContext,
IFeatureService featureService)
{
_globalSettings = globalSettings;
_currentContext = currentContext;
_featureService = featureService;
}
[HttpGet("")]
public ConfigResponseModel GetConfigs()
{
return new ConfigResponseModel(_globalSettings, _featureService.GetAll(_currentContext));
}
}