Rebrand pkg

This commit is contained in:
Ralf Haferkamp
2025-01-20 10:59:08 +01:00
parent 6fb15725d6
commit e07f0154bb
18 changed files with 52 additions and 52 deletions
+11 -11
View File
@@ -24,12 +24,12 @@ var _ = Describe("Crypto", func() {
if err != nil {
Fail(err.Error())
}
config.Proxy.HTTP.TLSKey = filepath.Join(userConfigDir, "ocis", "server.key")
config.Proxy.HTTP.TLSCert = filepath.Join(userConfigDir, "ocis", "server.cert")
config.Proxy.HTTP.TLSKey = filepath.Join(userConfigDir, "opencloud", "server.key")
config.Proxy.HTTP.TLSCert = filepath.Join(userConfigDir, "opencloud", "server.cert")
})
AfterEach(func() {
if err := os.RemoveAll(filepath.Join(userConfigDir, "ocis")); err != nil {
if err := os.RemoveAll(filepath.Join(userConfigDir, "opencloud")); err != nil {
Fail(err.Error())
}
})
@@ -38,17 +38,17 @@ var _ = Describe("Crypto", func() {
// for the key / certificate pair in case none is configured. Regardless of how the values ended in the configuration,
// the side effects of GenCert is what we want to test.
Describe("Creating key / certificate pair", func() {
Context("For ocis-proxy in the location of the user config directory", func() {
It(fmt.Sprintf("Creates the cert / key tuple in: %s", filepath.Join(userConfigDir, "ocis")), func() {
Context("For the proxy service in the location of the user config directory", func() {
It(fmt.Sprintf("Creates the cert / key tuple in: %s", filepath.Join(userConfigDir, "opencloud")), func() {
if err := crypto.GenCert(config.Proxy.HTTP.TLSCert, config.Proxy.HTTP.TLSKey, log.NopLogger()); err != nil {
Fail(err.Error())
}
if _, err := os.Stat(filepath.Join(userConfigDir, "ocis", "server.key")); err != nil {
if _, err := os.Stat(filepath.Join(userConfigDir, "opencloud", "server.key")); err != nil {
Fail("key not found at the expected location")
}
if _, err := os.Stat(filepath.Join(userConfigDir, "ocis", "server.cert")); err != nil {
if _, err := os.Stat(filepath.Join(userConfigDir, "opencloud", "server.cert")); err != nil {
Fail("certificate not found at the expected location")
}
})
@@ -62,10 +62,10 @@ var _ = Describe("Crypto", func() {
keyTwo string
)
BeforeEach(func() {
crtOne = filepath.Join(userConfigDir, "ocis/one.cert")
keyOne = filepath.Join(userConfigDir, "ocis/one.key")
crtTwo = filepath.Join(userConfigDir, "ocis/two.cert")
keyTwo = filepath.Join(userConfigDir, "ocis/two.key")
crtOne = filepath.Join(userConfigDir, "opencloud/one.cert")
keyOne = filepath.Join(userConfigDir, "opencloud/one.key")
crtTwo = filepath.Join(userConfigDir, "opencloud/two.cert")
keyTwo = filepath.Join(userConfigDir, "opencloud/two.key")
if err := crypto.GenCert(crtOne, keyOne, log.NopLogger()); err != nil {
Fail(err.Error())
}
+2 -2
View File
@@ -51,7 +51,7 @@ func TestPersistKey(t *testing.T) {
p256 := elliptic.P256()
var (
tmpDir = t.TempDir()
keyPath = filepath.Join(tmpDir, "ocis", "testKey")
keyPath = filepath.Join(tmpDir, "opencloud", "testKey")
rsaPk, _ = rsa.GenerateKey(rand.Reader, 2048)
ecdsaPk, _ = ecdsa.GenerateKey(p256, rand.Reader)
)
@@ -97,7 +97,7 @@ func TestPersistCertificate(t *testing.T) {
p256 := elliptic.P256()
var (
tmpDir = t.TempDir()
certPath = filepath.Join(tmpDir, "ocis", "testCert")
certPath = filepath.Join(tmpDir, "opencloud", "testCert")
rsaPk, _ = rsa.GenerateKey(rand.Reader, 2048)
ecdsaPk, _ = ecdsa.GenerateKey(p256, rand.Reader)
)