Skip to content

Commit

Permalink
fix: remove legacy hosted code which changes connectionToken (#5126)
Browse files Browse the repository at this point in the history
  • Loading branch information
BonapartePC authored Sep 26, 2024
1 parent 33b5f63 commit 100b3d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions utils/types/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import (
type Type string // skipcq: RVV-B0009

const (
DedicatedType Type = "DEDICATED"
MultiTenantType Type = "MULTITENANT"
hostedNamespace string = "free-us-1" // Having it here to support legacy cp-router hosted
DedicatedType Type = "DEDICATED"
MultiTenantType Type = "MULTITENANT"
)

// Types of tokens that can be used to authenticate with CP router
Expand Down Expand Up @@ -64,11 +63,6 @@ func GetConnectionToken() (string, string, bool, error) {
isNamespaced := config.IsSet("WORKSPACE_NAMESPACE")
if isNamespaced {
connectionToken = config.GetString("WORKSPACE_NAMESPACE", "")
if connectionToken == hostedNamespace {
// CP Router still has some things hardcoded for hosted
// which needs to be supported
connectionToken = config.GetString("HOSTED_SERVICE_SECRET", "")
}
} else {
if !config.IsSet("HOSTED_SERVICE_SECRET") {
pkgLogger.Error("hosted service secret not set")
Expand Down
2 changes: 1 addition & 1 deletion utils/types/deployment/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func Test_GetConnectionToken(t *testing.T) {
dType: "MULTITENANT",
secret: "secret",
namespace: "free-us-1",
expectedIdentifier: "secret",
expectedIdentifier: "free-us-1",
expectedBool: true,
tokenType: "NAMESPACE",
},
Expand Down

0 comments on commit 100b3d9

Please sign in to comment.