Commit 3f91f4d
authored
feat: Implement Request Interceptor Plugin (#14)
## Summary
Implements Request Interceptor Plugin wrapping Chrome's
`declarativeNetRequest` API.
**Closes #3**
## What's Changed
### Request Interceptor Plugin
- `enable()` - Apply auth rules as Chrome rules
- `disable()` - Remove all rules
- `updateRules()` - Refresh from storage
- `getRuleCount()` / `isAtLimit()` - Rule management
- Auto-enables on SDK ready
- Auto-updates when storage changes
- Event emission for observability
### Design
- `xmlhttprequest` resource type only (API calls)
- Rule IDs = array index + 1 (simple, predictable)
- `set` operation (replaces existing auth header)
- All rules priority 1
- Rejects >300 rules with clear error
## Dependencies
- Chrome Storage Plugin (#1)
- Pattern Matcher Plugin (#2)
- Chrome's `declarativeNetRequest` API
## Testing
- ✅ Linter: No errors (except expected `any` in SDK Kit plugin
signature)
- ✅ TypeScript: Compiles cleanly
- ⏭️ Manual testing: Will test in background worker (Issue #4)
## Next Steps
After merge:
- Issue #4: Background Service Worker (wire all 3 plugins together!)
- Then test the full extension!1 parent 3ef059e commit 3f91f4d
File tree
13 files changed
+4069
-31
lines changed- .husky
- src
- background/plugins
13 files changed
+4069
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
0 commit comments