@ndustrial/contxt-sdk 4.1.1 → 4.3.4

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.
Files changed (54) hide show
  1. package/.envrc +0 -0
  2. package/.nvmrc +1 -1
  3. package/CHANGELOG.md +19 -1
  4. package/README.md +2 -12
  5. package/docs/Typedefs.md +1 -0
  6. package/esm/config/audiences.js +4 -4
  7. package/esm/config/audiences.js.map +1 -1
  8. package/esm/config/defaults.js +1 -0
  9. package/esm/config/defaults.js.map +1 -1
  10. package/esm/config/index.js +2 -0
  11. package/esm/config/index.js.map +1 -1
  12. package/esm/coordinator/roles.js +6 -6
  13. package/esm/coordinator/roles.js.map +1 -1
  14. package/esm/coordinator/users.js +6 -6
  15. package/esm/coordinator/users.js.map +1 -1
  16. package/esm/sessionTypes/auth0WebAuth.js +1 -1
  17. package/esm/sessionTypes/auth0WebAuth.js.map +1 -1
  18. package/esm/sessionTypes/passwordGrantAuth.js +1 -1
  19. package/esm/sessionTypes/passwordGrantAuth.js.map +1 -1
  20. package/lib/config/audiences.js +4 -4
  21. package/lib/config/audiences.js.map +1 -1
  22. package/lib/config/defaults.js +1 -0
  23. package/lib/config/defaults.js.map +1 -1
  24. package/lib/config/index.js +2 -0
  25. package/lib/config/index.js.map +1 -1
  26. package/lib/coordinator/roles.js +6 -6
  27. package/lib/coordinator/roles.js.map +1 -1
  28. package/lib/coordinator/users.js +6 -6
  29. package/lib/coordinator/users.js.map +1 -1
  30. package/lib/sessionTypes/auth0WebAuth.js +1 -1
  31. package/lib/sessionTypes/auth0WebAuth.js.map +1 -1
  32. package/lib/sessionTypes/passwordGrantAuth.js +1 -1
  33. package/lib/sessionTypes/passwordGrantAuth.js.map +1 -1
  34. package/package.json +5 -2
  35. package/src/config/audiences.js +4 -4
  36. package/src/config/defaults.js +1 -0
  37. package/src/config/index.js +2 -0
  38. package/src/coordinator/roles.js +6 -6
  39. package/src/coordinator/roles.spec.js +8 -8
  40. package/src/coordinator/users.js +6 -6
  41. package/src/coordinator/users.spec.js +8 -8
  42. package/src/sessionTypes/auth0WebAuth.js +1 -1
  43. package/src/sessionTypes/auth0WebAuth.spec.js +17 -1
  44. package/src/sessionTypes/passwordGrantAuth.js +1 -1
  45. package/src/sessionTypes/passwordGrantAuth.spec.js +2 -1
  46. package/tmp/package.json +11 -0
  47. package/.idea/codeStyles/Project.xml +0 -49
  48. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  49. package/.idea/contxt-sdk-js.iml +0 -15
  50. package/.idea/inspectionProfiles/Project_Default.xml +0 -7
  51. package/.idea/inspectionProfiles/profiles_settings.xml +0 -6
  52. package/.idea/misc.xml +0 -4
  53. package/.idea/modules.xml +0 -9
  54. package/.idea/vcs.xml +0 -6
