hipchat: Add endpoint function for HipChat server

Change-Id: I4578f5683aa9ed728e503cb3b08ff0bf743a62a2
Reviewed-on: https://go-review.googlesource.com/21712
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Sam Whited 2016-04-07 20:06:28 -05:00 committed by Brad Fitzpatrick
parent 33fa30fe45
commit b0e2337fe6
1 changed files with 9 additions and 0 deletions

View File

@ -14,3 +14,12 @@ var Endpoint = oauth2.Endpoint{
AuthURL: "https://www.hipchat.com/users/authorize", AuthURL: "https://www.hipchat.com/users/authorize",
TokenURL: "https://api.hipchat.com/v2/oauth/token", TokenURL: "https://api.hipchat.com/v2/oauth/token",
} }
// ServerEndpoint returns a new oauth2.Endpoint for a HipChat Server instance
// running on the given domain or host.
func ServerEndpoint(host string) oauth2.Endpoint {
return oauth2.Endpoint{
AuthURL: "https://" + host + "/users/authorize",
TokenURL: "https://" + host + "/v2/oauth/token",
}
}