// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package hipchat provides constants for using OAuth2 to access HipChat. package hipchat // import "golang.org/x/oauth2/hipchat" import ( "encoding/json" "errors" "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" ) // Endpoint is HipChat's OAuth 2.0 endpoint. var Endpoint = oauth2.Endpoint{ AuthURL: "https://www.hipchat.com/users/authorize", 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", } } // ClientCredentialsConfigFromCaps generates a Config from a HipChat API // capabilities descriptor. It does not verify the scopes against the // capabilities document at this time. // // For more information see: https://www.hipchat.com/docs/apiv2/method/get_capabilities func ClientCredentialsConfigFromCaps(capsJSON []byte, clientID, clientSecret string, scopes ...string) (*clientcredentials.Config, error) { var caps struct { Caps struct { Endpoint struct { TokenURL string `json:"tokenUrl"` } `json:"oauth2Provider"` } `json:"capabilities"` } if err := json.Unmarshal(capsJSON, &caps); err != nil { return nil, err } // Verify required fields. if caps.Caps.Endpoint.TokenURL == "" { return nil, errors.New("oauth2/hipchat: missing OAuth2 token URL in the capabilities descriptor JSON") } return &clientcredentials.Config{ ClientID: clientID, ClientSecret: clientSecret, Scopes: scopes, TokenURL: caps.Caps.Endpoint.TokenURL, }, nil } s-fetch-proper-handshake'>ciro/ws-fetch-proper-handshake Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/inspect.test.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-05-11Update MakefileGravatar Jarred Sumner 1-1/+1
2022-05-11Fix export symbols on LinuxGravatar Jarred Sumner 4-25/+153
2022-05-11Add test for import.meta.requireGravatar Jarred Sumner 2-1/+11
2022-05-11[napi] Add a couple more symbolsGravatar Jarred Sumner 1-0/+2
2022-05-11[napi] Fix panic inside napi_fatal_errorGravatar Jarred Sumner 1-11/+18
2022-05-11[napi] Stub a couple moreGravatar Jarred Sumner 3-6/+52
2022-05-11[bun.js] eagerly convert to import.meta.requireGravatar Jarred Sumner 2-3/+24
2022-05-11[json] Fix bug with negative integers in json parserGravatar Jarred Sumner 1-3/+6
2022-05-11[bun.js] Implement a polyfill for the `detect-libc` npm packageGravatar Jarred Sumner 2-0/+53
2022-05-11[bun.js] Implement `import.meta.require`Gravatar Jarred Sumner 13-158/+539
2022-05-11[bun.js] Implement `import.meta.resolveSync`Gravatar Jarred Sumner 3-1/+78
2022-05-10Include napi in plus100Gravatar Jarred Sumner 1-4/+20
2022-05-10Add test for Buffer.byteLengthGravatar Jarred Sumner 1-0/+7
2022-05-10[napi] Error on import .nodeGravatar Jarred Sumner 1-29/+1
2022-05-10Update napi.cppGravatar Jarred Sumner 1-1/+0
2022-05-10[napi] Fix string bugGravatar Jarred Sumner 4-58/+125
2022-05-10[napi] transpile require(*.node) into process.dlopenGravatar Jarred Sumner 4-3/+30
2022-05-10[bun.js] Implement `Buffer.byteLength`Gravatar Jarred Sumner 7-47/+443
2022-05-09Fix extra quote in bundled require errorsGravatar Jarred Sumner 1-2/+2
2022-05-09few more napi functionsGravatar Jarred Sumner 2-1/+30
2022-05-09Update MakefileGravatar Jarred Sumner 1-3/+3
2022-05-09Update Dockerfile.baseGravatar Jarred Sumner 1-1/+1
2022-05-09[napi] getters & setters workGravatar Jarred Sumner 1-26/+39