struct Swagger::Authorization
- Swagger::Authorization
- Struct
- Value
- Object
Overview
Define a authentication
Avaibled authentication in Type
Defined in:
swagger/authorization.crConstructors
- .new(name : String, description : String? = nil, api_key_name : String? = nil, bearer_format : String? = nil, parameter_location : String? = nil)
- .new(name : Type, description : String? = nil, api_key_name : String? = nil, bearer_format : String? = nil, parameter_location : String? = nil, oauth2_flows : Array(OAuth2Flow)? = nil)
Class Method Summary
-
.api_key(*, name : String, location = "header", description : String? = nil)
Access with api key auth.
-
.basic(description : String? = nil)
Access with basic auth.
-
.bearer(*, format : String? = nil, description : String? = nil)
Access with bearer auth.
-
.cookie(*, name : String, description : String? = nil)
Access with cookie auth.
-
.jwt(description : String? = nil)
Access with jwt auth.
-
.none(description : String? = nil)
Access without any authorization.
- .oauth2(*, grant_type name : String, authorization_url : String? = nil, token_url : String? = nil, refresh_url : String? = nil, scopes : Hash(String, String)? = nil, description : String? = nil)
- .oauth2(*, flows : Array(OAuth2Flow)? = nil, description : String? = nil)
Instance Method Summary
- #api_key_name : String?
- #api_key_name=(api_key_name)
- #bearer_format : String?
- #bearer_format=(bearer_format)
- #description : String?
- #description=(description)
-
#key
Transform name to unique key name
-
#name : String
Transform type to String typed and downcase of value
- #oauth2_flows : Array(Swagger::OAuth2Flow)?
- #oauth2_flows=(oauth2_flows)
- #parameter_location : String?
- #parameter_location=(parameter_location)
- #type : Type
Constructor Detail
def self.new(name : String, description : String? = nil, api_key_name : String? = nil, bearer_format : String? = nil, parameter_location : String? = nil)
#
def self.new(name : Type, description : String? = nil, api_key_name : String? = nil, bearer_format : String? = nil, parameter_location : String? = nil, oauth2_flows : Array(OAuth2Flow)? = nil)
#
Class Method Detail
Access with api key auth.
Access with bearer auth.
def self.oauth2(*, grant_type name : String, authorization_url : String? = nil, token_url : String? = nil, refresh_url : String? = nil, scopes : Hash(String, String)? = nil, description : String? = nil)
#
Instance Method Detail
def key
#
Transform name to unique key name
Swagger::Authorization.basic.key # => "basic_auth"
Swagger::Authorization.bearer.key # => "bearer_auth"
Swagger::Authorization.bearer(format: "custom").key # => "custom_auth"
Swagger::Authorization.jwt.key.˙ # => "jwt_auth"
Swagger::Authorization.api_key.key.˙ # => "api_key_auth"
Swagger::Authorization.cookie(name: "JSESSIONID").key.˙ # => "cookie_auth"