Skip to content

Commit

Permalink
Merge pull request #11825 from prasa7/master_11
Browse files Browse the repository at this point in the history
Fixed issue - Request always directed to production endpoint when using API Key Only.
  • Loading branch information
Arshardh authored Dec 20, 2024
2 parents 4c9ed32 + 15a14d2 commit a02114f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ private void setApiVelocityContext(API api, VelocityContext context) {
} else {
context.put("apiIsOauthProtected", Boolean.FALSE);
}
//if API is secured with api_Key
if (apiSecurity != null && apiSecurity.contains(APIConstants.API_SECURITY_API_KEY)) {
context.put("apiIsApiKeyProtected", Boolean.TRUE);
} else {
context.put("apiIsApiKeyProtected", Boolean.FALSE);
}
//if API is secured with basic_auth
if (apiSecurity != null && apiSecurity.contains(APIConstants.API_SECURITY_BASIC_AUTH)) {
context.put("apiIsBasicAuthProtected", Boolean.TRUE);
} else {
context.put("apiIsBasicAuthProtected", Boolean.FALSE);
}
if (api.isEnabledSchemaValidation()) {
context.put("enableSchemaValidation", Boolean.TRUE);
} else {
Expand Down

0 comments on commit a02114f

Please sign in to comment.