@steedos/accounts 2.2.52-beta.5 → 2.2.52-beta.50

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 (95) hide show
  1. package/LICENSE.txt +2 -5
  2. package/lib/core/index.js +22 -22
  3. package/lib/core/index.js.map +1 -1
  4. package/lib/database-mongo/mongo.js +105 -102
  5. package/lib/database-mongo/mongo.js.map +1 -1
  6. package/lib/index.js +10 -20
  7. package/lib/index.js.map +1 -1
  8. package/lib/mail.js +5 -5
  9. package/lib/mail.js.map +1 -1
  10. package/lib/password/accounts-password.js +54 -41
  11. package/lib/password/accounts-password.js.map +1 -1
  12. package/lib/password/index.js +1 -1
  13. package/lib/password/index.js.map +1 -1
  14. package/lib/password/utils/encryption.js +3 -3
  15. package/lib/rest-express/endpoints/authorize.js +2 -2
  16. package/lib/rest-express/endpoints/get-user.js +2 -2
  17. package/lib/rest-express/endpoints/impersonate.js +2 -2
  18. package/lib/rest-express/endpoints/initServer.js +2 -2
  19. package/lib/rest-express/endpoints/login.js +2 -2
  20. package/lib/rest-express/endpoints/logout.js +2 -2
  21. package/lib/rest-express/endpoints/oauth/provider-callback.js +3 -3
  22. package/lib/rest-express/endpoints/oauth/provider-callback.js.map +1 -1
  23. package/lib/rest-express/endpoints/password/change-password.js +2 -2
  24. package/lib/rest-express/endpoints/password/register.js +2 -2
  25. package/lib/rest-express/endpoints/password/reset.js +4 -4
  26. package/lib/rest-express/endpoints/password/two-factor.js +6 -6
  27. package/lib/rest-express/endpoints/password/verify-email.js +6 -6
  28. package/lib/rest-express/endpoints/password/verify.js +4 -4
  29. package/lib/rest-express/endpoints/put-user-name.js +2 -2
  30. package/lib/rest-express/endpoints/refresh-access-token.js +2 -2
  31. package/lib/rest-express/endpoints/service-authenticate.js +2 -2
  32. package/lib/rest-express/endpoints/spaces.js +2 -2
  33. package/lib/rest-express/endpoints/steedos/create-tenant.js +2 -2
  34. package/lib/rest-express/endpoints/steedos/get-tenant.js +2 -2
  35. package/lib/rest-express/endpoints/steedos/settings.js +2 -2
  36. package/lib/rest-express/endpoints/update-session.js +2 -2
  37. package/lib/rest-express/express-middleware.js +1 -1
  38. package/lib/rest-express/express-middleware.js.map +1 -1
  39. package/lib/rest-express/user-loader.js +2 -2
  40. package/lib/rest-express/utils/steedos-auth.js +2 -2
  41. package/lib/rest-express/utils/steedos-auth.js.map +1 -1
  42. package/lib/rest-express/utils/users.js +4 -4
  43. package/lib/server/accounts-server.js +56 -30
  44. package/lib/server/accounts-server.js.map +1 -1
  45. package/lib/server/utils/email.js +2 -2
  46. package/lib/types/index.js +14 -14
  47. package/lib/types/index.js.map +1 -1
  48. package/package.json +14 -20
  49. package/src/core/index.ts +4 -4
  50. package/src/database-mongo/mongo.ts +29 -26
  51. package/src/index.ts +6 -16
  52. package/src/mail.ts +3 -3
  53. package/src/password/accounts-password.ts +17 -5
  54. package/src/server/accounts-server.ts +26 -3
  55. package/src/server/types/jwt-data.ts +10 -1
  56. package/src/types/types/connection-informations.ts +9 -0
  57. package/lib/oauth2/client.js +0 -1
  58. package/lib/oauth2/client.js.map +0 -1
  59. package/lib/oauth2/config.js +0 -14
  60. package/lib/oauth2/config.js.map +0 -1
  61. package/lib/oauth2/consent.js +0 -192
  62. package/lib/oauth2/consent.js.map +0 -1
  63. package/lib/oauth2/login.js +0 -166
  64. package/lib/oauth2/login.js.map +0 -1
  65. package/lib/oauth2/logout.js +0 -60
  66. package/lib/oauth2/logout.js.map +0 -1
  67. package/lib/oauth2/stub/oidc-cert.js +0 -67
  68. package/lib/oauth2/stub/oidc-cert.js.map +0 -1
  69. package/lib/saml-idp/config.js +0 -82
  70. package/lib/saml-idp/config.js.map +0 -1
  71. package/lib/saml-idp/connectedApps.js +0 -20
  72. package/lib/saml-idp/connectedApps.js.map +0 -1
  73. package/lib/saml-idp/express-middleware.js +0 -684
  74. package/lib/saml-idp/express-middleware.js.map +0 -1
  75. package/lib/saml-idp/index.js +0 -13
  76. package/lib/saml-idp/index.js.map +0 -1
  77. package/lib/saml-idp/simpleProfileMapper.js +0 -75
  78. package/lib/saml-idp/simpleProfileMapper.js.map +0 -1
  79. package/src/oauth2/client.ts +0 -0
  80. package/src/oauth2/config.ts +0 -15
  81. package/src/oauth2/consent.ts +0 -208
  82. package/src/oauth2/login.ts +0 -179
  83. package/src/oauth2/logout.ts +0 -66
  84. package/src/oauth2/stub/oidc-cert.ts +0 -86
  85. package/src/saml-idp/config.js +0 -85
  86. package/src/saml-idp/connectedApps.ts +0 -16
  87. package/src/saml-idp/express-middleware.js +0 -811
  88. package/src/saml-idp/index.ts +0 -14
  89. package/src/saml-idp/simpleProfileMapper.js +0 -82
  90. package/src/saml-idp/views/error.hbs +0 -11
  91. package/src/saml-idp/views/layout.hbs +0 -72
  92. package/src/saml-idp/views/samlresponse.hbs +0 -20
  93. package/src/saml-idp/views/settings.hbs +0 -175
  94. package/src/saml-idp/views/user.hbs +0 -261
  95. package/views/oauth2/consent.pug +0 -141
