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

feat: Use service keys for Route configuration keys #3247

Merged
merged 1 commit into from
Mar 10, 2021
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
16 changes: 8 additions & 8 deletions cmd/security-proxy-setup/res/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,44 +55,44 @@ RetryWaitPeriod = "1s"
AuthType = "X-Vault-Token"

[Routes]
[Routes.CoreData]
[Routes.edgex-core-data]
Name = "coredata"
Protocol = "http"
Host = "localhost"
Port = 48080

[Routes.Metadata]
[Routes.edgex-core-metadata]
Name = "metadata"
Protocol = "http"
Host = "localhost"
Port = 48081

[Routes.Command]
[Routes.edgex-core-command]
Name = "command"
Protocol = "http"
Host = "localhost"
Port = 48082

[Routes.Notifications]
[Routes.edgex-support-notifications]
Name = "notifications"
Protocol = "http"
Host = "localhost"
Port = 48060

[Routes.Scheduler]
[Routes.edgex-support-scheduler]
Name = "scheduler"
Protocol = "http"
Host = "localhost"
Port = 48085

[Routes.RulesEngine]
[Routes.rules-engine]
Name = "rulesengine"
Protocol = "http"
Host = "localhost"
Port = 48075

[Routes.VirtualDevice]
[Routes.device-virtual]
Name = "virtualdevice"
Protocol = "http"
Host = "localhost"
Port = 49990
Port = 49990
4 changes: 2 additions & 2 deletions internal/security/proxy/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func (s *Service) initKongService(service *models.KongService) error {

switch resp.StatusCode {
case http.StatusOK, http.StatusCreated:
s.loggingClient.Info(fmt.Sprintf("successful to set up proxy service for %s", service.Name))
s.loggingClient.Info(fmt.Sprintf("successful to set up proxy service for `%s` at `%s:%d`", service.Name, service.Host, service.Port))
break
case http.StatusConflict:
s.loggingClient.Info(fmt.Sprintf("proxy service for %s has been set up", service.Name))
Expand Down Expand Up @@ -382,7 +382,7 @@ func (s *Service) initKongRoutes(r *models.KongRoute, name string) error {
switch resp.StatusCode {
case http.StatusOK, http.StatusCreated, http.StatusConflict:
s.routes[name] = r
s.loggingClient.Info(fmt.Sprintf("successful to set up route for %s", name))
s.loggingClient.Info(fmt.Sprintf("successful to set up route for `%s` at `%v`", name, r.Paths))
break
default:
e := fmt.Sprintf("failed to set up route for %s with error %s", name, resp.Status)
Expand Down