Skip to content

Commit 842e60a

Browse files
committed
refactor(license): simplify license verification logic by removing unnecessary project ID checks and using IsMarbleSaasProject function
1 parent 47e4cc8 commit 842e60a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

infra/verify_license.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"io"
66
"log"
77
"net/http"
8-
"slices"
98
"time"
109

1110
"github.com/avast/retry-go/v4"
@@ -23,12 +22,11 @@ const (
2322
// the license or reading the GCP project id
2423
func VerifyLicense(config models.LicenseConfiguration) models.LicenseValidation {
2524
if config.LicenseKey == "" {
26-
projectId, err := GetProjectId()
27-
isWhitelisted := slices.Contains(MarbleSaasProjectIds, projectId)
28-
if config.KillIfReadLicenseError && (err != nil || !isWhitelisted) {
25+
isMarbleSaasProject := IsMarbleSaasProject()
26+
if config.KillIfReadLicenseError && !isMarbleSaasProject {
2927
log.Fatalln("License key or project id not found, exiting")
3028
}
31-
if isWhitelisted {
29+
if isMarbleSaasProject {
3230
fullLicense := models.NewFullLicense()
3331
fullLicense.IsManagedMarble = true
3432
return fullLicense

0 commit comments

Comments
 (0)