Skip to content

Instantly share code, notes, and snippets.

@jonasfj
Forked from lightsofapollo/auth.js
Last active August 29, 2015 14:04
Show Gist options
  • Save jonasfj/c78d7dcd1bbf627dbe7f to your computer and use it in GitHub Desktop.
Save jonasfj/c78d7dcd1bbf627dbe7f to your computer and use it in GitHub Desktop.
/**
* Create a client class from a JSON reference.
*
* Returns a Client class which can be initialized with following options:
* options:
* {
* // TaskCluster credentials, if not provided fallback to defaults from environment variables
* // if defaults are not explicitly set with taskcluster.config({...})
* // To create a client without authentication (and not using defaults) use `credentials: {}`
* credentials: {
* clientId: '...', // ClientId
* accessToken: '...', // AccessToken for clientId
* },
* // Optional authorization details for delegating auth.
* authorization: {
* delegating: true || false, // Is delegating authentication?
* scopes: ['scopes', ...] // Scopes to authorize with
* }
* baseUrl: 'http://.../v1' // baseUrl for API requests
* exchangePrefix: 'queue/v1/' // exchangePrefix prefix
* }
*
* `baseUrl` and `exchangePrefix` defaults to values from reference.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment