Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Milanka00 committed Jun 21, 2024
1 parent a2be836 commit 79c110f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions adapter/config/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ var defaultConfig = &Config{
SecuredListenerHost: "0.0.0.0",
SecuredListenerPort: 9095,
NewListenerHost: "0.0.0.0",
NewListenerPort: 9096,
NewListenerPort: 9096,
ClusterTimeoutInSeconds: 20,
EnforcerResponseTimeoutInSeconds: 20,
MaximumResourcePathLengthInKB: -1,
Expand Down Expand Up @@ -166,7 +166,6 @@ var defaultConfig = &Config{
Enabled: true,
Host: "varnish",
Port: 80,

},
Enforcer: enforcer{
Management: management{
Expand Down
12 changes: 6 additions & 6 deletions adapter/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type Config struct {
GlobalAdapter globalAdapter `toml:"globalAdapter"`
Analytics analytics `toml:"analytics"`
Tracing tracing
Varnish varnish
Varnish varnish
}

// Adapter related Configurations
Expand Down Expand Up @@ -113,8 +113,8 @@ type envoy struct {
ListenerPort uint32
SecuredListenerHost string
SecuredListenerPort uint32
NewListenerHost string
NewListenerPort uint32
NewListenerHost string
NewListenerPort uint32
ClusterTimeoutInSeconds time.Duration
EnforcerResponseTimeoutInSeconds time.Duration `default:"20"`
KeyStore keystore
Expand Down Expand Up @@ -152,9 +152,9 @@ type rateLimit struct {
}

type varnish struct{
Enabled bool
Host string
Port uint32
Enabled bool
Host string
Port uint32
}

type xRateLimitHeaders struct {
Expand Down
6 changes: 3 additions & 3 deletions adapter/internal/oasparser/envoyconf/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const (
accessLoggerClusterName string = "access-logger"
grpcAccessLogLogName string = "mgw_access_logs"
tracingClusterName string = "wso2_cc_trace"
extAuthzHTTPCluster string = "ext_authz_http_cluster"
rateLimitClusterName string = "rate-limit"
varnishClusterName string = "varnish"
extAuthzHTTPCluster string = "ext_authz_http_cluster"
rateLimitClusterName string = "rate-limit"
varnishClusterName string = "varnish"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions adapter/internal/oasparser/envoyconf/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func createListeners(conf *config.Config) []*listenerv3.Listener {
var listeners []*listenerv3.Listener

//creating the manager for exisitng listener
manager := createHttpConnectionManager(httpFilters, upgradeFilters, accessLogs, conf)
manager := createHTTPConnectionManager(httpFilters, upgradeFilters, accessLogs, conf)
pbst, err := anypb.New(manager)
if err != nil {
logger.LoggerOasparser.Fatal(err)
Expand All @@ -101,7 +101,7 @@ func createListeners(conf *config.Config) []*listenerv3.Listener {
filters = append(filters, &connectionManagerFilterP)

// Creating the new manager for new listener
newManager := createHttpConnectionManager(router, router, accessLogs, conf)
newManager := createHTTPConnectionManager(router, router, accessLogs, conf)
pbstNewManager, err := anypb.New(newManager)
if err != nil {
logger.LoggerOasparser.Fatal(err)
Expand Down Expand Up @@ -328,7 +328,7 @@ func getTracing(conf *config.Config) (*hcmv3.HttpConnectionManager_Tracing, erro
}

// function to create http managers
func createHttpConnectionManager(httpFilters []*hcmv3.HttpFilter, upgradeFilters []*hcmv3.HttpFilter, accessLogs []*config_access_logv3.AccessLog, conf *config.Config) *hcmv3.HttpConnectionManager {
func createHTTPConnectionManager(httpFilters []*hcmv3.HttpFilter, upgradeFilters []*hcmv3.HttpFilter, accessLogs []*config_access_logv3.AccessLog, conf *config.Config) *hcmv3.HttpConnectionManager {
manager := &hcmv3.HttpConnectionManager{
CodecType: hcmv3.HttpConnectionManager_AUTO,
StatPrefix: httpConManagerStartPrefix,
Expand Down
2 changes: 1 addition & 1 deletion adapter/internal/oasparser/envoyconf/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestCreateListenerWithRds(t *testing.T) {
// TODO: (Vajira) Add more test scenarios
listeners := CreateListenersWithRds()
assert.NotEmpty(t, listeners, "Listeners creation has been failed")
assert.Equal(t, 2, len(listeners), "Two listeners are not created.")
assert.Equal(t, 3, len(listeners), "Two listeners are not created.")

securedListener := listeners[0]
if securedListener.Validate() != nil {
Expand Down

0 comments on commit 79c110f

Please sign in to comment.