fix: import cycle issues

This commit is contained in:
Lakhan Samani
2022-05-30 11:54:16 +05:30
parent 1146468a03
commit 7e3bd6a721
37 changed files with 349 additions and 239 deletions

3
server/env/env.go vendored
View File

@@ -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

View File

@@ -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
}