mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
Merge remote-tracking branch 'origin' into 7.0.x
This commit is contained in:
@@ -32,6 +32,7 @@ module Petstore
|
||||
end
|
||||
else
|
||||
super arg
|
||||
@message = arg
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -62,6 +62,16 @@ module Petstore
|
||||
# Defines the access token (Bearer) used with OAuth2.
|
||||
attr_accessor :access_token
|
||||
|
||||
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
||||
# Overrides the access_token if set
|
||||
# @return [Proc]
|
||||
attr_accessor :access_token_getter
|
||||
|
||||
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
||||
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
||||
# Default to false.
|
||||
attr_accessor :return_binary_data
|
||||
|
||||
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
||||
# details will be logged with `logger.debug` (see the `logger` attribute).
|
||||
# Default to false.
|
||||
@@ -208,6 +218,12 @@ module Petstore
|
||||
end
|
||||
end
|
||||
|
||||
# Gets access_token using access_token_getter or uses the static access_token
|
||||
def access_token_with_refresh
|
||||
return access_token if access_token_getter.nil?
|
||||
access_token_getter.call
|
||||
end
|
||||
|
||||
# Gets Basic Auth token string
|
||||
def basic_auth_token
|
||||
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
||||
|
||||
Reference in New Issue
Block a user