End to bridge encryption implementation

So far this is passing my basic tests, but could use some testing from people
that are much more familiar with how this is supposed to work.

Refs #27
This commit is contained in:
Gary Kramlich
2022-04-20 06:01:26 -05:00
parent 145c0cc2cb
commit c5f58afe71
22 changed files with 848 additions and 58 deletions

29
config/encryption.go Normal file
View File

@@ -0,0 +1,29 @@
package config
type encryption struct {
Allow bool `yaml:"allow"`
Default bool `yaml:"default"`
KeySharing struct {
Allow bool `yaml:"allow"`
RequireCrossSigning bool `yaml:"require_cross_signing"`
RequireVerification bool `yaml:"require_verification"`
} `yaml:"key_sharing"`
}
func (e *encryption) validate() error {
return nil
}
func (e *encryption) UnmarshalYAML(unmarshal func(interface{}) error) error {
type rawEncryption encryption
raw := rawEncryption{}
if err := unmarshal(&raw); err != nil {
return err
}
*e = encryption(raw)
return e.validate()
}