Draft: feat: knowledge graph redaction API endpoint
What does this MR do and why?
References
Screenshots or screen recordings
use with admin token
python3 -m scripts.knowledge_graph --token glpat-Q_...
21:56:48 [INFO] ============================================================
21:56:48 [INFO] Knowledge Graph Authorization Validation
21:56:48 [INFO] ============================================================
21:56:48 [INFO] GitLab URL: http://localhost:3000
21:56:48 [INFO] Rails Root: .
21:56:48 [INFO]
21:56:48 [INFO] ============================================================
21:56:48 [INFO] SETUP: Creating test data
21:56:48 [INFO] ============================================================
21:57:04 [INFO] Created user: kg_test_with_access_1764989808 (ID: 90)
21:57:04 [INFO] Created user: kg_test_no_access_1764989808 (ID: 91)
21:57:05 [INFO] Created user: kg_test_blocked_1764989808 (ID: 92)
21:57:05 [INFO] Blocked user 92
21:57:08 [INFO] Created project: kg_test_project_public_1764989808 (ID: 73, visibility: public)
21:57:09 [INFO] Created project: kg_test_project_private_1764989808 (ID: 74, visibility: private)
21:57:09 [INFO] Added user 90 to project 74 with access level 30
21:57:24 [INFO] Refreshed authorizations for user 90
21:57:25 [INFO] Created issue: KG Test Issue public (ID: 159, confidential: False)
21:57:26 [INFO] Created issue: KG Test Issue private (ID: 160, confidential: False)
21:57:26 [INFO] Created issue: KG Test Issue confidential (ID: 161, confidential: True)
21:57:27 [INFO] Created MR: KG Test MR private (ID: 281)
21:57:27 [INFO] Setup complete: 3 users, 2 projects, 4 resources
21:57:27 [INFO] ============================================================
21:57:27 [INFO] RUNNING TESTS
21:57:27 [INFO] ============================================================
21:57:27 [INFO] [PASS] Public resource access: User can access public resource (56.08ms)
21:57:27 [INFO] [PASS] Private resource - no access: User correctly denied access to private resource (69.73ms)
21:57:28 [INFO] [PASS] Private resource - with access: User with access can see private resource (48.61ms)
21:57:28 [INFO] [PASS] Confidential issue access: Project member can access confidential issue (50.69ms)
21:57:28 [INFO] [PASS] Blocked user - no access: Blocked user correctly gets empty authorizations (14.14ms)
21:57:28 [INFO] [PASS] Non-existent user: Non-existent user correctly gets empty authorizations (14.63ms)
21:57:28 [INFO] [PASS] Non-existent resource: Non-existent resource correctly returns false (22.66ms)
21:57:28 [INFO] [PASS] Merge request authorization: MR authorization works correctly (93.13ms)
21:57:28 [INFO] [PASS] Batch authorization: Batch authorization returned results for 2 resource types (80.70ms)
21:57:28 [INFO] [PASS] Empty resources: Empty resources returns empty authorizations (17.84ms)
21:57:28 [INFO] Creating 100 merge requests for large batch test...
21:57:29 [INFO] Created MR: KG Test MR batch_0 (ID: 282)
21:57:31 [INFO] Created MR: KG Test MR batch_1 (ID: 283)
...
21:59:37 [INFO] Created MR: KG Test MR batch_98 (ID: 380)
21:59:39 [INFO] Created MR: KG Test MR batch_99 (ID: 381)
21:59:39 [INFO] Created 100 MRs, testing batch authorization...
21:59:39 [INFO] [PASS] Large batch MRs: Authorized 100/100 MRs (133.30ms)
21:59:39 [INFO] ============================================================
21:59:39 [INFO] TEST SUMMARY
21:59:39 [INFO] ============================================================
21:59:39 [INFO] Total: 11, Passed: 11, Failed: 0
21:59:39 [INFO]
21:59:39 [INFO] ============================================================
21:59:39 [INFO] CLEANUP: Removing test data
21:59:39 [INFO] ============================================================
21:59:39 [INFO] Deleted project: kg_test_project_public_1764989808
21:59:40 [INFO] Deleted project: kg_test_project_private_1764989808
21:59:40 [INFO] Deleted user: kg_test_with_access_1764989808
21:59:40 [INFO] Deleted user: kg_test_no_access_1764989808
21:59:40 [INFO] Deleted user: kg_test_blocked_1764989808
⋊> ~/g/k/g/gitlab on redaction-design ◦
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Michael Angelo Rivera