Skip to content

Commit

Permalink
Add enforcer changes for API Key
Browse files Browse the repository at this point in the history
  • Loading branch information
sgayangi committed Jul 19, 2024
1 parent c79e328 commit 3845649
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class APIConfig {
private KeyStore trustStore;
private String mutualSSL;
private boolean transportSecurity;
private boolean applicationSecurity;
private Map<String, Boolean> applicationSecurity;
private GraphQLSchemaDTO graphQLSchemaDTO;
private JWTConfigurationDto jwtConfigurationDto;
private boolean systemAPI;
Expand Down Expand Up @@ -220,7 +220,7 @@ public boolean isTransportSecurity() {
*
* @return application security optionality
*/
public boolean getApplicationSecurity() {
public Map<String, Boolean> getApplicationSecurity() {
return applicationSecurity;
}

Expand Down Expand Up @@ -286,7 +286,7 @@ public static class Builder {
private boolean isMockedApi;
private KeyStore trustStore;
private String mutualSSL;
private boolean applicationSecurity;
private Map<String,Boolean> applicationSecurity;
private GraphQLSchemaDTO graphQLSchemaDTO;
private boolean systemAPI;
private byte[] apiDefinition;
Expand Down Expand Up @@ -379,7 +379,7 @@ public Builder mutualSSL(String mutualSSL) {
return this;
}

public Builder applicationSecurity(boolean applicationSecurity) {
public Builder applicationSecurity(Map<String,Boolean> applicationSecurity) {
this.applicationSecurity = applicationSecurity;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public String init(Api api) {
String apiType = api.getApiType();
List<ResourceConfig> resources = new ArrayList<>();
String mutualSSL = api.getMutualSSL();
boolean applicationSecurity = api.getApplicationSecurity();
Map<String, Boolean> applicationSecurity = api.getApplicationSecurityMap();

EndpointCluster endpoints = Utils.processEndpoints(api.getEndpoints());
EndpointSecurity[] endpointSecurity = APIProcessUtils.convertProtoEndpointSecurity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String init(Api api) {
String apiType = api.getApiType();
List<ResourceConfig> resources = new ArrayList<>();
String mutualSSL = api.getMutualSSL();
boolean applicationSecurity = api.getApplicationSecurity();
Map<String, Boolean> applicationSecurity = api.getApplicationSecurityMap();

for (Resource res : api.getResourcesList()) {
for (Operation operation : res.getMethodsList()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class APIConstants {
public static final String AUTHORIZATION_HEADER_BASIC = "Basic";
public static final String API_SECURITY_OAUTH2 = "OAuth2";
public static final String API_SECURITY_BASIC_AUTH = "basic_auth";
public static final String SWAGGER_API_KEY_AUTH_TYPE_NAME = "apiKey";
public static final String API_SECURITY_API_KEY = "\"API Key\"";
public static final String SWAGGER_API_KEY_IN_HEADER = "Header";
public static final String SWAGGER_API_KEY_IN_QUERY = "Query";
public static final String API_SECURITY_MUTUAL_SSL_NAME = "mtls";
Expand Down
Loading

0 comments on commit 3845649

Please sign in to comment.