Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce temporary configs to support multiple headers for the Console testing #3578

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions adapter/config/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var defaultConfig = &Config{
},
Retry: upstreamRetry{
MaxRetryCount: 5,
RetryOn: "connect-failure",
RetryOn: "connect-failure",
BaseInterval: 25 * time.Millisecond,
MaxInterval: 500 * time.Millisecond,
StatusCodes: []uint32{504},
Expand Down Expand Up @@ -202,9 +202,11 @@ var defaultConfig = &Config{
},
},
AuthHeader: authHeader{
EnableOutboundAuthHeader: false,
AuthorizationHeader: "authorization",
TestConsoleHeaderName: "Internal-Key",
EnableOutboundAuthHeader: false,
AuthorizationHeader: "authorization",
TestConsoleHeaderName: "Internal-Key",
TempTestConsoleHeaderNames: []string{},
TempTestConsoleHeadersMode: "monitor",
},
},
AuthService: authService{
Expand Down
8 changes: 5 additions & 3 deletions adapter/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,11 @@ type analyticsEnforcer struct {
}

type authHeader struct {
EnableOutboundAuthHeader bool
AuthorizationHeader string
TestConsoleHeaderName string
EnableOutboundAuthHeader bool
AuthorizationHeader string
TestConsoleHeaderName string
TempTestConsoleHeaderNames []string
TempTestConsoleHeadersMode string
}

type jwtIssuer struct {
Expand Down
8 changes: 5 additions & 3 deletions adapter/internal/discovery/xds/marshaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ func MarshalConfig(config *config.Config) *enforcer.Config {
Security: &enforcer.Security{
TokenService: issuers,
AuthHeader: &enforcer.AuthHeader{
EnableOutboundAuthHeader: config.Enforcer.Security.AuthHeader.EnableOutboundAuthHeader,
AuthorizationHeader: config.Enforcer.Security.AuthHeader.AuthorizationHeader,
TestConsoleHeaderName: config.Enforcer.Security.AuthHeader.TestConsoleHeaderName,
EnableOutboundAuthHeader: config.Enforcer.Security.AuthHeader.EnableOutboundAuthHeader,
AuthorizationHeader: config.Enforcer.Security.AuthHeader.AuthorizationHeader,
TestConsoleHeaderName: config.Enforcer.Security.AuthHeader.TestConsoleHeaderName,
TempTestConsoleHeaderNames: config.Enforcer.Security.AuthHeader.TempTestConsoleHeaderNames,
TempTestConsoleHeadersMode: config.Enforcer.Security.AuthHeader.TempTestConsoleHeadersMode,
},
},
Cache: cache,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/proto/wso2/discovery/config/enforcer/auth_header.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ message AuthHeader {
string authorizationHeader = 2;

string testConsoleHeaderName = 3;

repeated string tempTestConsoleHeaderNames = 4;

string tempTestConsoleHeadersMode = 5;
}
Loading
Loading