github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/provider/azure/internal/azureauth/utils.go (about) 1 // Copyright 2016 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package azureauth 5 6 import "strings" 7 8 // TokenResource returns a resource value suitable for auth tokens, based on 9 // an endpoint URI. 10 func TokenResource(uri string) string { 11 resource := uri 12 if !strings.HasSuffix(resource, "/") { 13 resource += "/" 14 } 15 return resource 16 }