zero: bootstrap config

This commit is contained in:
Denis Mishin 2023-08-07 22:16:32 -04:00
parent 0affd9268b
commit 40efa26257
9 changed files with 638 additions and 30 deletions

View file

@ -0,0 +1,29 @@
package bootstrap_test
import (
"testing"
"github.com/pomerium/pomerium/internal/zero/bootstrap"
"github.com/stretchr/testify/require"
)
func TestFile(t *testing.T) {
secret := []byte("secret")
src, err := bootstrap.New(secret)
require.NoError(t, err)
cfg := src.GetConfig()
require.NotNil(t, cfg)
// test that the config is valid
require.NoError(t, cfg.Options.Validate())
// test that the config is deterministic
src2, err := bootstrap.New(secret)
require.NoError(t, err)
cfg2 := src2.GetConfig()
require.NotNil(t, cfg2)
require.Equal(t, cfg.Options, cfg2.Options)
}