@boxyhq/saml-jackson 0.2.1-beta.162 → 0.2.2-beta.165

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxyhq/saml-jackson",
3
- "version": "0.2.1-beta.162",
3
+ "version": "0.2.2-beta.165",
4
4
  "license": "Apache 2.0",
5
5
  "description": "SAML 2.0 service",
6
6
  "main": "src/index.js",
@@ -8,7 +8,9 @@ const dbutils = require('../db/utils');
8
8
 
9
9
  let apiController;
10
10
 
11
- const options = {
11
+ const CLIENT_ID = '75edb050796a0eb1cf2cfb0da7245f85bc50baa7';
12
+ const PROVIDER = 'accounts.google.com';
13
+ const OPTIONS = {
12
14
  externalUrl: 'https://my-cool-app.com',
13
15
  samlAudience: 'https://saml.boxyhq.com',
14
16
  samlPath: '/sso/oauth/saml',
@@ -18,7 +20,7 @@ const options = {
18
20
  };
19
21
 
20
22
  tap.before(async () => {
21
- const controller = await require('../index.js')(options);
23
+ const controller = await require('../index.js')(OPTIONS);
22
24
 
23
25
  apiController = controller.apiController;
24
26
  });
@@ -125,10 +127,8 @@ tap.test('controller/api', async (t) => {
125
127
 
126
128
  t.test('when the request is good', async (t) => {
127
129
  const body = Object.assign({}, config[0]);
128
- const CLIENTID = '75edb050796a0eb1cf2cfb0da7245f85bc50baa7';
129
- const PROVIDER = 'accounts.google.com';
130
130
 
131
- const kdStub = sinon.stub(dbutils, 'keyDigest').returns(CLIENTID);
131
+ const kdStub = sinon.stub(dbutils, 'keyDigest').returns(CLIENT_ID);
132
132
  const rbStub = sinon
133
133
  .stub(crypto, 'randomBytes')
134
134
  .returns('f3b0f91eb8f4a9f7cc2254e08682d50b05b5d36262929e7f');
@@ -136,7 +136,7 @@ tap.test('controller/api', async (t) => {
136
136
  const response = await apiController.config(body);
137
137
  t.ok(kdStub.called);
138
138
  t.ok(rbStub.calledOnce);
139
- t.equal(response.client_id, CLIENTID);
139
+ t.equal(response.client_id, CLIENT_ID);
140
140
  t.equal(
141
141
  response.client_secret,
142
142
  'f3b0f91eb8f4a9f7cc2254e08682d50b05b5d36262929e7f'
@@ -144,7 +144,7 @@ tap.test('controller/api', async (t) => {
144
144
  t.equal(response.provider, PROVIDER);
145
145
 
146
146
  const savedConf = await apiController.getConfig({
147
- clientID: CLIENTID,
147
+ clientID: CLIENT_ID,
148
148
  });
149
149
  t.equal(savedConf.provider, PROVIDER);
150
150