mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-16 16:26:16 +02:00
zero: bootstrap config (#4444)
This commit is contained in:
parent
65c0f6b70f
commit
788376bf60
8 changed files with 695 additions and 28 deletions
30
internal/zero/bootstrap/new_test.go
Normal file
30
internal/zero/bootstrap/new_test.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package bootstrap_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/zero/bootstrap"
|
||||
)
|
||||
|
||||
func TestConfigDeterministic(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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue