@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.
- package/.envrc +0 -0
- package/.nvmrc +1 -1
- package/CHANGELOG.md +19 -1
- package/README.md +2 -12
- package/docs/Typedefs.md +1 -0
- package/esm/config/audiences.js +4 -4
- package/esm/config/audiences.js.map +1 -1
- package/esm/config/defaults.js +1 -0
- package/esm/config/defaults.js.map +1 -1
- package/esm/config/index.js +2 -0
- package/esm/config/index.js.map +1 -1
- package/esm/coordinator/roles.js +6 -6
- package/esm/coordinator/roles.js.map +1 -1
- package/esm/coordinator/users.js +6 -6
- package/esm/coordinator/users.js.map +1 -1
- package/esm/sessionTypes/auth0WebAuth.js +1 -1
- package/esm/sessionTypes/auth0WebAuth.js.map +1 -1
- package/esm/sessionTypes/passwordGrantAuth.js +1 -1
- package/esm/sessionTypes/passwordGrantAuth.js.map +1 -1
- package/lib/config/audiences.js +4 -4
- package/lib/config/audiences.js.map +1 -1
- package/lib/config/defaults.js +1 -0
- package/lib/config/defaults.js.map +1 -1
- package/lib/config/index.js +2 -0
- package/lib/config/index.js.map +1 -1
- package/lib/coordinator/roles.js +6 -6
- package/lib/coordinator/roles.js.map +1 -1
- package/lib/coordinator/users.js +6 -6
- package/lib/coordinator/users.js.map +1 -1
- package/lib/sessionTypes/auth0WebAuth.js +1 -1
- package/lib/sessionTypes/auth0WebAuth.js.map +1 -1
- package/lib/sessionTypes/passwordGrantAuth.js +1 -1
- package/lib/sessionTypes/passwordGrantAuth.js.map +1 -1
- package/package.json +5 -2
- package/src/config/audiences.js +4 -4
- package/src/config/defaults.js +1 -0
- package/src/config/index.js +2 -0
- package/src/coordinator/roles.js +6 -6
- package/src/coordinator/roles.spec.js +8 -8
- package/src/coordinator/users.js +6 -6
- package/src/coordinator/users.spec.js +8 -8
- package/src/sessionTypes/auth0WebAuth.js +1 -1
- package/src/sessionTypes/auth0WebAuth.spec.js +17 -1
- package/src/sessionTypes/passwordGrantAuth.js +1 -1
- package/src/sessionTypes/passwordGrantAuth.spec.js +2 -1
- package/tmp/package.json +11 -0
- package/.idea/codeStyles/Project.xml +0 -49
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/contxt-sdk-js.iml +0 -15
- package/.idea/inspectionProfiles/Project_Default.xml +0 -7
- package/.idea/inspectionProfiles/profiles_settings.xml +0 -6
- package/.idea/misc.xml +0 -4
- package/.idea/modules.xml +0 -9
- 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:
|
|
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() {
|
|
@@ -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:
|
|
42
|
+
domain: passwordGrantAuth._sdk.config.auth.domain,
|
|
42
43
|
clientID: passwordGrantAuth._sdk.config.auth.clientId
|
|
43
44
|
});
|
|
44
45
|
});
|
package/tmp/package.json
ADDED
|
@@ -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>
|
package/.idea/contxt-sdk-js.iml
DELETED
|
@@ -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>
|
package/.idea/misc.xml
DELETED
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>
|