* update consul and vault dependencies * update triton sign call accorting to https://github.com/joyent/triton-go/pull/135 * Delete readme.md * put back github.com/mitchellh/reflectwalk to v1.0.0 and explain why * fix/fixer_pp_docker_tag_tags.go: simplify deduplication loop and keep seen/stable order
26 lines
547 B
Go
26 lines
547 B
Go
package authentication
|
|
|
|
import "path"
|
|
|
|
type KeyID struct {
|
|
UserName string
|
|
AccountName string
|
|
Fingerprint string
|
|
IsManta bool
|
|
}
|
|
|
|
func (input *KeyID) generate() string {
|
|
var keyID string
|
|
if input.UserName != "" {
|
|
if input.IsManta {
|
|
keyID = path.Join("/", input.AccountName, input.UserName, "keys", input.Fingerprint)
|
|
} else {
|
|
keyID = path.Join("/", input.AccountName, "users", input.UserName, "keys", input.Fingerprint)
|
|
}
|
|
} else {
|
|
keyID = path.Join("/", input.AccountName, "keys", input.Fingerprint)
|
|
}
|
|
|
|
return keyID
|
|
}
|