@steedos/accounts 2.2.52-beta.4 → 2.2.52-beta.40
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/LICENSE.txt +2 -5
- package/lib/core/index.js +22 -22
- package/lib/core/index.js.map +1 -1
- package/lib/database-mongo/mongo.js +105 -102
- package/lib/database-mongo/mongo.js.map +1 -1
- package/lib/index.js +11 -23
- package/lib/index.js.map +1 -1
- package/lib/mail.js +5 -5
- package/lib/mail.js.map +1 -1
- package/lib/password/accounts-password.js +54 -41
- package/lib/password/accounts-password.js.map +1 -1
- package/lib/password/index.js +1 -1
- package/lib/password/index.js.map +1 -1
- package/lib/password/utils/encryption.js +3 -3
- package/lib/rest-express/endpoints/authorize.js +2 -2
- package/lib/rest-express/endpoints/get-user.js +2 -2
- package/lib/rest-express/endpoints/impersonate.js +2 -2
- package/lib/rest-express/endpoints/initServer.js +2 -2
- package/lib/rest-express/endpoints/login.js +2 -2
- package/lib/rest-express/endpoints/logout.js +2 -2
- package/lib/rest-express/endpoints/oauth/provider-callback.js +3 -3
- package/lib/rest-express/endpoints/oauth/provider-callback.js.map +1 -1
- package/lib/rest-express/endpoints/password/change-password.js +2 -2
- package/lib/rest-express/endpoints/password/register.js +2 -2
- package/lib/rest-express/endpoints/password/reset.js +4 -4
- package/lib/rest-express/endpoints/password/two-factor.js +6 -6
- package/lib/rest-express/endpoints/password/verify-email.js +6 -6
- package/lib/rest-express/endpoints/password/verify.js +4 -4
- package/lib/rest-express/endpoints/put-user-name.js +2 -2
- package/lib/rest-express/endpoints/refresh-access-token.js +2 -2
- package/lib/rest-express/endpoints/service-authenticate.js +2 -2
- package/lib/rest-express/endpoints/spaces.js +2 -2
- package/lib/rest-express/endpoints/steedos/create-tenant.js +2 -2
- package/lib/rest-express/endpoints/steedos/get-tenant.js +2 -2
- package/lib/rest-express/endpoints/steedos/settings.js +2 -2
- package/lib/rest-express/endpoints/update-session.js +2 -2
- package/lib/rest-express/express-middleware.js +1 -1
- package/lib/rest-express/express-middleware.js.map +1 -1
- package/lib/rest-express/user-loader.js +2 -2
- package/lib/rest-express/utils/steedos-auth.js +2 -2
- package/lib/rest-express/utils/steedos-auth.js.map +1 -1
- package/lib/rest-express/utils/users.js +4 -4
- package/lib/server/accounts-server.js +56 -30
- package/lib/server/accounts-server.js.map +1 -1
- package/lib/server/utils/email.js +2 -2
- package/lib/types/index.js +14 -14
- package/lib/types/index.js.map +1 -1
- package/package.json +12 -16
- package/src/core/index.ts +4 -4
- package/src/database-mongo/mongo.ts +29 -26
- package/src/index.ts +7 -19
- package/src/mail.ts +3 -3
- package/src/password/accounts-password.ts +17 -5
- package/src/server/accounts-server.ts +26 -3
- package/src/server/types/jwt-data.ts +10 -1
- package/src/types/types/connection-informations.ts +9 -0
- package/lib/oauth2/client.js +0 -1
- package/lib/oauth2/client.js.map +0 -1
- package/lib/oauth2/config.js +0 -14
- package/lib/oauth2/config.js.map +0 -1
- package/lib/oauth2/consent.js +0 -192
- package/lib/oauth2/consent.js.map +0 -1
- package/lib/oauth2/login.js +0 -166
- package/lib/oauth2/login.js.map +0 -1
- package/lib/oauth2/logout.js +0 -60
- package/lib/oauth2/logout.js.map +0 -1
- package/lib/oauth2/stub/oidc-cert.js +0 -67
- package/lib/oauth2/stub/oidc-cert.js.map +0 -1
- package/lib/saml-idp/config.js +0 -82
- package/lib/saml-idp/config.js.map +0 -1
- package/lib/saml-idp/connectedApps.js +0 -20
- package/lib/saml-idp/connectedApps.js.map +0 -1
- package/lib/saml-idp/express-middleware.js +0 -684
- package/lib/saml-idp/express-middleware.js.map +0 -1
- package/lib/saml-idp/index.js +0 -13
- package/lib/saml-idp/index.js.map +0 -1
- package/lib/saml-idp/simpleProfileMapper.js +0 -75
- package/lib/saml-idp/simpleProfileMapper.js.map +0 -1
- package/src/oauth2/client.ts +0 -0
- package/src/oauth2/config.ts +0 -15
- package/src/oauth2/consent.ts +0 -208
- package/src/oauth2/login.ts +0 -179
- package/src/oauth2/logout.ts +0 -66
- package/src/oauth2/stub/oidc-cert.ts +0 -86
- package/src/saml-idp/config.js +0 -85
- package/src/saml-idp/connectedApps.ts +0 -16
- package/src/saml-idp/express-middleware.js +0 -811
- package/src/saml-idp/index.ts +0 -14
- package/src/saml-idp/simpleProfileMapper.js +0 -82
- package/src/saml-idp/views/error.hbs +0 -11
- package/src/saml-idp/views/layout.hbs +0 -72
- package/src/saml-idp/views/samlresponse.hbs +0 -20
- package/src/saml-idp/views/settings.hbs +0 -175
- package/src/saml-idp/views/user.hbs +0 -261
- 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
|
-
}
|
package/src/saml-idp/config.js
DELETED
|
@@ -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
|
-
}
|