@things-factory/shell 6.2.50 → 6.2.52

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/shell",
3
- "version": "6.2.50",
3
+ "version": "6.2.52",
4
4
  "description": "Core module for framework",
5
5
  "bin": {
6
6
  "things-factory": "bin/things-factory",
@@ -133,5 +133,5 @@
133
133
  "pg": "^8.7.3",
134
134
  "sqlite3": "^5.0.8"
135
135
  },
136
- "gitHead": "4dc51db04b745ac434d2bb874038ac4c3b47989b"
136
+ "gitHead": "234f95b63937521f1791a9e2141024ee7816d26d"
137
137
  }
@@ -42,13 +42,13 @@ export async function domainMiddleware(context: any, next: any) {
42
42
  }
43
43
 
44
44
  if (Array.isArray(protectedlist) && protectedlist.length > 0) {
45
- const protectedIP = protectedlist.some(item => {
45
+ const safe = protectedlist.some(item => {
46
46
  return new RegExp(item).test(ip)
47
47
  })
48
48
 
49
- context.state.unsafeIP = !protectedIP
49
+ context.state.unsafeIP = !safe
50
50
 
51
- if (!protectedIP) {
51
+ if (!safe) {
52
52
  context.state.prohibitedPrivileges = privileges
53
53
  }
54
54
  }
@@ -38,10 +38,6 @@ export class DomainQuery {
38
38
  @Query(returns => ScalarObject, { nullable: true, description: 'To fetch domain' })
39
39
  async secureIPList(@Ctx() context: any): Promise<IPList | null> {
40
40
  const { domain } = context.state
41
- // const repository = getRepository(Domain)
42
-
43
- // const { iplist } = await repository.findOneBy({ id })
44
-
45
41
  return domain.iplist
46
42
  }
47
43
 
@@ -25,7 +25,7 @@ export type IPList = {
25
25
  protectedlist?: string[]
26
26
  privileges?: {
27
27
  category: string
28
- name: string
28
+ privilege: string
29
29
  }[]
30
30
  }
31
31