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:
29
config/encryption.go
Normal file
29
config/encryption.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user