swagger_generator_flutter/lib/templates/api/security_schemes.mustache

38 lines
1.0 KiB
Plaintext

// Security Schemes
class SecuritySchemes {
{{#schemes}}
/// {{description}}
{{#isApiKey}}
static const String {{constantName}} = '{{name}}';
static const String {{constantName}}_PARAM = '{{paramName}}';
static const String {{constantName}}_LOCATION = '{{location}}';
{{/isApiKey}}
{{#isHttp}}
static const String {{constantName}} = '{{name}}';
static const String {{constantName}}_SCHEME = '{{scheme}}';
{{#hasBearerFormat}}
static const String {{constantName}}_FORMAT = '{{bearerFormat}}';
{{/hasBearerFormat}}
{{/isHttp}}
{{#isOAuth2}}
static const String {{constantName}} = '{{name}}';
{{#flows}}
{{#hasAuthUrl}}
static const String {{flowConstantName}}_AUTH_URL = '{{authUrl}}';
{{/hasAuthUrl}}
{{#hasTokenUrl}}
static const String {{flowConstantName}}_TOKEN_URL = '{{tokenUrl}}';
{{/hasTokenUrl}}
{{#hasScopes}}
static const Map<String, String> {{flowConstantName}}_SCOPES = {
{{#scopes}}
'{{scope}}': '{{description}}',
{{/scopes}}
};
{{/hasScopes}}
{{/flows}}
{{/isOAuth2}}
{{/schemes}}
}