*: switch to github.com/ghodss/yaml for more consistent YAML parsing

ghodss/yaml converts from YAML to JSON before attempting to unmarshal.
This allows us to:

* Get the correct behavor when decoding base64'd []byte slices.
* Use *json.RawMessage.
* Not have to support extravagant YAML features.
* Let our structs use `json:` tags
This commit is contained in:
Eric Chiang
2016-11-03 14:32:23 -07:00
parent 74eaec60cb
commit aa7f304bc1
13 changed files with 185 additions and 238 deletions

View File

@@ -247,16 +247,16 @@ type Password struct {
//
// Storages that don't support an extended character set for IDs, such as '.' and '@'
// (cough cough, kubernetes), must map this value appropriately.
Email string `yaml:"email"`
Email string `json:"email"`
// Bcrypt encoded hash of the password. This package enforces a min cost value of 10
Hash []byte `yaml:"hash"`
Hash []byte `json:"hash"`
// Optional username to display. NOT used during login.
Username string `yaml:"username"`
Username string `json:"username"`
// Randomly generated user ID. This is NOT the primary ID of the Password object.
UserID string `yaml:"userID"`
UserID string `json:"userID"`
}
// VerificationKey is a rotated signing key which can still be used to verify