@things-factory/shell 10.1.47 → 10.1.106
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/middlewares/domain-middleware.js +2 -1
- package/dist-server/middlewares/domain-middleware.js.map +1 -1
- package/dist-server/service/index.d.ts +2 -2
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/tests/domain-middleware-refusal.test.ts +26 -0
- package/translations/en.json +6 -1
- package/translations/ja.json +6 -1
- package/translations/ko.json +6 -1
- package/translations/ms.json +6 -1
- package/translations/zh.json +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/shell",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.106",
|
|
4
4
|
"description": "Core module for framework",
|
|
5
5
|
"bin": {
|
|
6
6
|
"things-factory": "bin/things-factory",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"pg": "^8.7.3",
|
|
127
127
|
"sqlite3": "^5.0.8"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "8d78c14708420773ec32d18b8dd44c300771c44d"
|
|
130
130
|
}
|
|
@@ -42,3 +42,29 @@ describe('domain middleware - an address the domain does not let in', () => {
|
|
|
42
42
|
expect(await run(undefined, '10.0.0.1')).toEqual({ status: 200, headers: {}, passed: true })
|
|
43
43
|
})
|
|
44
44
|
})
|
|
45
|
+
|
|
46
|
+
describe('domain middleware - privileges the protected list withholds say they were the address', () => {
|
|
47
|
+
function stateAfter(iplist: any, ip: string) {
|
|
48
|
+
const context: any = {
|
|
49
|
+
state: { domain: { id: 'd1', iplist } },
|
|
50
|
+
req: { headers: { 'x-client-ip': ip }, connection: {}, socket: {} },
|
|
51
|
+
status: 200,
|
|
52
|
+
set: () => {}
|
|
53
|
+
}
|
|
54
|
+
return domainMiddleware(context, async () => {}).then(() => context.state)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const iplist = { protectedlist: ['^10\\.'], privileges: [{ category: 'board', privilege: 'mutation' }] }
|
|
58
|
+
|
|
59
|
+
it('★ outside the protected list each withheld privilege carries by: address (ADR-0103 decision 1)', async () => {
|
|
60
|
+
const state = await stateAfter(iplist, '192.168.0.9')
|
|
61
|
+
expect(state.unsafeIP).toBe(true)
|
|
62
|
+
expect(state.prohibitedPrivileges).toEqual([{ category: 'board', privilege: 'mutation', by: 'address' }])
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('inside the protected list nothing is withheld', async () => {
|
|
66
|
+
const state = await stateAfter(iplist, '10.0.0.1')
|
|
67
|
+
expect(state.unsafeIP).toBe(false)
|
|
68
|
+
expect(state.prohibitedPrivileges).toBeUndefined()
|
|
69
|
+
})
|
|
70
|
+
})
|
package/translations/en.json
CHANGED
|
@@ -177,5 +177,10 @@
|
|
|
177
177
|
"button.hide-start-pane": "hide the left pane",
|
|
178
178
|
"button.show-start-pane": "show the left pane",
|
|
179
179
|
"button.hide-end-pane": "hide the right pane",
|
|
180
|
-
"button.show-end-pane": "show the right pane"
|
|
180
|
+
"button.show-end-pane": "show the right pane",
|
|
181
|
+
"title.unsaved-draft": "there is an unsaved edit",
|
|
182
|
+
"text.unsaved-draft-kept": "what you changed {minutes} minutes ago is still kept in this browser.",
|
|
183
|
+
"text.unsaved-draft-behind": "it has been saved again since then. saving will tell you about the conflict.",
|
|
184
|
+
"button.resume-editing": "resume editing",
|
|
185
|
+
"button.discard": "discard"
|
|
181
186
|
}
|
package/translations/ja.json
CHANGED
|
@@ -177,5 +177,10 @@
|
|
|
177
177
|
"button.hide-start-pane": "左のパネルを閉じる",
|
|
178
178
|
"button.show-start-pane": "左のパネルを開く",
|
|
179
179
|
"button.hide-end-pane": "右のパネルを閉じる",
|
|
180
|
-
"button.show-end-pane": "右のパネルを開く"
|
|
180
|
+
"button.show-end-pane": "右のパネルを開く",
|
|
181
|
+
"title.unsaved-draft": "保存していない編集があります",
|
|
182
|
+
"text.unsaved-draft-kept": "{minutes}分前に変更した内容がこのブラウザに残っています。",
|
|
183
|
+
"text.unsaved-draft-behind": "その後、再び保存されています。保存するときに競合をお知らせします。",
|
|
184
|
+
"button.resume-editing": "編集を続ける",
|
|
185
|
+
"button.discard": "破棄"
|
|
181
186
|
}
|
package/translations/ko.json
CHANGED
|
@@ -177,5 +177,10 @@
|
|
|
177
177
|
"button.hide-start-pane": "왼쪽 판 접기",
|
|
178
178
|
"button.show-start-pane": "왼쪽 판 펼치기",
|
|
179
179
|
"button.hide-end-pane": "오른쪽 판 접기",
|
|
180
|
-
"button.show-end-pane": "오른쪽 판 펼치기"
|
|
180
|
+
"button.show-end-pane": "오른쪽 판 펼치기",
|
|
181
|
+
"title.unsaved-draft": "저장하지 않은 편집이 있습니다",
|
|
182
|
+
"text.unsaved-draft-kept": "{minutes}분 전에 고친 내용이 이 브라우저에 남아 있습니다.",
|
|
183
|
+
"text.unsaved-draft-behind": "그 뒤에 다시 저장되었습니다. 저장할 때 충돌을 알려 드립니다.",
|
|
184
|
+
"button.resume-editing": "이어서 편집",
|
|
185
|
+
"button.discard": "버리기"
|
|
181
186
|
}
|
package/translations/ms.json
CHANGED
|
@@ -177,5 +177,10 @@
|
|
|
177
177
|
"button.hide-start-pane": "sembunyikan panel kiri",
|
|
178
178
|
"button.show-start-pane": "tunjukkan panel kiri",
|
|
179
179
|
"button.hide-end-pane": "sembunyikan panel kanan",
|
|
180
|
-
"button.show-end-pane": "tunjukkan panel kanan"
|
|
180
|
+
"button.show-end-pane": "tunjukkan panel kanan",
|
|
181
|
+
"title.unsaved-draft": "ada suntingan yang belum disimpan",
|
|
182
|
+
"text.unsaved-draft-kept": "perubahan yang anda buat {minutes} minit lalu masih disimpan dalam pelayar ini.",
|
|
183
|
+
"text.unsaved-draft-behind": "ia telah disimpan semula sejak itu. semasa menyimpan, anda akan dimaklumkan tentang konflik.",
|
|
184
|
+
"button.resume-editing": "sambung menyunting",
|
|
185
|
+
"button.discard": "buang"
|
|
181
186
|
}
|
package/translations/zh.json
CHANGED
|
@@ -177,5 +177,10 @@
|
|
|
177
177
|
"button.hide-start-pane": "收起左侧面板",
|
|
178
178
|
"button.show-start-pane": "展开左侧面板",
|
|
179
179
|
"button.hide-end-pane": "收起右侧面板",
|
|
180
|
-
"button.show-end-pane": "展开右侧面板"
|
|
180
|
+
"button.show-end-pane": "展开右侧面板",
|
|
181
|
+
"title.unsaved-draft": "有未保存的编辑",
|
|
182
|
+
"text.unsaved-draft-kept": "您 {minutes} 分钟前所做的更改仍保留在此浏览器中。",
|
|
183
|
+
"text.unsaved-draft-behind": "此后已被再次保存。保存时会提示冲突。",
|
|
184
|
+
"button.resume-editing": "继续编辑",
|
|
185
|
+
"button.discard": "放弃"
|
|
181
186
|
}
|