@things-factory/auth-base 10.1.27 → 10.1.29

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/auth-base",
3
- "version": "10.1.27",
3
+ "version": "10.1.29",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -34,9 +34,9 @@
34
34
  "@reduxjs/toolkit": "^2.2.5",
35
35
  "@simplewebauthn/browser": "^13.0.0",
36
36
  "@simplewebauthn/server": "^13.0.0",
37
- "@things-factory/email-base": "^10.1.27",
37
+ "@things-factory/email-base": "^10.1.29",
38
38
  "@things-factory/env": "^10.1.20",
39
- "@things-factory/shell": "^10.1.27",
39
+ "@things-factory/shell": "^10.1.29",
40
40
  "@things-factory/utils": "^10.1.20",
41
41
  "@types/webappsec-credential-management": "^0.6.9",
42
42
  "jsonwebtoken": "^9.0.0",
@@ -48,5 +48,5 @@
48
48
  "passport-jwt": "^4.0.0",
49
49
  "passport-local": "^1.0.0"
50
50
  },
51
- "gitHead": "d04dc762cacf2aac8ba0b0f5d768eca365fc09da"
51
+ "gitHead": "e6bf9dec003fe5e794746aaeb5852b3b50478232"
52
52
  }
@@ -16,7 +16,7 @@ import { makeExecutableSchema } from '@graphql-tools/schema'
16
16
 
17
17
  import { loadCompiled } from './compiled'
18
18
 
19
- const { privilegeDirectiveTypeDefs, privilegeDirectiveResolver } = loadCompiled(
19
+ const { privilegeDirectiveTypeDefs, privilegeDirectiveResolver, privilegeOfField } = loadCompiled(
20
20
  'service/privilege/privilege-directive'
21
21
  )
22
22
  const { User } = loadCompiled('service/user/user')
@@ -171,6 +171,40 @@ describe('스키마를 지으면서 남기는 것', () => {
171
171
  expect((process as any).PRIVILEGES['board mutation']).toEqual(['board', 'mutation'])
172
172
  })
173
173
 
174
+ /*
175
+ * What each field asks for, by name — so another entrance to the same door (an AI tool) reads
176
+ * the door's own declaration instead of copying it (operato-twin ADR-0071 / ADR-0072).
177
+ */
178
+ it('records what a declared field asks for, all four parts', () => {
179
+ buildSchema()
180
+
181
+ expect(privilegeOfField('Query', 'guardedBoard')).toEqual({
182
+ known: true,
183
+ gate: { category: 'board', privilege: 'mutation', owner: false, super: false }
184
+ })
185
+ })
186
+
187
+ it('records an ownership-only field too — it names no pair but it is still a gate', () => {
188
+ buildSchema()
189
+
190
+ expect(privilegeOfField('Query', 'ownershipOnly')).toEqual({
191
+ known: true,
192
+ gate: { category: undefined, privilege: undefined, owner: true, super: false }
193
+ })
194
+ })
195
+
196
+ it('says a root field with no directive is known and open', () => {
197
+ buildSchema()
198
+
199
+ expect(privilegeOfField('Query', 'undeclared')).toEqual({ known: true, gate: null })
200
+ })
201
+
202
+ it('does not call a field it has never seen open — a typo is not an open door', () => {
203
+ buildSchema()
204
+
205
+ expect(privilegeOfField('Query', 'guardedBord')).toEqual({ known: false })
206
+ })
207
+
174
208
  it('필드 설명에 필요한 권한을 적어 둔다', async () => {
175
209
  const schema = buildSchema()
176
210
  const description = (schema.getQueryType() as any).getFields().guardedBoard.description