File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/api/Synapse.Api.Http/Extensions Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,29 @@ public static IServiceCollection AddSynapseHttpApi(this IServiceCollection servi
66
66
var action = ( ControllerActionDescriptor ) o . ActionDescriptor ;
67
67
return $ "{ action . ActionName } ". ToCamelCase ( ) ;
68
68
} ) ;
69
+ builder . AddSecurityDefinition ( "Static Token" , new OpenApiSecurityScheme
70
+ {
71
+ Description = "Static token authorization using the Bearer scheme" ,
72
+ Name = "Authorization" ,
73
+ In = ParameterLocation . Header ,
74
+ Type = SecuritySchemeType . Http ,
75
+ Scheme = "bearer" ,
76
+ BearerFormat = "Static Token"
77
+ } ) ;
78
+ builder . AddSecurityRequirement ( new ( )
79
+ {
80
+ {
81
+ new ( )
82
+ {
83
+ Reference = new ( )
84
+ {
85
+ Id = "Static Token" ,
86
+ Type = ReferenceType . SecurityScheme
87
+ }
88
+ } ,
89
+ Array . Empty < string > ( )
90
+ }
91
+ } ) ;
69
92
builder . ResolveConflictingActions ( apiDescriptions => apiDescriptions . First ( ) ) ;
70
93
builder . SwaggerDoc ( "v1" , new OpenApiInfo
71
94
{
You can’t perform that action at this time.
0 commit comments