mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 14:40:53 +00:00
skip client id, secret validation to allow multiple auth schemas (#13126)
This commit is contained in:
parent
fb29284a99
commit
3c4948ac08
@ -438,17 +438,6 @@
|
||||
{{/isApiKey}}
|
||||
{{#isOAuth}}
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
{{#useDefaultExceptionHandling}}
|
||||
stop("oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `{{{operationId}}}`.")
|
||||
{{/useDefaultExceptionHandling}}
|
||||
{{#useRlangExceptionHandling}}
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `{{{operationId}}}`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `{{{operationId}}}`."))
|
||||
{{/useRlangExceptionHandling}}
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "{{#scopes}}{{scope}}{{^-last}} {{/-last}}{{/scopes}}"
|
||||
{{/isOAuth}}
|
||||
|
@ -276,7 +276,7 @@ ApiClient <- R6::R6Class(
|
||||
|
||||
{{#hasOAuthMethods}}
|
||||
# use oauth authentication if the endpoint requires it
|
||||
if (is_oauth) {
|
||||
if (is_oauth && !is.null(self$oauth_client_id) && !is.null(self$oauth_secret)) {
|
||||
client <- oauth_client(
|
||||
id = self$oauth_client_id,
|
||||
secret = obfuscated(self$oauth_secret),
|
||||
|
@ -267,7 +267,7 @@ ApiClient <- R6::R6Class(
|
||||
req <- req %>% req_method(method)
|
||||
|
||||
# use oauth authentication if the endpoint requires it
|
||||
if (is_oauth) {
|
||||
if (is_oauth && !is.null(self$oauth_client_id) && !is.null(self$oauth_secret)) {
|
||||
client <- oauth_client(
|
||||
id = self$oauth_client_id,
|
||||
secret = obfuscated(self$oauth_secret),
|
||||
|
@ -776,12 +776,6 @@ PetApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `delete_pet`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `delete_pet`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "write:pets read:pets"
|
||||
|
||||
@ -887,12 +881,6 @@ PetApi <- R6::R6Class(
|
||||
|
||||
local_var_url_path <- "/pet/findByStatus"
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `find_pets_by_status`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `find_pets_by_status`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "read:pets"
|
||||
|
||||
@ -1011,12 +999,6 @@ PetApi <- R6::R6Class(
|
||||
|
||||
local_var_url_path <- "/pet/findByTags"
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `find_pets_by_tags`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `find_pets_by_tags`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "read:pets"
|
||||
|
||||
@ -1522,12 +1504,6 @@ PetApi <- R6::R6Class(
|
||||
|
||||
local_var_url_path <- "/pet"
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `update_pet`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `update_pet`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "write:pets read:pets"
|
||||
|
||||
@ -1766,12 +1742,6 @@ PetApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `upload_file`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `upload_file`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "write:pets read:pets"
|
||||
|
||||
|
@ -776,12 +776,6 @@ PetApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `DeletePet`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `DeletePet`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "write:pets read:pets"
|
||||
|
||||
@ -887,12 +881,6 @@ PetApi <- R6::R6Class(
|
||||
|
||||
local_var_url_path <- "/pet/findByStatus"
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `FindPetsByStatus`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `FindPetsByStatus`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "read:pets"
|
||||
|
||||
@ -1011,12 +999,6 @@ PetApi <- R6::R6Class(
|
||||
|
||||
local_var_url_path <- "/pet/findByTags"
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `FindPetsByTags`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `FindPetsByTags`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "read:pets"
|
||||
|
||||
@ -1522,12 +1504,6 @@ PetApi <- R6::R6Class(
|
||||
|
||||
local_var_url_path <- "/pet"
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `UpdatePet`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `UpdatePet`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "write:pets read:pets"
|
||||
|
||||
@ -1766,12 +1742,6 @@ PetApi <- R6::R6Class(
|
||||
}
|
||||
|
||||
# OAuth-related settings
|
||||
if (is.null(self$api_client$oauth_client_id) || is.null(self$api_client$oauth_secret)) {
|
||||
rlang::abort(message = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `UploadFile`.",
|
||||
.subclass = "ApiException",
|
||||
ApiException = ApiException$new(status = 0,
|
||||
reason = "oauth_client_id, oauth_secret in `api_client` must be set for authentication in the endpoint `UploadFile`."))
|
||||
}
|
||||
is_oauth <- TRUE
|
||||
oauth_scopes <- "write:pets read:pets"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user