Preserve order of securitySchemes (#14536)

* Remove alphabetical sort

* Update integration testing expectations

* Regenerate files
This commit is contained in:
Beppe Catanese
2023-02-10 15:20:19 +01:00
committed by GitHub
parent 1b60ee1799
commit 68b944e6e6
308 changed files with 4019 additions and 4014 deletions

View File

@@ -341,6 +341,11 @@ sub update_params_for_auth {
if (!defined($auth)) {
# TODO show warning about auth setting not defined
}
elsif ($auth eq 'petstore_auth') {
if ($self->{config}{access_token}) {
$header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token};
}
}
elsif ($auth eq 'api_key') {
my $api_key = $self->get_api_key_with_prefix('api_key');
if ($api_key) {
@@ -353,24 +358,19 @@ sub update_params_for_auth {
$query_params->{'api_key_query'} = $api_key;
}
}
elsif ($auth eq 'http_basic_test') {
if ($self->{config}{username} || $self->{config}{password}) {
$header_params->{'Authorization'} = 'Basic ' . encode_base64($self->{config}{username} . ":" . $self->{config}{password});
}
}
elsif ($auth eq 'bearer_test') {
# this endpoint requires Bearer (JWT) authentication (access token)
if ($self->{config}{access_token}) {
$header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token};
}
}
elsif ($auth eq 'http_basic_test') {
if ($self->{config}{username} || $self->{config}{password}) {
$header_params->{'Authorization'} = 'Basic ' . encode_base64($self->{config}{username} . ":" . $self->{config}{password});
}
}
elsif ($auth eq 'http_signature_test') {
}
elsif ($auth eq 'petstore_auth') {
if ($self->{config}{access_token}) {
$header_params->{'Authorization'} = 'Bearer ' . $self->{config}{access_token};
}
}
else {
# TODO show warning about security definition not found
}