diff --git a/adapter/config/default_config.go b/adapter/config/default_config.go
index 2f9a7fb670..c213be916e 100644
--- a/adapter/config/default_config.go
+++ b/adapter/config/default_config.go
@@ -225,6 +225,7 @@ var defaultConfig = &Config{
TestConsoleHeaderName: "Internal-Key",
TempTestConsoleHeaderNames: []string{},
TempTestConsoleHeadersMode: "monitor",
+ DropConsoleTestHeaders: true,
},
},
AuthService: authService{
diff --git a/adapter/config/types.go b/adapter/config/types.go
index 75f7a4f592..65cc9a19ee 100644
--- a/adapter/config/types.go
+++ b/adapter/config/types.go
@@ -494,6 +494,7 @@ type authHeader struct {
TestConsoleHeaderName string
TempTestConsoleHeaderNames []string
TempTestConsoleHeadersMode string
+ DropConsoleTestHeaders bool
}
type jwtIssuer struct {
diff --git a/adapter/internal/discovery/xds/marshaller.go b/adapter/internal/discovery/xds/marshaller.go
index 134ff75e63..9b47801863 100644
--- a/adapter/internal/discovery/xds/marshaller.go
+++ b/adapter/internal/discovery/xds/marshaller.go
@@ -216,6 +216,7 @@ func MarshalConfig(config *config.Config) *enforcer.Config {
TestConsoleHeaderName: config.Enforcer.Security.AuthHeader.TestConsoleHeaderName,
TempTestConsoleHeaderNames: config.Enforcer.Security.AuthHeader.TempTestConsoleHeaderNames,
TempTestConsoleHeadersMode: config.Enforcer.Security.AuthHeader.TempTestConsoleHeadersMode,
+ DropConsoleTestHeaders: config.Enforcer.Security.AuthHeader.DropConsoleTestHeaders,
},
},
Cache: cache,
diff --git a/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/auth_header.pb.go b/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/auth_header.pb.go
index 93726cb8db..56779c6622 100644
--- a/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/auth_header.pb.go
+++ b/adapter/pkg/discovery/api/wso2/discovery/config/enforcer/auth_header.pb.go
@@ -33,6 +33,7 @@ type AuthHeader struct {
TestConsoleHeaderName string `protobuf:"bytes,3,opt,name=testConsoleHeaderName,proto3" json:"testConsoleHeaderName,omitempty"`
TempTestConsoleHeaderNames []string `protobuf:"bytes,4,rep,name=tempTestConsoleHeaderNames,proto3" json:"tempTestConsoleHeaderNames,omitempty"`
TempTestConsoleHeadersMode string `protobuf:"bytes,5,opt,name=tempTestConsoleHeadersMode,proto3" json:"tempTestConsoleHeadersMode,omitempty"`
+ DropConsoleTestHeaders bool `protobuf:"varint,6,opt,name=dropConsoleTestHeaders,proto3" json:"dropConsoleTestHeaders,omitempty"`
}
func (x *AuthHeader) Reset() {
@@ -102,6 +103,13 @@ func (x *AuthHeader) GetTempTestConsoleHeadersMode() string {
return ""
}
+func (x *AuthHeader) GetDropConsoleTestHeaders() bool {
+ if x != nil {
+ return x.DropConsoleTestHeaders
+ }
+ return false
+}
+
var File_wso2_discovery_config_enforcer_auth_header_proto protoreflect.FileDescriptor
var file_wso2_discovery_config_enforcer_auth_header_proto_rawDesc = []byte{
@@ -110,7 +118,7 @@ var file_wso2_discovery_config_enforcer_auth_header_proto_rawDesc = []byte{
0x2f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x1e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65,
0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63,
- 0x65, 0x72, 0x22, 0xb0, 0x02, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65,
+ 0x65, 0x72, 0x22, 0xe8, 0x02, 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x12, 0x3a, 0x0a, 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f,
0x75, 0x6e, 0x64, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f,
@@ -129,17 +137,20 @@ var file_wso2_discovery_config_enforcer_auth_header_proto_rawDesc = []byte{
0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4d,
0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x74, 0x65, 0x6d, 0x70, 0x54,
0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72,
- 0x73, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x96, 0x01, 0x0a, 0x31, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73,
- 0x6f, 0x32, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x65, 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
- 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x42, 0x0f, 0x41, 0x75, 0x74,
- 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4e,
- 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79,
- 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
- 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77, 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63,
- 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66,
- 0x6f, 0x72, 0x63, 0x65, 0x72, 0x3b, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x62, 0x06,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x73, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6e,
+ 0x73, 0x6f, 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18,
+ 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x64, 0x72, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x73, 0x6f,
+ 0x6c, 0x65, 0x54, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x42, 0x96, 0x01,
+ 0x0a, 0x31, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x73, 0x6f, 0x32, 0x2e, 0x63, 0x68, 0x6f, 0x72, 0x65,
+ 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76,
+ 0x65, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x65, 0x6e, 0x66, 0x6f, 0x72,
+ 0x63, 0x65, 0x72, 0x42, 0x0f, 0x41, 0x75, 0x74, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50,
+ 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
+ 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f,
+ 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x77,
+ 0x73, 0x6f, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x3b, 0x65, 0x6e,
+ 0x66, 0x6f, 0x72, 0x63, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/api/proto/wso2/discovery/config/enforcer/auth_header.proto b/api/proto/wso2/discovery/config/enforcer/auth_header.proto
index 3d1ba11621..9d88c26b47 100644
--- a/api/proto/wso2/discovery/config/enforcer/auth_header.proto
+++ b/api/proto/wso2/discovery/config/enforcer/auth_header.proto
@@ -22,4 +22,6 @@ message AuthHeader {
repeated string tempTestConsoleHeaderNames = 4;
string tempTestConsoleHeadersMode = 5;
+
+ bool dropConsoleTestHeaders = 6;
}
diff --git a/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeader.java b/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeader.java
index 9e31b7e731..c031c955aa 100644
--- a/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeader.java
+++ b/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeader.java
@@ -89,6 +89,11 @@ private AuthHeader(
tempTestConsoleHeadersMode_ = s;
break;
}
+ case 48: {
+
+ dropConsoleTestHeaders_ = input.readBool();
+ break;
+ }
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
@@ -296,6 +301,17 @@ public java.lang.String getTempTestConsoleHeadersMode() {
}
}
+ public static final int DROPCONSOLETESTHEADERS_FIELD_NUMBER = 6;
+ private boolean dropConsoleTestHeaders_;
+ /**
+ * bool dropConsoleTestHeaders = 6;
+ * @return The dropConsoleTestHeaders.
+ */
+ @java.lang.Override
+ public boolean getDropConsoleTestHeaders() {
+ return dropConsoleTestHeaders_;
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -325,6 +341,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (!getTempTestConsoleHeadersModeBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, tempTestConsoleHeadersMode_);
}
+ if (dropConsoleTestHeaders_ != false) {
+ output.writeBool(6, dropConsoleTestHeaders_);
+ }
unknownFields.writeTo(output);
}
@@ -355,6 +374,10 @@ public int getSerializedSize() {
if (!getTempTestConsoleHeadersModeBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, tempTestConsoleHeadersMode_);
}
+ if (dropConsoleTestHeaders_ != false) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBoolSize(6, dropConsoleTestHeaders_);
+ }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -380,6 +403,8 @@ public boolean equals(final java.lang.Object obj) {
.equals(other.getTempTestConsoleHeaderNamesList())) return false;
if (!getTempTestConsoleHeadersMode()
.equals(other.getTempTestConsoleHeadersMode())) return false;
+ if (getDropConsoleTestHeaders()
+ != other.getDropConsoleTestHeaders()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@@ -404,6 +429,9 @@ public int hashCode() {
}
hash = (37 * hash) + TEMPTESTCONSOLEHEADERSMODE_FIELD_NUMBER;
hash = (53 * hash) + getTempTestConsoleHeadersMode().hashCode();
+ hash = (37 * hash) + DROPCONSOLETESTHEADERS_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
+ getDropConsoleTestHeaders());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -551,6 +579,8 @@ public Builder clear() {
bitField0_ = (bitField0_ & ~0x00000001);
tempTestConsoleHeadersMode_ = "";
+ dropConsoleTestHeaders_ = false;
+
return this;
}
@@ -587,6 +617,7 @@ public org.wso2.choreo.connect.discovery.config.enforcer.AuthHeader buildPartial
}
result.tempTestConsoleHeaderNames_ = tempTestConsoleHeaderNames_;
result.tempTestConsoleHeadersMode_ = tempTestConsoleHeadersMode_;
+ result.dropConsoleTestHeaders_ = dropConsoleTestHeaders_;
onBuilt();
return result;
}
@@ -660,6 +691,9 @@ public Builder mergeFrom(org.wso2.choreo.connect.discovery.config.enforcer.AuthH
tempTestConsoleHeadersMode_ = other.tempTestConsoleHeadersMode_;
onChanged();
}
+ if (other.getDropConsoleTestHeaders() != false) {
+ setDropConsoleTestHeaders(other.getDropConsoleTestHeaders());
+ }
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
@@ -1090,6 +1124,37 @@ public Builder setTempTestConsoleHeadersModeBytes(
onChanged();
return this;
}
+
+ private boolean dropConsoleTestHeaders_ ;
+ /**
+ * bool dropConsoleTestHeaders = 6;
+ * @return The dropConsoleTestHeaders.
+ */
+ @java.lang.Override
+ public boolean getDropConsoleTestHeaders() {
+ return dropConsoleTestHeaders_;
+ }
+ /**
+ * bool dropConsoleTestHeaders = 6;
+ * @param value The dropConsoleTestHeaders to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDropConsoleTestHeaders(boolean value) {
+
+ dropConsoleTestHeaders_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * bool dropConsoleTestHeaders = 6;
+ * @return This builder for chaining.
+ */
+ public Builder clearDropConsoleTestHeaders() {
+
+ dropConsoleTestHeaders_ = false;
+ onChanged();
+ return this;
+ }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
diff --git a/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderOrBuilder.java b/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderOrBuilder.java
index 82218a9597..5dd2f1c1ed 100644
--- a/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderOrBuilder.java
+++ b/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderOrBuilder.java
@@ -85,4 +85,10 @@ public interface AuthHeaderOrBuilder extends
*/
com.google.protobuf.ByteString
getTempTestConsoleHeadersModeBytes();
+
+ /**
+ * bool dropConsoleTestHeaders = 6;
+ * @return The dropConsoleTestHeaders.
+ */
+ boolean getDropConsoleTestHeaders();
}
diff --git a/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderProto.java b/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderProto.java
index 15b81b86c7..364adac324 100644
--- a/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderProto.java
+++ b/enforcer-parent/enforcer/src/main/gen/org/wso2/choreo/connect/discovery/config/enforcer/AuthHeaderProto.java
@@ -30,15 +30,16 @@ public static void registerAllExtensions(
java.lang.String[] descriptorData = {
"\n0wso2/discovery/config/enforcer/auth_he" +
"ader.proto\022\036wso2.discovery.config.enforc" +
- "er\"\262\001\n\nAuthHeader\022 \n\030enableOutboundAuthH" +
+ "er\"\322\001\n\nAuthHeader\022 \n\030enableOutboundAuthH" +
"eader\030\001 \001(\010\022\033\n\023authorizationHeader\030\002 \001(\t" +
"\022\035\n\025testConsoleHeaderName\030\003 \001(\t\022\"\n\032tempT" +
"estConsoleHeaderNames\030\004 \003(\t\022\"\n\032tempTestC" +
- "onsoleHeadersMode\030\005 \001(\tB\226\001\n1org.wso2.cho" +
- "reo.connect.discovery.config.enforcerB\017A" +
- "uthHeaderProtoP\001ZNgithub.com/envoyproxy/" +
- "go-control-plane/wso2/discovery/config/e" +
- "nforcer;enforcerb\006proto3"
+ "onsoleHeadersMode\030\005 \001(\t\022\036\n\026dropConsoleTe" +
+ "stHeaders\030\006 \001(\010B\226\001\n1org.wso2.choreo.conn" +
+ "ect.discovery.config.enforcerB\017AuthHeade" +
+ "rProtoP\001ZNgithub.com/envoyproxy/go-contr" +
+ "ol-plane/wso2/discovery/config/enforcer;" +
+ "enforcerb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -49,7 +50,7 @@ public static void registerAllExtensions(
internal_static_wso2_discovery_config_enforcer_AuthHeader_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_wso2_discovery_config_enforcer_AuthHeader_descriptor,
- new java.lang.String[] { "EnableOutboundAuthHeader", "AuthorizationHeader", "TestConsoleHeaderName", "TempTestConsoleHeaderNames", "TempTestConsoleHeadersMode", });
+ new java.lang.String[] { "EnableOutboundAuthHeader", "AuthorizationHeader", "TestConsoleHeaderName", "TempTestConsoleHeaderNames", "TempTestConsoleHeadersMode", "DropConsoleTestHeaders", });
}
// @@protoc_insertion_point(outer_class_scope)
diff --git a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/api/Utils.java b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/api/Utils.java
index b7a889fff5..89dab46975 100644
--- a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/api/Utils.java
+++ b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/api/Utils.java
@@ -119,22 +119,25 @@ static void populateRemoveAndProtectedHeaders(RequestContext requestContext) {
// Internal-Key credential is considered to be protected headers, such that the
// header would not be sent
// to backend and traffic manager.
- String internalKeyHeader = ConfigHolder.getInstance().getConfig().getAuthHeader()
- .getTestConsoleHeaderName().toLowerCase();
+ if (ConfigHolder.getInstance().getConfig().getAuthHeader().isDropConsoleTestHeaders()) {
+ String internalKeyHeader = ConfigHolder.getInstance().getConfig().getAuthHeader()
+ .getTestConsoleHeaderName().toLowerCase();
+ requestContext.getRemoveHeaders().add(internalKeyHeader);
+ // Avoid internal key being published to the Traffic Manager
+ requestContext.getProtectedHeaders().add(internalKeyHeader);
+ }
// If the temp test console headers are in active mode,
// then those headers are also removed and considered as protected.
String tempConsoleTestHeadersMode = ConfigHolder.getInstance().getConfig().getAuthHeader()
.getTempTestConsoleTestHeadersMode();
- if (Constants.TEMP_CONSOLE_TEST_HEADERS_ACTIVE_MODE.equals(tempConsoleTestHeadersMode)) {
+ if (Constants.TEMP_CONSOLE_TEST_HEADERS_ACTIVE_MODE.equals(tempConsoleTestHeadersMode) &&
+ ConfigHolder.getInstance().getConfig().getAuthHeader().isDropConsoleTestHeaders()) {
List tempConsoleTestHeaders = ConfigHolder.getInstance().getConfig().getAuthHeader()
.getTempTestConsoleHeaderNames();
requestContext.getRemoveHeaders().addAll(tempConsoleTestHeaders);
requestContext.getProtectedHeaders().addAll(tempConsoleTestHeaders);
}
- requestContext.getRemoveHeaders().add(internalKeyHeader);
- // Avoid internal key being published to the Traffic Manager
- requestContext.getProtectedHeaders().add(internalKeyHeader);
// Remove Authorization Header
AuthHeaderDto authHeader = ConfigHolder.getInstance().getConfig().getAuthHeader();
diff --git a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/ConfigHolder.java b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/ConfigHolder.java
index 8f66e1e938..26bf22c966 100644
--- a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/ConfigHolder.java
+++ b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/ConfigHolder.java
@@ -210,6 +210,7 @@ private void populateAuthHeaderConfigurations(AuthHeader authHeader) {
authHeaderDto.setTestConsoleHeaderName(authHeader.getTestConsoleHeaderName());
authHeaderDto.setTempTestConsoleHeaderNames(authHeader.getTempTestConsoleHeaderNamesList());
authHeaderDto.setTempTestConsoleTestHeadersMode(authHeader.getTempTestConsoleHeadersMode());
+ authHeaderDto.setDropConsoleTestHeaders(authHeader.getDropConsoleTestHeaders());
config.setAuthHeader(authHeaderDto);
}
diff --git a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/dto/AuthHeaderDto.java b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/dto/AuthHeaderDto.java
index 2d0345d7cf..860fa62512 100644
--- a/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/dto/AuthHeaderDto.java
+++ b/enforcer-parent/enforcer/src/main/java/org/wso2/choreo/connect/enforcer/config/dto/AuthHeaderDto.java
@@ -32,6 +32,7 @@ public class AuthHeaderDto {
private String testConsoleHeaderName = "";
private List tempTestConsoleHeaderNames = new ArrayList<>();
private String tempTestConsoleTestHeadersMode = "";
+ private boolean dropConsoleTestHeaders = true;
public String getAuthorizationHeader() {
return authorizationHeader;
@@ -76,4 +77,12 @@ public void setTempTestConsoleTestHeadersMode(String mode) {
public String getTempTestConsoleTestHeadersMode() {
return tempTestConsoleTestHeadersMode;
}
+
+ public boolean isDropConsoleTestHeaders() {
+ return dropConsoleTestHeaders;
+ }
+
+ public void setDropConsoleTestHeaders(boolean dropConsoleTestHeaders) {
+ this.dropConsoleTestHeaders = dropConsoleTestHeaders;
+ }
}
diff --git a/resources/conf/config.toml.template b/resources/conf/config.toml.template
index c1f5ef4146..6380ffc70b 100644
--- a/resources/conf/config.toml.template
+++ b/resources/conf/config.toml.template
@@ -372,6 +372,7 @@ enabled = true
# Temporary additional headers for testConsoleHeaderName
tempTestConsoleHeaderNames = ["test-key"]
tempTestConsoleHeadersMode = "monitor"
+ dropConsoleTestHeaders = true
# JWT token authorization configurations. You can provide multiple JWT issuers
# Issuer 1