@@ -1,86 +0,0 @@
1
- // This file contains logic which is used when running this application as part of the
2
- // OpenID Connect Conformance test suite. You can use it for inspiration, but please
3
- // do not use it in production as is.
4
-
5
- import {
6
- ConsentRequest,
7
- ConsentRequestSession,
8
- LoginRequest
9
- } from '@oryd/hydra-client'
10
-
11
- export const oidcConformityMaybeFakeAcr = (
12
- request: LoginRequest,
13
- fallback: string
14
- ) => {
15
- if (process.env.CONFORMITY_FAKE_CLAIMS !== '1') {
16
- return fallback
17
- }
18
-
19
- return request.oidc_context?.acr_values &&
20
- request.oidc_context.acr_values.length > 0
21
- ? request.oidc_context.acr_values[
22
- request.oidc_context.acr_values.length - 1
23
- ]
24
- : fallback
25
- }
26
-
27
- export const oidcConformityMaybeFakeSession = (
28
- grantScope: string[],
29
- request: ConsentRequest,
30
- session: ConsentRequestSession
31
- ): ConsentRequestSession => {
32
- if (process.env.CONFORMITY_FAKE_CLAIMS !== '1') {
33
- return session
34
- }
35
-
36
- const idToken: { [key: string]: any } = {}
37
-
38
- // If the email scope was granted, fake the email claims.
39
- if (grantScope.indexOf('email') > -1) {
40
- // But only do so if the email was requested!
41
- idToken.email = 'foo@bar.com'
42
- idToken.email_verified = true
43
- }
44
-
45
- // If the phone scope was granted, fake the phone claims.
46
- if (grantScope.indexOf('phone') > -1) {
47
- idToken.phone_number = '1337133713371337'
48
- idToken.phone_number_verified = true
49
- }
50
-
51
- // If the profile scope was granted, fake the profile claims.
52
- if (grantScope.indexOf('profile') > -1) {
53
- idToken.name = 'Foo Bar'
54
- idToken.given_name = 'Foo'
55
- idToken.family_name = 'Bar'
56
- idToken.website = 'https://www.ory.sh'
57
- idToken.zoneinfo = 'Europe/Belrin'
58
- idToken.birthdate = '1.1.2014'
59
- idToken.gender = 'robot'
60
- idToken.profile = 'https://www.ory.sh'
61
- idToken.preferred_username = 'robot'
62
- idToken.middle_name = 'Baz'
63
- idToken.locale = 'en-US'
64
- idToken.picture =
65
- 'https://raw.githubusercontent.com/ory/web/master/static/images/favico.png'
66
- idToken.updated_at = 1604416603
67
- idToken.nickname = 'foobot'
68
- }
69
-
70
- // If the address scope was granted, fake the address claims.
71
- if (grantScope.indexOf('address') > -1) {
72
- idToken.address = {
73
- country: 'Localhost',
74
- region: 'Intranet',
75
- street_address: 'Local Street 1337'
76
- }
77
- }
78
-
79
- return {
80
- access_token: session.access_token,
81
- id_token: {
82
- ...idToken,
83
- ...session.id_token
84
- }
85
- }
86
- }
@@ -1,85 +0,0 @@
1
-
2
- /**
3
- * User Profile
4
- */
5
- var profile = {
6
- userName: 'zhuangjianguo@steedos.com',
7
- nameIdFormat: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
8
- firstName: 'Jack',
9
- lastName: 'Zhuang',
10
- displayName: 'Jack Zhuang',
11
- email: 'zhuangjianguo@steedos.com',
12
- mobilePhone: '+86-01777701',
13
- groups: 'Users'
14
- }
15
-
16
- /**
17
- * SAML Attribute Metadata
18
- */
19
- var metadata = [
20
- // {
21
- // id: "firstName",
22
- // optional: false,
23
- // displayName: 'First Name',
24
- // description: 'The given name of the user',
25
- // multiValue: false
26
- // }, {
27
- // id: "lastName",
28
- // optional: false,
29
- // displayName: 'Last Name',
30
- // description: 'The surname of the user',
31
- // multiValue: false
32
- // },
33
- {
34
- id: "userId",
35
- optional: true,
36
- displayName: 'User Id',
37
- description: 'The id of the user',
38
- multiValue: false
39
- },
40
- {
41
- id: "username",
42
- optional: true,
43
- displayName: 'User Name',
44
- description: 'The username of the user',
45
- multiValue: false
46
- },
47
- {
48
- id: "name",
49
- optional: true,
50
- displayName: 'Display Name',
51
- description: 'The display name of the user',
52
- multiValue: false
53
- }, {
54
- id: "email",
55
- optional: false,
56
- displayName: 'E-Mail Address',
57
- description: 'The e-mail address of the user',
58
- multiValue: false
59
- },{
60
- id: "mobile",
61
- optional: true,
62
- displayName: 'Mobile',
63
- description: 'The mobile phone of the user',
64
- multiValue: false
65
- },
66
- // {
67
- // id: "groups",
68
- // optional: true,
69
- // displayName: 'Groups',
70
- // description: 'Group memberships of the user',
71
- // multiValue: true
72
- // }, {
73
- // id: "userType",
74
- // optional: true,
75
- // displayName: 'User Type',
76
- // description: 'The type of user',
77
- // options: ['Admin', 'User']
78
- // }
79
- ];
80
-
81
- module.exports = {
82
- user: profile,
83
- metadata: metadata
84
- }
85
-
@@ -1,16 +0,0 @@
1
- export const connectedApps = {
2
- sogo: {
3
- acsUrl: `https://mail.steedos.cn/SOGo/saml2-signon-post`,
4
- audience: `https://mail.steedos.cn/SOGo/saml2/artifactResponse`,
5
- },
6
- salesforce: {
7
- issuer: "http://192.168.0.50:4000/accounts/saml/",
8
- acsUrl: `https://steedos-dev-ed.my.salesforce.com?so=00D7F000000q6uO`,
9
- audience: `https://steedos-dev-ed.my.salesforce.com/`,
10
- },
11
- auth0: {
12
- issuer: "urn:auth0:hotlong:Steedos",
13
- acsUrl: `https://hotlong.auth0.com/login/callback?connection=Steedos`,
14
- audience: `urn:auth0:hotlong:Steedos`,
15
- }
16
- }