mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: added console environment attribute for subscription service (#1620)
* fix: add subscription service url to console environment json * fix: corrected missed unit-tests * fix: show edit button on new orgs (#1606) * fix: reset login_policy views (to ensure defaults) (#1605) * fix: reset login_policy views (to ensure defaults) * fix: migration 1.37 Co-authored-by: Max Peintner <max@caos.ch> Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
parent
2c20292b24
commit
1f72eaab82
@ -1,8 +1,6 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/caos/orbos/mntr"
|
||||
"github.com/caos/orbos/pkg/kubernetes"
|
||||
"github.com/caos/orbos/pkg/kubernetes/resources/configmap"
|
||||
@ -11,6 +9,7 @@ import (
|
||||
"github.com/caos/zitadel/operator"
|
||||
"github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/configuration/users"
|
||||
"github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/database"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ConsoleEnv struct {
|
||||
@ -18,6 +17,7 @@ type ConsoleEnv struct {
|
||||
MgmtServiceURL string `json:"mgmtServiceUrl"`
|
||||
Issuer string `json:"issuer"`
|
||||
ClientID string `json:"clientid"`
|
||||
SubServiceURL string `json:"subscriptionServiceUrl"`
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -22,10 +22,11 @@ type DNS struct {
|
||||
}
|
||||
|
||||
type Subdomains struct {
|
||||
Accounts string `yaml:"accounts"`
|
||||
API string `yaml:"api"`
|
||||
Console string `yaml:"console"`
|
||||
Issuer string `yaml:"issuer"`
|
||||
Accounts string `yaml:"accounts"`
|
||||
API string `yaml:"api"`
|
||||
Console string `yaml:"console"`
|
||||
Issuer string `yaml:"issuer"`
|
||||
Subscription string `yaml:"subscription"`
|
||||
}
|
||||
type Passwords struct {
|
||||
Migration *secret.Secret `yaml:"migration"`
|
||||
|
@ -199,6 +199,7 @@ func literalsConsoleCM(
|
||||
consoleEnv.Issuer = "https://" + dns.Subdomains.Issuer + "." + dns.Domain
|
||||
consoleEnv.AuthServiceURL = "https://" + dns.Subdomains.API + "." + dns.Domain
|
||||
consoleEnv.MgmtServiceURL = "https://" + dns.Subdomains.API + "." + dns.Domain
|
||||
consoleEnv.SubServiceURL = "https://" + dns.Subdomains.Subscription + "." + dns.Domain
|
||||
|
||||
data, err := json.Marshal(consoleEnv)
|
||||
if err != nil {
|
||||
|
@ -62,10 +62,11 @@ var (
|
||||
Domain: "",
|
||||
TlsSecret: "",
|
||||
Subdomains: &Subdomains{
|
||||
Accounts: "",
|
||||
API: "",
|
||||
Console: "",
|
||||
Issuer: "",
|
||||
Accounts: "",
|
||||
API: "",
|
||||
Console: "",
|
||||
Issuer: "",
|
||||
Subscription: "",
|
||||
},
|
||||
},
|
||||
ClusterDNS: "",
|
||||
@ -119,10 +120,11 @@ var (
|
||||
Domain: "domain",
|
||||
TlsSecret: "tls",
|
||||
Subdomains: &Subdomains{
|
||||
Accounts: "accounts",
|
||||
API: "api",
|
||||
Console: "console",
|
||||
Issuer: "issuer",
|
||||
Accounts: "accounts",
|
||||
API: "api",
|
||||
Console: "console",
|
||||
Issuer: "issuer",
|
||||
Subscription: "sub",
|
||||
},
|
||||
},
|
||||
ClusterDNS: "cluster",
|
||||
@ -175,10 +177,11 @@ var (
|
||||
Domain: "domain",
|
||||
TlsSecret: "tls",
|
||||
Subdomains: &Subdomains{
|
||||
Accounts: "accounts",
|
||||
API: "api",
|
||||
Console: "console",
|
||||
Issuer: "issuer",
|
||||
Accounts: "accounts",
|
||||
API: "api",
|
||||
Console: "console",
|
||||
Issuer: "issuer",
|
||||
Subscription: "sub",
|
||||
},
|
||||
},
|
||||
ClusterDNS: "cluster",
|
||||
@ -496,10 +499,10 @@ func TestConfiguration_LiteralsConsoleCM(t *testing.T) {
|
||||
Namespace: namespace,
|
||||
Name: cmName,
|
||||
},
|
||||
Data: map[string]string{"environment.json": "{\"authServiceUrl\":\"https://.\",\"mgmtServiceUrl\":\"https://.\",\"issuer\":\"https://.\",\"clientid\":\"\"}"},
|
||||
Data: map[string]string{"environment.json": "{\"authServiceUrl\":\"https://.\",\"mgmtServiceUrl\":\"https://.\",\"issuer\":\"https://.\",\"clientid\":\"\",\"subscriptionServiceUrl\":\"https://.\"}"},
|
||||
}
|
||||
|
||||
equals := map[string]string{"environment.json": "{\"authServiceUrl\":\"https://.\",\"mgmtServiceUrl\":\"https://.\",\"issuer\":\"https://.\",\"clientid\":\"\"}"}
|
||||
equals := map[string]string{"environment.json": "{\"authServiceUrl\":\"https://.\",\"mgmtServiceUrl\":\"https://.\",\"issuer\":\"https://.\",\"clientid\":\"\",\"subscriptionServiceUrl\":\"https://.\"}"}
|
||||
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||
|
||||
literals := literalsConsoleCM(clientID, desiredEmpty.DNS, k8sClient, namespace, cmName)
|
||||
@ -521,7 +524,7 @@ func TestConfiguration_LiteralsConsoleCMFull(t *testing.T) {
|
||||
}
|
||||
|
||||
equals := map[string]string{
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\"}",
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\",\"subscriptionServiceUrl\":\"https://sub.domain\"}",
|
||||
}
|
||||
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||
|
||||
@ -541,12 +544,12 @@ func TestConfiguration_LiteralsConsoleCMWithCM(t *testing.T) {
|
||||
Name: cmName,
|
||||
},
|
||||
Data: map[string]string{
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"\"}",
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"\",\"subscriptionServiceUrl\":\"https://sub.domain\"}",
|
||||
},
|
||||
}
|
||||
|
||||
equals := map[string]string{
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\"}",
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\",\"subscriptionServiceUrl\":\"https://sub.domain\"}",
|
||||
}
|
||||
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||
|
||||
@ -566,12 +569,12 @@ func TestConfiguration_LiteralsConsoleCMWithCMFull(t *testing.T) {
|
||||
Name: cmName,
|
||||
},
|
||||
Data: map[string]string{
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\"}",
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\",\"subscriptionServiceUrl\":\"https://sub.domain\"}",
|
||||
},
|
||||
}
|
||||
|
||||
equals := map[string]string{
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\"}",
|
||||
"environment.json": "{\"authServiceUrl\":\"https://api.domain\",\"mgmtServiceUrl\":\"https://api.domain\",\"issuer\":\"https://issuer.domain\",\"clientid\":\"test\",\"subscriptionServiceUrl\":\"https://sub.domain\"}",
|
||||
}
|
||||
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user