diff options
| author | crobibero <cody@robibe.ro> | 2020-12-02 14:59:57 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-12-02 14:59:57 -0700 |
| commit | 7a729ea8d69b5cea16d7ba4a03748cd8a4caf871 (patch) | |
| tree | 6a6d167205d7a277a73a207806025b0cd92bf926 /Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | |
| parent | ea20f05de41feb6ba876bc5a17f0d62d419fe04f (diff) | |
Move OpenApiSecurityScheme to OperationFilter
Diffstat (limited to 'Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs')
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index e5b9620f7..618a4e92b 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -236,18 +236,6 @@ namespace Jellyfin.Server.Extensions Description = "API key header parameter" }); - var securitySchemeRef = new OpenApiSecurityScheme - { - Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = AuthenticationSchemes.CustomAuthentication }, - }; - - // TODO: Apply this with an operation filter instead of globally - // https://github.com/domaindrivendev/Swashbuckle.AspNetCore#add-security-definitions-and-requirements - c.AddSecurityRequirement(new OpenApiSecurityRequirement - { - { securitySchemeRef, Array.Empty<string>() } - }); - // Add all xml doc files to swagger generator. var xmlFiles = Directory.GetFiles( AppContext.BaseDirectory, @@ -277,6 +265,7 @@ namespace Jellyfin.Server.Extensions // TODO - remove when all types are supported in System.Text.Json c.AddSwaggerTypeMappings(); + c.OperationFilter<SecurityRequirementsOperationFilter>(); c.OperationFilter<FileResponseFilter>(); c.DocumentFilter<WebsocketModelFilter>(); }); |
