()
| 95 | } |
| 96 | |
| 97 | func (cb *credentialBase) validate() error { |
| 98 | if cb.target == "" { |
| 99 | return fmt.Errorf("missing target") |
| 100 | } |
| 101 | if cb.createTime.IsZero() || cb.createTime.Equal(time.Time{}) { |
| 102 | return fmt.Errorf("missing creation time") |
| 103 | } |
| 104 | if !core.TargetExist(cb.target) { |
| 105 | return fmt.Errorf("unknown target") |
| 106 | } |
| 107 | return nil |
| 108 | } |
| 109 | |
| 110 | func (cb *credentialBase) Metadata() map[string]string { |
| 111 | return cb.meta |
no test coverage detected