options: s/shared-key/shared secret (#2257)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
bobby 2021-05-31 12:55:11 -07:00 committed by GitHub
parent 41804ef0ba
commit c5f90e40f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -535,7 +535,7 @@ func (o *Options) Validate() error {
_, err := o.GetSharedKey() _, err := o.GetSharedKey()
if err != nil { if err != nil {
return fmt.Errorf("config: invalid shared-key: %w", err) return fmt.Errorf("config: invalid shared secret: %w", err)
} }
if o.AuthenticateURLString != "" { if o.AuthenticateURLString != "" {
@ -929,10 +929,10 @@ func (o *Options) GetSharedKey() ([]byte, error) {
sharedKey = randomSharedKey sharedKey = randomSharedKey
} }
if sharedKey == "" { if sharedKey == "" {
return nil, errors.New("empty shared-key") return nil, errors.New("empty shared secret")
} }
if strings.TrimSpace(sharedKey) != sharedKey { if strings.TrimSpace(sharedKey) != sharedKey {
return nil, errors.New("shared-key contains whitespace") return nil, errors.New("shared secret contains whitespace")
} }
return base64.StdEncoding.DecodeString(sharedKey) return base64.StdEncoding.DecodeString(sharedKey)
} }