Skip to content

Commit aada4ce

Browse files
author
Chris Young
committed
Merge branch 'hotfix/4.0.2'
2 parents fc4db7d + 1004ad5 commit aada4ce

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/ArchitectNow.Web/Models/SwaggerOptions.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@ public class SwaggerOptions
2222
public Action<SwaggerUiSettings> Configure { get; set; }
2323
public IList<IDocumentProcessor> DocumentProcessors { get; set; } = new List<IDocumentProcessor>();
2424

25-
public void AddAuthorizationHeader()
25+
public SwaggerOptions(bool includeAuthorizationHeader = true)
2626
{
27-
DocumentProcessors.Add(
28-
new SecurityDefinitionAppender("Authorization", new SwaggerSecurityScheme
29-
{
30-
Type = SwaggerSecuritySchemeType.ApiKey,
31-
Name = "Authorization",
32-
In = SwaggerSecurityApiKeyLocation.Header
33-
})
34-
);
27+
if (includeAuthorizationHeader)
28+
{
29+
DocumentProcessors.Add(
30+
new SecurityDefinitionAppender("Authorization", new SwaggerSecurityScheme
31+
{
32+
Type = SwaggerSecuritySchemeType.ApiKey,
33+
Name = "Authorization",
34+
In = SwaggerSecurityApiKeyLocation.Header
35+
})
36+
);
37+
}
3538
}
3639
}
3740
}

src/ArchitectNow.Web/StartupBase.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ protected virtual void ConfigureLogging(LoggerConfiguration loggerConfiguration)
150150

151151
}
152152

153-
protected virtual void ConfigureSwaggerUi(SwaggerUiSettings swaggerUiOptions)
154-
{
155-
156-
}
157-
158153
protected virtual void ConfigureDashboardOptions(DashboardOptions dashboardOptions)
159154
{
160155

0 commit comments

Comments
 (0)