@things-factory/auth-base 7.0.68 → 7.0.71
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/dist-server/controllers/change-pwd.js.map +1 -1
- package/dist-server/service/user/user-query.d.ts +4 -3
- package/dist-server/service/user/user-query.js +21 -0
- package/dist-server/service/user/user-query.js.map +1 -1
- package/dist-server/service/user/user-types.d.ts +11 -0
- package/dist-server/service/user/user-types.js +43 -1
- package/dist-server/service/user/user-types.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/server/controllers/change-pwd.ts +1 -0
- package/server/service/user/user-query.ts +18 -4
- package/server/service/user/user-types.ts +30 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/auth-base",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.71",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "dist-client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -32,10 +32,10 @@
|
|
32
32
|
"dependencies": {
|
33
33
|
"@simplewebauthn/browser": "^10.0.0",
|
34
34
|
"@simplewebauthn/server": "^10.0.0",
|
35
|
-
"@things-factory/email-base": "^7.0.
|
36
|
-
"@things-factory/env": "^7.0.
|
37
|
-
"@things-factory/shell": "^7.0.
|
38
|
-
"@things-factory/utils": "^7.0.
|
35
|
+
"@things-factory/email-base": "^7.0.70",
|
36
|
+
"@things-factory/env": "^7.0.70",
|
37
|
+
"@things-factory/shell": "^7.0.70",
|
38
|
+
"@things-factory/utils": "^7.0.70",
|
39
39
|
"@types/webappsec-credential-management": "^0.6.8",
|
40
40
|
"jsonwebtoken": "^9.0.0",
|
41
41
|
"koa-passport": "^6.0.0",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"passport-jwt": "^4.0.0",
|
47
47
|
"passport-local": "^1.0.0"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "d242e4a4415764d0d389e9dff09d2ce3a8fc317f"
|
50
50
|
}
|
@@ -3,17 +3,31 @@ import { GraphQLEmailAddress } from 'graphql-scalars'
|
|
3
3
|
import { ILike, SelectQueryBuilder } from 'typeorm'
|
4
4
|
|
5
5
|
import { config } from '@things-factory/env'
|
6
|
-
import {
|
6
|
+
import { getRepository, ListParam, getQueryBuilderFromListParams } from '@things-factory/shell'
|
7
7
|
|
8
8
|
import { checkUserBelongsDomain } from '../../utils/check-user-belongs-domain'
|
9
9
|
import { buildDomainUsersQueryBuilder } from '../../utils/get-domain-users'
|
10
|
-
import { Appliance } from '../appliance/appliance'
|
11
|
-
import { Application } from '../application/application'
|
12
10
|
import { User } from './user'
|
13
|
-
import { UserList } from './user-types'
|
11
|
+
import { PasswordRule, UserList } from './user-types'
|
12
|
+
|
13
|
+
const passwordRule = config.get('password') || {
|
14
|
+
lowerCase: true,
|
15
|
+
upperCase: true,
|
16
|
+
digit: true,
|
17
|
+
specialCharacter: true,
|
18
|
+
allowRepeat: false,
|
19
|
+
useTightPattern: true,
|
20
|
+
useLoosePattern: false,
|
21
|
+
tightCharacterLength: 8,
|
22
|
+
looseCharacterLength: 15
|
23
|
+
}
|
14
24
|
|
15
25
|
@Resolver(User)
|
16
26
|
export class UserQuery {
|
27
|
+
@Query(returns => PasswordRule, { description: 'To get password rule' })
|
28
|
+
passwordRule(@Ctx() context: ResolverContext): PasswordRule {
|
29
|
+
return passwordRule
|
30
|
+
}
|
17
31
|
@Directive('@privilege(category: "user", privilege: "query", domainOwnerGranted: true, superUserGranted: true)')
|
18
32
|
@Query(returns => User, { description: 'To fetch user' })
|
19
33
|
async user(@Arg('email', type => GraphQLEmailAddress) email: string, @Ctx() context: ResolverContext): Promise<User> {
|
@@ -3,6 +3,36 @@ import { GraphQLEmailAddress } from 'graphql-scalars'
|
|
3
3
|
import { ObjectRef } from '@things-factory/shell'
|
4
4
|
import { User } from './user'
|
5
5
|
|
6
|
+
@ObjectType()
|
7
|
+
export class PasswordRule {
|
8
|
+
@Field({ nullable: true })
|
9
|
+
lowerCase?: boolean
|
10
|
+
|
11
|
+
@Field({ nullable: true })
|
12
|
+
upperCase?: boolean
|
13
|
+
|
14
|
+
@Field({ nullable: true })
|
15
|
+
digit?: boolean
|
16
|
+
|
17
|
+
@Field({ nullable: true })
|
18
|
+
specialCharacter?: boolean
|
19
|
+
|
20
|
+
@Field({ nullable: true })
|
21
|
+
allowRepeat?: boolean
|
22
|
+
|
23
|
+
@Field({ nullable: true })
|
24
|
+
useTightPattern?: boolean
|
25
|
+
|
26
|
+
@Field({ nullable: true })
|
27
|
+
useLoosePattern?: boolean
|
28
|
+
|
29
|
+
@Field({ nullable: true })
|
30
|
+
tightCharacterLength?: number
|
31
|
+
|
32
|
+
@Field({ nullable: true })
|
33
|
+
looseCharacterLength?: number
|
34
|
+
}
|
35
|
+
|
6
36
|
@InputType()
|
7
37
|
export class NewUser {
|
8
38
|
@Field()
|