2020-02-15 22:13:50 +00:00
|
|
|
package sigcred
|
|
|
|
|
|
|
|
import "dehub/typeobj"
|
|
|
|
|
|
|
|
// Credential represents a credential which has been attached to a commit which
|
2020-02-16 17:28:59 +00:00
|
|
|
// hopefully will allow it to be included in the trunk. Exactly one field tagged
|
|
|
|
// with "type" should be set.
|
2020-02-15 22:13:50 +00:00
|
|
|
type Credential struct {
|
|
|
|
PGPSignature *CredentialPGPSignature `type:"pgp_signature"`
|
|
|
|
|
|
|
|
// AccountID specifies the account which generated this Credential. The
|
|
|
|
// Credentials produced by the Signifier.Sign method do not fill this field
|
|
|
|
// in.
|
|
|
|
AccountID string `yaml:"account"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalYAML implements the yaml.Marshaler interface.
|
|
|
|
func (c Credential) MarshalYAML() (interface{}, error) {
|
|
|
|
return typeobj.MarshalYAML(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalYAML implements the yaml.Unmarshaler interface.
|
|
|
|
func (c *Credential) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|
|
|
return typeobj.UnmarshalYAML(c, unmarshal)
|
|
|
|
}
|