Comparing version 8.0.0 to 9.0.0
'use strict'; | ||
const btoa = require('./utils/btoa.js'); | ||
const coinsDepositBox = require('coins-deposit-box'); | ||
const cookies = require('js-cookie'); | ||
@@ -193,3 +192,2 @@ const hawk = require('hawk/dist/browser.js'); | ||
username: data.username, | ||
coinstac: data.coinstac || false, | ||
}) | ||
@@ -609,4 +607,2 @@ .then((response) => { | ||
return new Halfpenny(Object.assign({}, { | ||
baseUrl: coinsDepositBox.apiURL, | ||
authCookieName: coinsDepositBox.cookieName, | ||
storage, | ||
@@ -613,0 +609,0 @@ requestEngine: require('axios'), // eslint-disable-line global-require |
@@ -16,3 +16,2 @@ { | ||
"axios": "^0.15.3", | ||
"coins-deposit-box": "^7.0.0", | ||
"dom-storage": "^2.0.2", | ||
@@ -30,5 +29,5 @@ "hawk": "^6.0.1", | ||
"minami": "^1.1.1", | ||
"nyc": "^10.1.2", | ||
"nyc": "^11.8.0", | ||
"pre-commit": "^1.2.2", | ||
"sinon": "^1.17.7", | ||
"sinon": "^5.0.10", | ||
"tape": "^4.6.3" | ||
@@ -59,3 +58,3 @@ }, | ||
}, | ||
"version": "8.0.0" | ||
"version": "9.0.0" | ||
} |
@@ -24,17 +24,8 @@ # Halfpenny | ||
The easiest way to get started with Halfpenny is to use the `Halfpenny.factory` static method: | ||
```js | ||
const Halfpenny = require('halfpenny'); | ||
const myHalfpenny = Halfpenny.factory(); | ||
``` | ||
This configures a `Halfpenny` instance using environment-specific configuration from _[coins-deposit-box](https://github.com/MRN-Code/quarterback/tree/master/packages/coins-deposit-box)_. Alternatively, you can override configuration: | ||
```js | ||
const Halfpenny = require('halfpenny'); | ||
const myHalfpenny = Halfpenny.factory({ | ||
baseUrl: 'http://localhost:8800', | ||
authCookieName: 'CAS_Auth_User' | ||
}); | ||
@@ -45,4 +36,4 @@ ``` | ||
* **`authCookieName`** `<String>`: Authentication cookie’s name. | ||
* **`baseUrl`** `<String>`: Base URL for the API server. | ||
* **`authCookieName`** `<String>`: Authentication cookie’s name. [`REQUIRED`] | ||
* **`baseUrl`** `<String>`: Base URL for the API server. [`REQUIRED`] | ||
* **`storage`** `<Object>`: Storage instance for persisting authentication credentials. This defaults to [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) in browsers, or _[dom-storage](https://www.npmjs.com/package/dom-storage)_ in Node.js. | ||
@@ -49,0 +40,0 @@ |
@@ -750,7 +750,7 @@ 'use strict'; | ||
t.throws(() => Halfpenny.factory({}), 'throws when called without all required args'); | ||
t.ok( | ||
Halfpenny.factory() instanceof Halfpenny, | ||
'returns instance without configuration' | ||
Halfpenny.factory({ authCookieName, baseUrl }) instanceof Halfpenny, | ||
'returns instance when required options are provided' | ||
); | ||
t.ok(Halfpenny.factory({}), 'uses default configuration'); | ||
t.equal(hp.authCookieName, authCookieName, 'passes authCookieName'); | ||
@@ -757,0 +757,0 @@ t.equal(hp.baseUrl, baseUrl, 'passes baseUrl'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6
0
52778
11
1504
214
- Removedcoins-deposit-box@^7.0.0
- Removedcoins-deposit-box@7.0.0(transitive)