struct Swagger::Authorization

Overview

Define a authentication

Avaibled authentication in Type

Defined in:

swagger/authorization.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : String, description : String | Nil = nil, api_key_name : String | Nil = nil, bearer_format : String | Nil = nil, parameter_location : String | Nil = nil) #

[View source]
def self.new(name : Type, description : String | Nil = nil, api_key_name : String | Nil = nil, bearer_format : String | Nil = nil, parameter_location : String | Nil = nil, oauth2_flows : Array(OAuth2Flow) | Nil = nil) #

[View source]

Class Method Detail

def self.api_key(*, name : String, location = "header", description : String | Nil = nil) #

Access with api key auth.


[View source]
def self.basic(description : String | Nil = nil) #

Access with basic auth.


[View source]
def self.bearer(*, format : String | Nil = nil, description : String | Nil = nil) #

Access with bearer auth.


[View source]
def self.cookie(*, name : String, description : String | Nil = nil) #

Access with cookie auth.


[View source]
def self.jwt(description : String | Nil = nil) #

Access with jwt auth.


[View source]
def self.none(description : String | Nil = nil) #

Access without any authorization.


[View source]
def self.oauth2(*, grant_type name : String, authorization_url : String | Nil = nil, token_url : String | Nil = nil, refresh_url : String | Nil = nil, scopes : Hash(String, String) | Nil = nil, description : String | Nil = nil) #

[View source]
def self.oauth2(*, flows : Array(OAuth2Flow) | Nil = nil, description : String | Nil = nil) #

[View source]

Instance Method Detail

def api_key_name : String? #

[View source]
def api_key_name=(api_key_name : Nil | String) #

[View source]
def bearer_format : String? #

[View source]
def bearer_format=(bearer_format : Nil | String) #

[View source]
def description : String? #

[View source]
def description=(description : Nil | String) #

[View source]
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"

[View source]
def name : String #

Transform type to String typed and downcase of value


[View source]
def oauth2_flows : Array(Swagger::OAuth2Flow)? #

[View source]
def oauth2_flows=(oauth2_flows : Nil | Array(Swagger::OAuth2Flow)) #

[View source]
def parameter_location : String? #

[View source]
def parameter_location=(parameter_location : Nil | String) #

[View source]
def type : Type #

[View source]