fix: import cycle issues
This commit is contained in:
3
server/env/env.go
vendored
3
server/env/env.go
vendored
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/authorizerdev/authorizer/server/constants"
|
||||
"github.com/authorizerdev/authorizer/server/crypto"
|
||||
"github.com/authorizerdev/authorizer/server/memorystore"
|
||||
"github.com/authorizerdev/authorizer/server/parsers"
|
||||
"github.com/authorizerdev/authorizer/server/utils"
|
||||
)
|
||||
|
||||
@@ -251,7 +252,7 @@ func InitAllEnv() error {
|
||||
trimVal := strings.TrimSpace(val)
|
||||
if trimVal != "" {
|
||||
if trimVal != "*" {
|
||||
host, port := utils.GetHostParts(trimVal)
|
||||
host, port := parsers.GetHostParts(trimVal)
|
||||
allowedOrigins = append(allowedOrigins, host+":"+port)
|
||||
} else {
|
||||
hasWildCard = true
|
||||
|
3
server/env/persist_env.go
vendored
3
server/env/persist_env.go
vendored
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/authorizerdev/authorizer/server/db/models"
|
||||
"github.com/authorizerdev/authorizer/server/memorystore"
|
||||
"github.com/authorizerdev/authorizer/server/utils"
|
||||
"github.com/authorizerdev/authorizer/server/validators"
|
||||
)
|
||||
|
||||
// GetEnvData returns the env data from database
|
||||
@@ -138,7 +139,7 @@ func PersistEnv() error {
|
||||
case constants.EnvKeyRoles, constants.EnvKeyDefaultRoles, constants.EnvKeyProtectedRoles:
|
||||
envStringArr := strings.Split(envValue, ",")
|
||||
originalValue := utils.ConvertInterfaceToStringSlice(value)
|
||||
if !utils.IsStringArrayEqual(originalValue, envStringArr) {
|
||||
if !validators.IsStringArrayEqual(originalValue, envStringArr) {
|
||||
storeData[key] = envStringArr
|
||||
hasChanged = true
|
||||
}
|
||||
|
Reference in New Issue
Block a user