@@ -20,6 +20,7 @@ describe('sessionTypes/Auth0WebAuth', function() {
20
20
  facilities: fixture.build('audience')
21
21
  },
22
22
  auth: {
23
+ domain: faker.internet.domainName(),
23
24
  authorizationPath: faker.hacker.noun(),
24
25
  clientId: faker.internet.password(),
25
26
  tokenExpiresAtBufferMs: faker.random.number()
@@ -108,7 +109,7 @@ describe('sessionTypes/Auth0WebAuth', function() {
108
109
  expect(webAuth).to.be.calledWith({
109
110
  audience: sdk.config.audiences.contxtAuth.clientId,
110
111
  clientID: sdk.config.auth.clientId,
111
- domain: 'ndustrial.auth0.com',
112
+ domain: sdk.config.auth.domain,
112
113
  redirectUri: `${global.window.location}/${
113
114
  sdk.config.auth.authorizationPath
114
115
  }`,
@@ -142,6 +143,7 @@ describe('sessionTypes/Auth0WebAuth', function() {
142
143
  expectedOnRedirect = sinon.stub();
143
144
 
144
145
  sdk.config.auth.authorizationPath = expectedAuthorizationPath;
146
+ sdk.config.auth.domain = 'random.auth0.com';
145
147
  sdk.config.auth.onAuthenticate = expectedOnAuthenticate;
146
148
  sdk.config.auth.onRedirect = expectedOnRedirect;
147
149
 
@@ -162,6 +164,20 @@ describe('sessionTypes/Auth0WebAuth', function() {
162
164
  new RegExp(`${expectedAuthorizationPath}$`)
163
165
  );
164
166
  });
167
+
168
+ it('creates an auth0 WebAuth instance with the default settings', function() {
169
+ expect(webAuth).to.be.calledWithNew;
170
+ expect(webAuth).to.be.calledWith({
171
+ audience: sdk.config.audiences.contxtAuth.clientId,
172
+ clientID: sdk.config.auth.clientId,
173
+ domain: 'random.auth0.com',
174
+ redirectUri: `${global.window.location}/${
175
+ sdk.config.auth.authorizationPath
176
+ }`,
177
+ responseType: 'token',
178
+ scope: 'email profile openid'
179
+ });
180
+ });
165
181
  });
166
182
 
167
183
  context('when the user is not authenticated', function() {
@@ -42,7 +42,7 @@ class PasswordGrantAuth {
42
42
  this._sessionInfo = {};
43
43
 
44
44
  this._auth0 = new auth0.Authentication({
45
- domain: 'ndustrial.auth0.com',
45
+ domain: this._sdk.config.auth.domain,
46
46
  clientID: this._sdk.config.auth.clientId
47
47
  });
48
48
  }
@@ -22,6 +22,7 @@ describe('sessionTypes/passwordGrantAuth', function() {
22
22
  facilities: fixture.build('audience')
23
23
  },
24
24
  auth: {
25
+ domain: faker.internet.domainName(),
25
26
  clientId: faker.internet.password()
26
27
  }
27
28
  }
@@ -38,7 +39,7 @@ describe('sessionTypes/passwordGrantAuth', function() {
38
39
  it('calls the auth0 Authentication constructor with the proper arguments', function() {
39
40
  expect(authentication).to.be.calledOnce;
40
41
  expect(authentication).to.be.calledWith({
41
- domain: 'ndustrial.auth0.com',
42
+ domain: passwordGrantAuth._sdk.config.auth.domain,
42
43
  clientID: passwordGrantAuth._sdk.config.auth.clientId
43
44
  });
44
45
  });
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@ndustrialio/tmp",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }
@@ -1,49 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- </HTMLCodeStyleSettings>
6
- <JSCodeStyleSettings version="0">
7
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
- <option name="USE_DOUBLE_QUOTES" value="false" />
10
- <option name="FORCE_QUOTE_STYlE" value="true" />
11
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
12
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
- </JSCodeStyleSettings>
15
- <TypeScriptCodeStyleSettings version="0">
16
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
- <option name="USE_DOUBLE_QUOTES" value="false" />
19
- <option name="FORCE_QUOTE_STYlE" value="true" />
20
- <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
21
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
22
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
23
- </TypeScriptCodeStyleSettings>
24
- <codeStyleSettings language="HTML">
25
- <option name="SOFT_MARGINS" value="80" />
26
- <indentOptions>
27
- <option name="INDENT_SIZE" value="2" />
28
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
29
- <option name="TAB_SIZE" value="2" />
30
- </indentOptions>
31
- </codeStyleSettings>
32
- <codeStyleSettings language="JavaScript">
33
- <option name="SOFT_MARGINS" value="80" />
34
- <indentOptions>
35
- <option name="INDENT_SIZE" value="2" />
36
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
37
- <option name="TAB_SIZE" value="2" />
38
- </indentOptions>
39
- </codeStyleSettings>
40
- <codeStyleSettings language="TypeScript">
41
- <option name="SOFT_MARGINS" value="80" />
42
- <indentOptions>
43
- <option name="INDENT_SIZE" value="2" />
44
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
45
- <option name="TAB_SIZE" value="2" />
46
- </indentOptions>
47
- </codeStyleSettings>
48
- </code_scheme>
49
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="PYTHON_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.idea" />
6
- <excludeFolder url="file://$MODULE_DIR$/.nyc_output" />
7
- <excludeFolder url="file://$MODULE_DIR$/coverage" />
8
- <excludeFolder url="file://$MODULE_DIR$/esm" />
9
- <excludeFolder url="file://$MODULE_DIR$/lib" />
10
- </content>
11
- <orderEntry type="inheritedJdk" />
12
- <orderEntry type="sourceFolder" forTests="false" />
13
- <orderEntry type="module" module-name="realtime-data-api-service" />
14
- </component>
15
- </module>
@@ -1,7 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- <inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
6
- </profile>
7
- </component>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <settings>
3
- <option name="USE_PROJECT_PROFILE" value="false" />
4
- <version value="1.0" />
5
- </settings>
6
- </component>
package/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7" project-jdk-type="Python SDK" />
4
- </project>
package/.idea/modules.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/contxt-sdk-js.iml" filepath="$PROJECT_DIR$/.idea/contxt-sdk-js.iml" />
6
- <module fileurl="file://$PROJECT_DIR$/../realtime-data-api-service/.idea/realtime-data-api-service.iml" filepath="$PROJECT_DIR$/../realtime-data-api-service/.idea/realtime-data-api-service.iml" />
7
- </modules>
8
- </component>
9
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>