open-vault/vendor/github.com/joyent/triton-go/authentication/agent_key_identifier.go
Chris Hoffman a1c8c8459b
Bump Deps (#4868)
* bump deps

* revert script changes

* adding govendor miss
2018-07-06 12:09:34 -04:00

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
}