diff --git a/.gitignore b/.gitignore index ffe6b88..0efa7a2 100644 --- a/.gitignore +++ b/.gitignore @@ -416,3 +416,4 @@ FodyWeavers.xsd src/MaxInventory.Web/FutureSecrets.json src/MaxInventory.Web/appsettings.Development.json +src/MaxInventory.Web/appsettings.json diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8f38850..0000000 --- a/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. - -# This stage is used when running from VS in fast mode (Default for Debug configuration) -FROM mcr.microsoft.com/dotnet/runtime:10.0 AS base -USER $APP_UID -WORKDIR /app - - -# This stage is used to build the service project -FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["MaxInventory.csproj", "."] -RUN dotnet restore "./MaxInventory.csproj" -COPY . . -WORKDIR "/src/." -RUN dotnet build "./MaxInventory.csproj" -c $BUILD_CONFIGURATION -o /app/build - -# This stage is used to publish the service project to be copied to the final stage -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./MaxInventory.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "MaxInventory.dll"] \ No newline at end of file diff --git a/MaxInventory.slnx b/MaxInventory.slnx index ca999c9..1328e02 100644 --- a/MaxInventory.slnx +++ b/MaxInventory.slnx @@ -1,5 +1,5 @@ - + diff --git a/Program.cs b/Program.cs deleted file mode 100644 index 3751555..0000000 --- a/Program.cs +++ /dev/null @@ -1,2 +0,0 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); diff --git a/README.md b/README.md deleted file mode 100644 index 7703120..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Inventory - diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..ddc1887 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,52 @@ +variables: +- group: "Proxy Variables" +trigger: + branches: + include: + - refs/heads/master +name: $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) +jobs: +- job: Job_1 + displayName: Build Server + cancelTimeoutInMinutes: 1 + pool: + name: Dotnet-Build + steps: + - checkout: self + clean: true + submodules: recursive + - task: CmdLine@1 + displayName: dotnet clean + inputs: + filename: dotnet + arguments: clean -o $(Build.ArtifactStagingDirectory)/Publish/K8s/ + - task: CmdLine@1 + displayName: dotnet build + inputs: + filename: dotnet + arguments: build -c Release MaxInventory.slnx + - task: CmdLine@1 + displayName: dotnet Info + inputs: + filename: dotnet + arguments: --info + - task: DotNetCoreCLI@2 + displayName: dotnet publish Web Api K8s + inputs: + command: 'publish' + publishWebProjects: false + projects: '**/**/MaxInventory.Web.csproj' + arguments: '-c Release -o $(Build.ArtifactStagingDirectory)/Publish/K8s/ --no-self-contained' + zipAfterPublish: false + modifyOutputPath: false + - task: CopyFiles@2 + displayName: 'Copy Dockerfile to publish output' + inputs: + SourceFolder: $(Build.SourcesDirectory)/src/MaxInventory.Web/ + Contents: 'Dockerfile' + TargetFolder: $(Build.ArtifactStagingDirectory)/Publish/K8s/ + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: K8s' + inputs: + PathtoPublish: $(Build.ArtifactStagingDirectory)/Publish/K8s/ + ArtifactName: Kubernetes diff --git a/src/MaxInventory.Authentication/Abstractions/IPrincipalAccessEvaluator.cs b/src/MaxInventory.Authentication/Abstractions/IPrincipalAccessEvaluator.cs index bb2caf9..4dd9b68 100644 --- a/src/MaxInventory.Authentication/Abstractions/IPrincipalAccessEvaluator.cs +++ b/src/MaxInventory.Authentication/Abstractions/IPrincipalAccessEvaluator.cs @@ -1,4 +1,4 @@ -using MaxInventory.Authentication.Core; +using MaxInventory.Authentication.Core; using System.Security.Claims; namespace MaxInventory.Authentication.Abstractions diff --git a/src/MaxInventory.Authentication/Core/AdminCookieValidationEvents.cs b/src/MaxInventory.Authentication/Core/AdminCookieValidationEvents.cs index 4e21d9c..8cb91dc 100644 --- a/src/MaxInventory.Authentication/Core/AdminCookieValidationEvents.cs +++ b/src/MaxInventory.Authentication/Core/AdminCookieValidationEvents.cs @@ -1,12 +1,31 @@ -using MaxInventory.Authentication.Abstractions; +using MaxInventory.Authentication.Abstractions; +using MaxInventory.Authentication.Configuration; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; namespace MaxInventory.Authentication.Core { public sealed class AdminCookieValidationEvents : CookieAuthenticationEvents { + // private static readonly string[] GroupClaimTypes = + // { + // "groups", + // "group", + // "role", + // "roles", + // ClaimTypes.GroupSid, + // ClaimTypes.Role, + // "http://schemas.microsoft.com/ws/2008/06/identity/claims/role", + // "http://schemas.xmlsoap.org/claims/Group" + //}; + private readonly IPrincipalAccessEvaluator _principalAccessEvaluator; public AdminCookieValidationEvents(IPrincipalAccessEvaluator principalAccessEvaluator) @@ -35,6 +54,24 @@ namespace MaxInventory.Authentication.Core context.RejectPrincipal(); await context.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); } + //var configuredGroups = (_configuration[AuthEnvironment.AdminGroups] ?? string.Empty) + // .Split(';', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); + + + + //var principalGroups = identity.Claims + // .Where(c => GroupClaimTypes.Contains(c.Type, StringComparer.OrdinalIgnoreCase)) + // .Select(c => c.Value); + + //var isAdmin = configuredGroups.Length > 0 && + // principalGroups.Any(group => + // configuredGroups.Contains(group, StringComparer.OrdinalIgnoreCase)); + + //if (!isAdmin) + //{ + // context.RejectPrincipal(); + // await context.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); + //} } } } diff --git a/src/MaxInventory.Authentication/Core/AuthRoles.cs b/src/MaxInventory.Authentication/Core/AuthRoles.cs index ac6f811..9947d49 100644 --- a/src/MaxInventory.Authentication/Core/AuthRoles.cs +++ b/src/MaxInventory.Authentication/Core/AuthRoles.cs @@ -2,7 +2,7 @@ { public static class AuthRoles { - public const string Admin = "SG-OMB-IT"; + public const string Admin = "Admin"; public const string EditAdd = "EditAdd"; public const string View = "View"; } diff --git a/src/MaxInventory.Authentication/Core/PrincipalAccess.cs b/src/MaxInventory.Authentication/Core/PrincipalAccess.cs index e3b5f60..cc3d6d4 100644 --- a/src/MaxInventory.Authentication/Core/PrincipalAccess.cs +++ b/src/MaxInventory.Authentication/Core/PrincipalAccess.cs @@ -1,4 +1,4 @@ -namespace MaxInventory.Authentication.Core +namespace MaxInventory.Authentication.Core { public sealed record PrincipalAccess(bool IsAuthenticated, bool CanView, bool CanEdit, bool CanDelete); } diff --git a/src/MaxInventory.Authentication/Core/PrincipalAccessEvaluator.cs b/src/MaxInventory.Authentication/Core/PrincipalAccessEvaluator.cs index f037b64..aff445b 100644 --- a/src/MaxInventory.Authentication/Core/PrincipalAccessEvaluator.cs +++ b/src/MaxInventory.Authentication/Core/PrincipalAccessEvaluator.cs @@ -1,4 +1,4 @@ -using MaxInventory.Authentication.Abstractions; +using MaxInventory.Authentication.Abstractions; using System.Security.Claims; namespace MaxInventory.Authentication.Core diff --git a/src/MaxInventory.Authentication/Extensions/AuthenticationServiceCollectionExtensions.cs b/src/MaxInventory.Authentication/Extensions/AuthenticationServiceCollectionExtensions.cs index d18cacd..8fb6bab 100644 --- a/src/MaxInventory.Authentication/Extensions/AuthenticationServiceCollectionExtensions.cs +++ b/src/MaxInventory.Authentication/Extensions/AuthenticationServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Configuration; @@ -42,7 +42,7 @@ namespace MaxInventory.Authentication.Extensions authBuilder.AddCookie(options => { options.Cookie.Name = "secure-network.auth"; - options.AccessDeniedPath = "/AccesDenied"; + options.AccessDeniedPath = "/access-denied"; options.EventsType = typeof(AdminCookieValidationEvents); }); @@ -79,4 +79,4 @@ namespace MaxInventory.Authentication.Extensions } } } - +//Triggering release. \ No newline at end of file diff --git a/src/MaxInventory.Authentication/Providers/Oidc/OidcAuthProvider.cs b/src/MaxInventory.Authentication/Providers/Oidc/OidcAuthProvider.cs index 57d3291..c5a99c6 100644 --- a/src/MaxInventory.Authentication/Providers/Oidc/OidcAuthProvider.cs +++ b/src/MaxInventory.Authentication/Providers/Oidc/OidcAuthProvider.cs @@ -73,17 +73,18 @@ public sealed class OidcAuthProvider : IAuthProvider RoleClaimType = roleClaimType }; - options.Events = new OpenIdConnectEvents() - { - OnRedirectToIdentityProvider = context => - { - var builder = new UriBuilder(context.ProtocolMessage.RedirectUri); - builder.Scheme = "https"; - builder.Port = 44374;// 1; - context.ProtocolMessage.RedirectUri = builder.ToString(); - return Task.FromResult(0); - } - }; + //This is used for Local Testing + //options.Events = new OpenIdConnectEvents() + //{ + // OnRedirectToIdentityProvider = context => + // { + // var builder = new UriBuilder(context.ProtocolMessage.RedirectUri); + // builder.Scheme = "https"; + // builder.Port = 443; + // context.ProtocolMessage.RedirectUri = builder.ToString(); + // return Task.FromResult(0); + // } + //}; }); } } diff --git a/src/MaxInventory.Core/Settings/ApiSettings.cs b/src/MaxInventory.Core/Settings/ApiSettings.cs index 485f5f5..b27f6ab 100644 --- a/src/MaxInventory.Core/Settings/ApiSettings.cs +++ b/src/MaxInventory.Core/Settings/ApiSettings.cs @@ -9,7 +9,7 @@ /// /// Base URL for the inventory API. /// - public string? BaseUrl { get; set; } + public string BaseUrl { get; set; } = "https://directauth.max.gov/inventory"; /// /// HTTP request timeout in seconds. Default is 30. diff --git a/src/MaxInventory.Core/Settings/CertificateSettings.cs b/src/MaxInventory.Core/Settings/CertificateSettings.cs index c95dec9..89e25ed 100644 --- a/src/MaxInventory.Core/Settings/CertificateSettings.cs +++ b/src/MaxInventory.Core/Settings/CertificateSettings.cs @@ -3,17 +3,35 @@ /// /// Configuration settings for client certificate authentication. /// Bound from the "Certificate" section of appsettings.json. - /// Uses a mounted PFX file path, typically sourced from a Kubernetes secret volume. + /// Supports two modes: Windows certificate store lookup (by friendly name) + /// or file-based PFX loading (for Docket/Linux environments). /// public sealed class CertificateSettings { /// - /// Path to the mounted PFX certificate file. + /// When true, loads certificate from a PFX file (FilePath + Password). + /// When false, searches the Windows machine certificate store by FriendlyName. + /// + public bool UseFile { get; set; } = true; + + ///Friendly name of the certificate in the Windows machine store. + ///Used when UseFile is false. + /// + public string? FriendlyName { get; set; } = ""; + + /// + ///Certificate thumbprint in the windows machine store. + ///Used as a fallback when UseFile is false and FriendlyName lookup does not find a certificate. + /// + public string? Thumbprint { get; set; } + + /// + /// Path to the PFX certificate file. Used when UseFile is true. /// public string? Path { get; set; } /// - /// Password for the PFX certificate file when one is required. + /// Password for the PFC certificate file. Used when UseFile is true. /// public string? Password { get; set; } } diff --git a/src/MaxInventory.Infrastructure/Certificates/FileCertificateProvider.cs b/src/MaxInventory.Infrastructure/Certificates/FileCertificateProvider.cs index 7b88009..932b5f8 100644 --- a/src/MaxInventory.Infrastructure/Certificates/FileCertificateProvider.cs +++ b/src/MaxInventory.Infrastructure/Certificates/FileCertificateProvider.cs @@ -11,12 +11,12 @@ namespace MaxInventory.Infrastructure.Certificates public sealed class FileCertificateProvider : ICertificateProvider { private readonly string _filePath; - private readonly string? _password; + private readonly string _password; - public FileCertificateProvider(string filePath, string? password) + public FileCertificateProvider(string filePath, string password) { _filePath = filePath ?? throw new ArgumentNullException(nameof(filePath)); - _password = password; + _password = password ?? throw new ArgumentNullException(nameof(password)); } /// @@ -29,15 +29,11 @@ namespace MaxInventory.Infrastructure.Certificates $"is mounted or copied to the expected location.", _filePath); } - return string.IsNullOrWhiteSpace(_password) - ? new X509Certificate2( - _filePath, - (string?)null, - X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet) - : new X509Certificate2( - _filePath, - _password, - X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet); + return new X509Certificate2( + _filePath, + _password, + X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet + ); } } } diff --git a/src/MaxInventory.Infrastructure/Extensions/ServiceCollectionExtensions.cs b/src/MaxInventory.Infrastructure/Extensions/ServiceCollectionExtensions.cs index 7f43a26..8327b74 100644 --- a/src/MaxInventory.Infrastructure/Extensions/ServiceCollectionExtensions.cs +++ b/src/MaxInventory.Infrastructure/Extensions/ServiceCollectionExtensions.cs @@ -5,6 +5,7 @@ using MaxInventory.Core.Services; using MaxInventory.Core.Settings; using MaxInventory.Infrastructure.Certificates; using MaxInventory.Infrastructure.Http; +using System.Runtime.CompilerServices; namespace MaxInventory.Infrastructure.Extensions { @@ -25,28 +26,41 @@ namespace MaxInventory.Infrastructure.Extensions // Bind settings from configuration var apiSettings = new ApiSettings(); configuration.GetSection("Api").Bind(apiSettings); - if (string.IsNullOrWhiteSpace(apiSettings.BaseUrl)) - { - throw new InvalidOperationException( - "Api.BaseUrl must be provided via configuration or Kubernetes secret."); - } services.AddSingleton(apiSettings); var certSettings = new CertificateSettings(); configuration.GetSection("Certificate").Bind(certSettings); - if (string.IsNullOrWhiteSpace(certSettings.Path)) - { - throw new InvalidOperationException( - "Certificate.Path must be provided via configuration and should point to the mounted Kubernetes secret file."); - } services.AddSingleton(certSettings); var proxySettings = new ProxySettings(); configuration.GetSection("Proxy").Bind(proxySettings); services.AddSingleton(proxySettings); - services.AddSingleton( - new FileCertificateProvider(certSettings.Path, certSettings.Password)); + // Cert provider + if (certSettings.UseFile) + { + services.AddSingleton( + new FileCertificateProvider( + certSettings.Path ?? throw new InvalidOperationException( + "Certificate.FilePath must be set when Certificate.UseFile is true."), + certSettings.Password ?? throw new InvalidOperationException( + "Certificate.Password must be set when Certificate.UseFile is true.")) + ); + } + else + { + if (string.IsNullOrWhiteSpace(certSettings.FriendlyName) && + string.IsNullOrWhiteSpace(certSettings.Thumbprint)) + { + throw new InvalidOperationException( + "When Certificate.UseFile is false, set at least one of Certificate.FriendlyName or Certificate.Thumbprint."); + } + + //services.AddSingleton( + // new WindowsCertificateProvider( + // certSettings.FriendlyName, + // certSettings.Thumbprint)); + } //Http Client services.AddSingleton(sp => diff --git a/src/MaxInventory.Infrastructure/Http/InventoryHttpClientFactory.cs b/src/MaxInventory.Infrastructure/Http/InventoryHttpClientFactory.cs index 47a9bab..8b9fbe6 100644 --- a/src/MaxInventory.Infrastructure/Http/InventoryHttpClientFactory.cs +++ b/src/MaxInventory.Infrastructure/Http/InventoryHttpClientFactory.cs @@ -34,7 +34,7 @@ namespace MaxInventory.Infrastructure.Http } //Ensure the base URL ends with a trailing slash for proper relative URL resolution - var baseUrl = apiSettings.BaseUrl!.TrimEnd('/') + "/"; + var baseUrl = apiSettings.BaseUrl.TrimEnd('/') + "/"; var client = new HttpClient(handler) { diff --git a/src/MaxInventory.Web/Components/Pages/ContentTypePage.razor.cs b/src/MaxInventory.Web/Components/Pages/ContentTypePage.razor.cs index acc599d..6c52c49 100644 --- a/src/MaxInventory.Web/Components/Pages/ContentTypePage.razor.cs +++ b/src/MaxInventory.Web/Components/Pages/ContentTypePage.razor.cs @@ -1,4 +1,4 @@ -namespace MaxInventory.Web.Components.Pages; +namespace MaxInventory.Web.Components.Pages; using MaxInventory.Authentication.Abstractions; using MaxInventory.Core.Configuration; @@ -33,7 +33,7 @@ public partial class ContentTypePage : ComponentBase [Inject] public required AuthenticationStateProvider AuthenticationStateProvider { get; set; } - // -- Page State --------------------------------------------------- + // ── Page State ─────────────────────────────────────────────────── private ContentTypeDefinition? _definition; private ContentTypeDefinition? _formDefinition; private List _items = new(); @@ -56,7 +56,7 @@ public partial class ContentTypePage : ComponentBase /// private readonly Dictionary> _dataCache = new(); - // -- Lifecycle ---------------------------------------------------- + // ── Lifecycle ──────────────────────────────────────────────────── protected override async Task OnParametersSetAsync() { @@ -91,13 +91,13 @@ public partial class ContentTypePage : ComponentBase } if (EditId.HasValue) { - var editItem = _items.FirstOrDefault(i => i.Id == EditId.Value); + var editItem = _items.FirstOrDefault(i => i.Id == HighlightId.Value); if (editItem != null && _canEdit) ShowEditForm(editItem); } } - // -- Data Loading ------------------------------------------------- + // ── Data Loading ───────────────────────────────────────────────── private async Task LoadDataAsync() { @@ -159,7 +159,7 @@ public partial class ContentTypePage : ComponentBase } - // -- Row Selection ------------------------------------------------- + // ── Row Selection ───────────────────────────────────────────────── private void SelectItem(IInventoryEntity item) { @@ -204,7 +204,7 @@ public partial class ContentTypePage : ComponentBase } } - // -- CRUD --------------------------------------------------------- + // ── CRUD ───────────────────────────────────────────────────────── private void ShowAddForm() { @@ -340,7 +340,7 @@ public partial class ContentTypePage : ComponentBase } } - // -- Helpers ------------------------------------------------------ + // ── Helpers ────────────────────────────────────────────────────── private string GetDisplayName(IInventoryEntity entity) { @@ -381,10 +381,11 @@ public partial class ContentTypePage : ComponentBase { var state = await AuthenticationStateProvider.GetAuthenticationStateAsync(); var access = await PrincipalAccessEvaluator.EvaluateAsync(state.User); + _canView = access.CanView; _canEdit = access.CanEdit; _canDelete = access.CanDelete; + } -} - +} \ No newline at end of file diff --git a/src/MaxInventory.Web/Dockerfile b/src/MaxInventory.Web/Dockerfile index e808d22..4fa9d24 100644 --- a/src/MaxInventory.Web/Dockerfile +++ b/src/MaxInventory.Web/Dockerfile @@ -1,30 +1,6 @@ -# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. - -# This stage is used when running from VS in fast mode (Default for Debug configuration) FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base -USER $APP_UID WORKDIR /app +COPY . . +ENV ASPNETCORE_URLS=http://+:8080 EXPOSE 8080 -EXPOSE 8081 - - -# This stage is used to build the service project -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["MaxInventory.Web/MaxInventory.Web.csproj", "MaxInventory.Web/"] -RUN dotnet restore "./MaxInventory.Web/MaxInventory.Web.csproj" -COPY . . -WORKDIR "/src/MaxInventory.Web" -RUN dotnet build "./MaxInventory.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build - -# This stage is used to publish the service project to be copied to the final stage -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./MaxInventory.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "MaxInventory.Web.dll"] \ No newline at end of file diff --git a/src/MaxInventory.Web/Program.cs b/src/MaxInventory.Web/Program.cs index d337073..28e1c4b 100644 --- a/src/MaxInventory.Web/Program.cs +++ b/src/MaxInventory.Web/Program.cs @@ -4,6 +4,7 @@ using MaxInventory.Infrastructure.Extensions; using MaxInventory.Web.Components; using MaxInventory.Web.Services; using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.HttpOverrides; var builder = WebApplication.CreateBuilder(args); @@ -19,7 +20,9 @@ if (Directory.Exists(secretsDirectory)) } //Blazor Server Services builder.Services.AddRazorComponents() - .AddInteractiveServerComponents(); + .AddInteractiveServerComponents() + .AddCircuitOptions( o => o.DetailedErrors = + builder.Configuration.GetValue("DetailedErrors",false)); builder.Services.AddMemoryCache(); builder.Services.AddSingleton(); @@ -44,13 +47,20 @@ builder.Services.AddScoped(); var app = builder.Build(); //configure the HTTP Request pipeline +var forwardedHeaderOptions = new ForwardedHeadersOptions +{ + ForwardedHeaders = ForwardedHeaders.XForwardedFor | + ForwardedHeaders.XForwardedProto +}; +forwardedHeaderOptions.KnownNetworks.Clear(); +forwardedHeaderOptions.KnownProxies.Clear(); +app.UseForwardedHeaders(forwardedHeaderOptions); if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error"); app.UseHsts(); } -app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseAuthentication(); app.UseAuthorization(); @@ -61,4 +71,4 @@ app.MapRazorComponents() .RequireAuthorization("ViewOnly"); -app.Run(); \ No newline at end of file +app.Run(); diff --git a/src/MaxInventory.Web/appsettings.json b/src/MaxInventory.Web/appsettings.json index 61f90ad..dc6d778 100644 --- a/src/MaxInventory.Web/appsettings.json +++ b/src/MaxInventory.Web/appsettings.json @@ -7,12 +7,10 @@ }, "AllowedHosts": "*", "Api": { + "BaseUrl": "https://directauth.max.gov/inventory", "TimeoutSeconds": 30 }, - "Certificate": { - "Path": null, - "Password": null - }, + "Proxy": { "Enabled": true, "Address": "http://proxy.omb.gov:8080"