@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 +1 -1
- package/src/test/api.test.js +7 -7
package/package.json
CHANGED
package/src/test/api.test.js
CHANGED
@@ -8,7 +8,9 @@ const dbutils = require('../db/utils');
|
|
8
8
|
|
9
9
|
let apiController;
|
10
10
|
|
11
|
-
const
|
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')(
|
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(
|
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,
|
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:
|
147
|
+
clientID: CLIENT_ID,
|
148
148
|
});
|
149
149
|
t.equal(savedConf.provider, PROVIDER);
|
150
150
|
|