mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +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
|
package configuration
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/caos/orbos/mntr"
|
"github.com/caos/orbos/mntr"
|
||||||
"github.com/caos/orbos/pkg/kubernetes"
|
"github.com/caos/orbos/pkg/kubernetes"
|
||||||
"github.com/caos/orbos/pkg/kubernetes/resources/configmap"
|
"github.com/caos/orbos/pkg/kubernetes/resources/configmap"
|
||||||
@ -11,6 +9,7 @@ import (
|
|||||||
"github.com/caos/zitadel/operator"
|
"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/configuration/users"
|
||||||
"github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/database"
|
"github.com/caos/zitadel/operator/zitadel/kinds/iam/zitadel/database"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConsoleEnv struct {
|
type ConsoleEnv struct {
|
||||||
@ -18,6 +17,7 @@ type ConsoleEnv struct {
|
|||||||
MgmtServiceURL string `json:"mgmtServiceUrl"`
|
MgmtServiceURL string `json:"mgmtServiceUrl"`
|
||||||
Issuer string `json:"issuer"`
|
Issuer string `json:"issuer"`
|
||||||
ClientID string `json:"clientid"`
|
ClientID string `json:"clientid"`
|
||||||
|
SubServiceURL string `json:"subscriptionServiceUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -26,6 +26,7 @@ type Subdomains struct {
|
|||||||
API string `yaml:"api"`
|
API string `yaml:"api"`
|
||||||
Console string `yaml:"console"`
|
Console string `yaml:"console"`
|
||||||
Issuer string `yaml:"issuer"`
|
Issuer string `yaml:"issuer"`
|
||||||
|
Subscription string `yaml:"subscription"`
|
||||||
}
|
}
|
||||||
type Passwords struct {
|
type Passwords struct {
|
||||||
Migration *secret.Secret `yaml:"migration"`
|
Migration *secret.Secret `yaml:"migration"`
|
||||||
|
@ -199,6 +199,7 @@ func literalsConsoleCM(
|
|||||||
consoleEnv.Issuer = "https://" + dns.Subdomains.Issuer + "." + dns.Domain
|
consoleEnv.Issuer = "https://" + dns.Subdomains.Issuer + "." + dns.Domain
|
||||||
consoleEnv.AuthServiceURL = "https://" + dns.Subdomains.API + "." + dns.Domain
|
consoleEnv.AuthServiceURL = "https://" + dns.Subdomains.API + "." + dns.Domain
|
||||||
consoleEnv.MgmtServiceURL = "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)
|
data, err := json.Marshal(consoleEnv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -66,6 +66,7 @@ var (
|
|||||||
API: "",
|
API: "",
|
||||||
Console: "",
|
Console: "",
|
||||||
Issuer: "",
|
Issuer: "",
|
||||||
|
Subscription: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ClusterDNS: "",
|
ClusterDNS: "",
|
||||||
@ -123,6 +124,7 @@ var (
|
|||||||
API: "api",
|
API: "api",
|
||||||
Console: "console",
|
Console: "console",
|
||||||
Issuer: "issuer",
|
Issuer: "issuer",
|
||||||
|
Subscription: "sub",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ClusterDNS: "cluster",
|
ClusterDNS: "cluster",
|
||||||
@ -179,6 +181,7 @@ var (
|
|||||||
API: "api",
|
API: "api",
|
||||||
Console: "console",
|
Console: "console",
|
||||||
Issuer: "issuer",
|
Issuer: "issuer",
|
||||||
|
Subscription: "sub",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ClusterDNS: "cluster",
|
ClusterDNS: "cluster",
|
||||||
@ -496,10 +499,10 @@ func TestConfiguration_LiteralsConsoleCM(t *testing.T) {
|
|||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Name: cmName,
|
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)
|
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||||
|
|
||||||
literals := literalsConsoleCM(clientID, desiredEmpty.DNS, k8sClient, namespace, cmName)
|
literals := literalsConsoleCM(clientID, desiredEmpty.DNS, k8sClient, namespace, cmName)
|
||||||
@ -521,7 +524,7 @@ func TestConfiguration_LiteralsConsoleCMFull(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
equals := map[string]string{
|
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)
|
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||||
|
|
||||||
@ -541,12 +544,12 @@ func TestConfiguration_LiteralsConsoleCMWithCM(t *testing.T) {
|
|||||||
Name: cmName,
|
Name: cmName,
|
||||||
},
|
},
|
||||||
Data: map[string]string{
|
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{
|
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)
|
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||||
|
|
||||||
@ -566,12 +569,12 @@ func TestConfiguration_LiteralsConsoleCMWithCMFull(t *testing.T) {
|
|||||||
Name: cmName,
|
Name: cmName,
|
||||||
},
|
},
|
||||||
Data: map[string]string{
|
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{
|
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)
|
k8sClient.EXPECT().GetConfigMap(namespace, cmName).Times(1).Return(cm, nil)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user