configure public key and related license variables at build time (#22202)
Instead of being completely hardcoded, public key is now set at build time according to build tag (test key if `testlicensekey` tag is passed to go build, production key otherwise). A `isProdLicensePublicKey` is also available for determining if the prod license key is being used. It is needed for choosing whether to point to production or test environment CWS. The test license key and CWS url values in this value are set to production values in this PR, but will be updated to the test values once we are ready to do the necessary updates to test environment spinwicks.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
346fab1620
Коммит
de63ddfd9b
@@ -241,7 +241,12 @@ const (
|
||||
|
||||
CloudSettingsDefaultCwsURL = "https://customers.mattermost.com"
|
||||
CloudSettingsDefaultCwsAPIURL = "https://portal.internal.prod.cloud.mattermost.com"
|
||||
OpenidSettingsDefaultScope = "profile openid email"
|
||||
// TODO: update to "https://portal.test.cloud.mattermost.com" when ready to use test license key
|
||||
CloudSettingsDefaultCwsURLTest = "https://customers.mattermost.com"
|
||||
// TODO: update to // "https://api.internal.test.cloud.mattermost.com" when ready to use test license key
|
||||
CloudSettingsDefaultCwsAPIURLTest = "https://portal.internal.prod.cloud.mattermost.com"
|
||||
|
||||
OpenidSettingsDefaultScope = "profile openid email"
|
||||
|
||||
LocalModeSocketPath = "/var/tmp/mattermost_local.socket"
|
||||
)
|
||||
@@ -2781,9 +2786,15 @@ type CloudSettings struct {
|
||||
func (s *CloudSettings) SetDefaults() {
|
||||
if s.CWSURL == nil {
|
||||
s.CWSURL = NewString(CloudSettingsDefaultCwsURL)
|
||||
if !isProdLicensePublicKey {
|
||||
s.CWSURL = NewString(CloudSettingsDefaultCwsURLTest)
|
||||
}
|
||||
}
|
||||
if s.CWSAPIURL == nil {
|
||||
s.CWSAPIURL = NewString(CloudSettingsDefaultCwsAPIURL)
|
||||
if !isProdLicensePublicKey {
|
||||
s.CWSAPIURL = NewString(CloudSettingsDefaultCwsAPIURLTest)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
7
model/license_key.go
Обычный файл
7
model/license_key.go
Обычный файл
@@ -0,0 +1,7 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
//go:build !testlicensekey
|
||||
|
||||
package model
|
||||
|
||||
const isProdLicensePublicKey = true
|
||||
7
model/license_key_test_env.go
Обычный файл
7
model/license_key_test_env.go
Обычный файл
@@ -0,0 +1,7 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
//go:build testlicensekey
|
||||
|
||||
package model
|
||||
|
||||
const isProdLicensePublicKey = false
|
||||
Ссылка в новой задаче
Block a user