@jmruthers/pace-core 0.5.108 → 0.5.110
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/CHANGELOG.md +93 -173
- package/dist/{AuthService-1D2ifNfa.d.ts → AuthService-DrHrvXNZ.d.ts} +8 -1
- package/dist/{DataTable-WFCHVWTY.js → DataTable-D3BK2FCN.js} +7 -7
- package/dist/{UnifiedAuthProvider-XU4BHFXZ.js → UnifiedAuthProvider-A7I23UCN.js} +3 -3
- package/dist/{api-KG4A2X7P.js → api-PIE4JRFS.js} +2 -2
- package/dist/{chunk-DMNMZKWS.js → chunk-2W4WKJVF.js} +4 -4
- package/dist/{chunk-B3QX32P5.js → chunk-3J5N2T2N.js} +85 -28
- package/dist/chunk-3J5N2T2N.js.map +1 -0
- package/dist/{chunk-MOMYOQMC.js → chunk-7GBEBJLR.js} +29 -37
- package/dist/chunk-7GBEBJLR.js.map +1 -0
- package/dist/{chunk-X4FRXJV6.js → chunk-AUXS7XSO.js} +57 -6
- package/dist/{chunk-X4FRXJV6.js.map → chunk-AUXS7XSO.js.map} +1 -1
- package/dist/{chunk-VJ7MPS2K.js → chunk-AWK2FAUN.js} +6 -6
- package/dist/{chunk-LT6RKRA7.js → chunk-D6MEKC27.js} +2 -2
- package/dist/{chunk-KBG34SVL.js → chunk-EYSXQ756.js} +2 -2
- package/dist/{chunk-ZXY5NTJB.js → chunk-EZ64QG2I.js} +2 -2
- package/dist/chunk-GZRXOUBE.js +176 -0
- package/dist/chunk-GZRXOUBE.js.map +1 -0
- package/dist/{chunk-QDDUU625.js → chunk-HADXAZT3.js} +4 -4
- package/dist/{chunk-IMZGJ2X7.js → chunk-HGZSO43Y.js} +4 -4
- package/dist/{chunk-S63MFSY6.js → chunk-XRSP3H52.js} +15 -8
- package/dist/chunk-XRSP3H52.js.map +1 -0
- package/dist/{chunk-GVRSXXAA.js → chunk-YFMENCR4.js} +3 -3
- package/dist/components.js +9 -9
- package/dist/{database-BXAfr2Y_.d.ts → database-C6jy7EOu.d.ts} +21 -9
- package/dist/{formatting-BiEv5oEk.d.ts → formatting-B1jSqgl-.d.ts} +16 -1
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +6 -6
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +4 -3
- package/dist/providers.js +2 -2
- package/dist/rbac/index.d.ts +35 -23
- package/dist/rbac/index.js +8 -8
- package/dist/types.d.ts +2 -2
- package/dist/{usePublicRouteParams-CnM-IK2I.d.ts → usePublicRouteParams-BdF8bZgs.d.ts} +1 -1
- package/dist/utils.d.ts +2 -15
- package/dist/utils.js +4 -145
- package/dist/utils.js.map +1 -1
- package/dist/validation.d.ts +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +9 -8
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +3 -3
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +19 -8
- package/docs/api/interfaces/RBACLogger.md +5 -5
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +55 -20
- package/docs/api-reference/hooks.md +53 -0
- package/docs/api-reference/providers.md +60 -0
- package/docs/core-concepts/authentication.md +2 -0
- package/docs/documentation-index.md +0 -2
- package/docs/implementation-guides/authentication.md +1 -0
- package/docs/rbac/README.md +114 -38
- package/docs/rbac/api-reference.md +63 -16
- package/docs/rbac/getting-started.md +16 -16
- package/docs/rbac/quick-start.md +110 -35
- package/docs/rbac/troubleshooting.md +125 -2
- package/docs/security/README.md +59 -0
- package/package.json +1 -1
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +38 -4
- package/src/components/NavigationMenu/NavigationMenu.tsx +71 -6
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +2 -2
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +48 -16
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +2 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +9 -9
- package/src/index.ts +3 -0
- package/src/providers/services/AuthServiceProvider.tsx +4 -3
- package/src/providers/services/UnifiedAuthProvider.tsx +1 -1
- package/src/rbac/api.test.ts +2 -2
- package/src/rbac/api.ts +2 -1
- package/src/rbac/components/PagePermissionGuard.tsx +21 -38
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +1 -1
- package/src/rbac/config.ts +2 -0
- package/src/rbac/engine.ts +17 -5
- package/src/rbac/security.ts +1 -1
- package/src/services/AuthService.ts +79 -1
- package/src/services/__tests__/AuthService.test.ts +184 -0
- package/src/types/database.ts +21 -9
- package/src/types/rbac-functions.ts +2 -1
- package/src/utils/__tests__/sessionTracking.unit.test.ts +6 -171
- package/src/utils/sessionTracking.ts +7 -81
- package/dist/chunk-B3QX32P5.js.map +0 -1
- package/dist/chunk-MOMYOQMC.js.map +0 -1
- package/dist/chunk-NFPV7MRN.js +0 -94
- package/dist/chunk-NFPV7MRN.js.map +0 -1
- package/dist/chunk-S63MFSY6.js.map +0 -1
- package/docs/rbac/breaking-changes-v3.md +0 -222
- package/docs/rbac/migration-guide.md +0 -260
- package/src/providers/AuthProvider.simplified.tsx +0 -974
- package/dist/{DataTable-WFCHVWTY.js.map → DataTable-D3BK2FCN.js.map} +0 -0
- package/dist/{UnifiedAuthProvider-XU4BHFXZ.js.map → UnifiedAuthProvider-A7I23UCN.js.map} +0 -0
- package/dist/{api-KG4A2X7P.js.map → api-PIE4JRFS.js.map} +0 -0
- package/dist/{chunk-DMNMZKWS.js.map → chunk-2W4WKJVF.js.map} +0 -0
- package/dist/{chunk-VJ7MPS2K.js.map → chunk-AWK2FAUN.js.map} +0 -0
- package/dist/{chunk-LT6RKRA7.js.map → chunk-D6MEKC27.js.map} +0 -0
- package/dist/{chunk-KBG34SVL.js.map → chunk-EYSXQ756.js.map} +0 -0
- package/dist/{chunk-ZXY5NTJB.js.map → chunk-EZ64QG2I.js.map} +0 -0
- package/dist/{chunk-QDDUU625.js.map → chunk-HADXAZT3.js.map} +0 -0
- package/dist/{chunk-IMZGJ2X7.js.map → chunk-HGZSO43Y.js.map} +0 -0
- package/dist/{chunk-GVRSXXAA.js.map → chunk-YFMENCR4.js.map} +0 -0
- package/dist/{validation-D8VcbTzC.d.ts → validation-DnhrNMju.d.ts} +2 -2
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
lastUpdated: 2025-10-29T22:43:00+11:00
|
|
3
|
-
version: 0.5.76
|
|
4
|
-
reviewedBy: content-audit
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# RBAC Migration Guide - Breaking Changes
|
|
8
|
-
|
|
9
|
-
This guide helps you migrate to the new mandatory security validation in the RBAC system.
|
|
10
|
-
|
|
11
|
-
## Overview
|
|
12
|
-
|
|
13
|
-
The RBAC system now requires mandatory security validation for all permission checks. This ensures all operations go through proper security validation, rate limiting, and audit logging.
|
|
14
|
-
|
|
15
|
-
## What Changed
|
|
16
|
-
|
|
17
|
-
### Before (v2.0.0 and earlier)
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
// SecurityContext was optional
|
|
21
|
-
const hasPermission = await engine.isPermitted({
|
|
22
|
-
userId,
|
|
23
|
-
scope,
|
|
24
|
-
permission
|
|
25
|
-
}); // No securityContext parameter
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### After (v3.0.0)
|
|
29
|
-
|
|
30
|
-
```typescript
|
|
31
|
-
// SecurityContext is now mandatory
|
|
32
|
-
const hasPermission = await engine.isPermitted({
|
|
33
|
-
userId,
|
|
34
|
-
scope,
|
|
35
|
-
permission
|
|
36
|
-
}, {
|
|
37
|
-
userId,
|
|
38
|
-
organisationId: scope.organisationId,
|
|
39
|
-
timestamp: new Date()
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Migration Options
|
|
44
|
-
|
|
45
|
-
### Option 1: Use the API Layer (Recommended)
|
|
46
|
-
|
|
47
|
-
The easiest migration path is to use the `isPermitted()` function from the API layer, which automatically creates the security context:
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
import { isPermitted } from '@jmruthers/pace-core/rbac';
|
|
51
|
-
|
|
52
|
-
// No changes needed - API creates security context automatically
|
|
53
|
-
const hasPermission = await isPermitted({
|
|
54
|
-
userId,
|
|
55
|
-
scope,
|
|
56
|
-
permission
|
|
57
|
-
});
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Option 2: Create Security Context Manually
|
|
61
|
-
|
|
62
|
-
If you're calling the engine directly, create a security context:
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
import { RBACEngine, setupRBAC } from '@jmruthers/pace-core/rbac';
|
|
66
|
-
|
|
67
|
-
// Setup RBAC once
|
|
68
|
-
setupRBAC(supabase);
|
|
69
|
-
|
|
70
|
-
// Create security context
|
|
71
|
-
const securityContext = {
|
|
72
|
-
userId,
|
|
73
|
-
organisationId: scope.organisationId,
|
|
74
|
-
timestamp: new Date()
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// Use with engine
|
|
78
|
-
const engine = getRBACEngine();
|
|
79
|
-
const hasPermission = await engine.isPermitted({
|
|
80
|
-
userId,
|
|
81
|
-
scope,
|
|
82
|
-
permission
|
|
83
|
-
}, securityContext);
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Breaking Changes
|
|
87
|
-
|
|
88
|
-
### 1. SecurityContext Now Required
|
|
89
|
-
|
|
90
|
-
**Impact**: All direct calls to `RBACEngine.isPermitted()` must provide security context.
|
|
91
|
-
|
|
92
|
-
**Migration**: Use the API layer's `isPermitted()` function instead of calling the engine directly.
|
|
93
|
-
|
|
94
|
-
### 2. organisationId Now Optional in SecurityContext
|
|
95
|
-
|
|
96
|
-
**Impact**: Events without organisation context (e.g., global admin operations) are now properly logged.
|
|
97
|
-
|
|
98
|
-
**Migration**: No action needed if you're using the API layer. If creating security context manually, you can omit `organisationId`:
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
const securityContext = {
|
|
102
|
-
userId,
|
|
103
|
-
// organisationId is now optional
|
|
104
|
-
timestamp: new Date()
|
|
105
|
-
};
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Enhanced Features
|
|
109
|
-
|
|
110
|
-
### 1. Mandatory Rate Limiting
|
|
111
|
-
|
|
112
|
-
All permission checks now go through rate limiting. By default, users are limited to 100 permission checks per minute.
|
|
113
|
-
|
|
114
|
-
To configure rate limits:
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
import { setupRBAC } from '@jmruthers/pace-core/rbac';
|
|
118
|
-
|
|
119
|
-
setupRBAC(supabase, {
|
|
120
|
-
maxPermissionChecksPerMinute: 200 // Increase for high-traffic apps
|
|
121
|
-
});
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 2. Comprehensive Audit Logging
|
|
125
|
-
|
|
126
|
-
All permission checks are now audited, including:
|
|
127
|
-
- Super admin bypasses
|
|
128
|
-
- Operations without organisation context
|
|
129
|
-
- Failed authentication attempts
|
|
130
|
-
|
|
131
|
-
Audit events are stored in the `rbac_audit_events` table with the following structure:
|
|
132
|
-
|
|
133
|
-
```typescript
|
|
134
|
-
{
|
|
135
|
-
event_type: 'permission_check' | 'permission_denied' | 'role_granted' | 'role_denied' | 'rls_denied',
|
|
136
|
-
user_id: UUID,
|
|
137
|
-
organisation_id: UUID, // May be null UUID for global operations
|
|
138
|
-
event_id?: string,
|
|
139
|
-
app_id?: UUID,
|
|
140
|
-
page_id?: UUID,
|
|
141
|
-
permission?: string,
|
|
142
|
-
decision?: boolean,
|
|
143
|
-
source: 'api' | 'ui' | 'middleware' | 'rls',
|
|
144
|
-
bypass?: boolean,
|
|
145
|
-
duration_ms?: number,
|
|
146
|
-
metadata: {
|
|
147
|
-
cache_hit?: boolean,
|
|
148
|
-
cache_source?: 'memory' | 'database' | 'rpc',
|
|
149
|
-
no_organisation_context?: boolean
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### 3. Input Validation
|
|
155
|
-
|
|
156
|
-
All inputs are now validated before processing:
|
|
157
|
-
- User ID format (must be valid UUID)
|
|
158
|
-
- Permission format (must match `operation:resource` pattern)
|
|
159
|
-
- Scope format (must include at least one valid identifier)
|
|
160
|
-
|
|
161
|
-
Invalid inputs trigger security events and return false (deny access).
|
|
162
|
-
|
|
163
|
-
## Security Improvements
|
|
164
|
-
|
|
165
|
-
### Rate Limiting
|
|
166
|
-
|
|
167
|
-
The system now implements in-memory rate limiting with a sliding window algorithm:
|
|
168
|
-
|
|
169
|
-
- **Window**: 1 minute
|
|
170
|
-
- **Default limit**: 100 requests per minute per user
|
|
171
|
-
- **Automatic cleanup**: Expired entries are cleared every 5 minutes
|
|
172
|
-
|
|
173
|
-
To implement distributed rate limiting, migrate to Redis or Supabase Edge Functions.
|
|
174
|
-
|
|
175
|
-
### Security Event Logging
|
|
176
|
-
|
|
177
|
-
Security events are now logged even without organisation context:
|
|
178
|
-
|
|
179
|
-
```typescript
|
|
180
|
-
// These events are now audited:
|
|
181
|
-
// 1. Super admin bypasses (bypass: true)
|
|
182
|
-
// 2. Permission denied events
|
|
183
|
-
// 3. Invalid input events
|
|
184
|
-
// 4. Rate limit exceeded events
|
|
185
|
-
// 5. Suspicious activity events
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
## Migration Checklist
|
|
189
|
-
|
|
190
|
-
- [ ] Update all calls to `RBACEngine.isPermitted()` to use API layer
|
|
191
|
-
- [ ] Remove optional securityContext parameters from code
|
|
192
|
-
- [ ] Configure rate limits for your application's needs
|
|
193
|
-
- [ ] Update audit log queries to handle events without organisation context
|
|
194
|
-
- [ ] Test permission checks with various user roles
|
|
195
|
-
- [ ] Monitor rate limiting to ensure no false positives
|
|
196
|
-
|
|
197
|
-
## Backward Compatibility
|
|
198
|
-
|
|
199
|
-
The API layer maintains backward compatibility:
|
|
200
|
-
|
|
201
|
-
```typescript
|
|
202
|
-
// This still works - API creates security context automatically
|
|
203
|
-
import { isPermitted } from '@jmruthers/pace-core/rbac';
|
|
204
|
-
|
|
205
|
-
const hasPermission = await isPermitted({
|
|
206
|
-
userId,
|
|
207
|
-
scope,
|
|
208
|
-
permission
|
|
209
|
-
});
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
## Common Issues
|
|
213
|
-
|
|
214
|
-
### Issue: Rate Limit Exceeded
|
|
215
|
-
|
|
216
|
-
**Symptom**: `rate_limit_exceeded` security events in logs.
|
|
217
|
-
|
|
218
|
-
**Solution**: Increase the rate limit or implement caching for frequently accessed permissions.
|
|
219
|
-
|
|
220
|
-
### Issue: Invalid Input
|
|
221
|
-
|
|
222
|
-
**Symptom**: Permission checks returning false with `invalid_input` events.
|
|
223
|
-
|
|
224
|
-
**Solution**: Ensure all UUIDs are valid and permission strings match the `operation:resource` pattern.
|
|
225
|
-
|
|
226
|
-
### Issue: Missing Organisation Context
|
|
227
|
-
|
|
228
|
-
**Symptom**: Warnings in console about missing organisation context.
|
|
229
|
-
|
|
230
|
-
**Solution**: Either provide organisation context or update your queries to filter by `no_organisation_context` metadata flag.
|
|
231
|
-
|
|
232
|
-
## Testing Your Migration
|
|
233
|
-
|
|
234
|
-
1. **Test with all user roles**:
|
|
235
|
-
- Super admin
|
|
236
|
-
- Organisation admin
|
|
237
|
-
- Event admin
|
|
238
|
-
- Regular users
|
|
239
|
-
|
|
240
|
-
2. **Test rate limiting**:
|
|
241
|
-
- Make more than 100 permission checks in a minute
|
|
242
|
-
- Verify rate limit exceeded events are logged
|
|
243
|
-
|
|
244
|
-
3. **Test audit logging**:
|
|
245
|
-
- Check `rbac_audit_events` table
|
|
246
|
-
- Verify all permission checks are logged
|
|
247
|
-
- Verify events without organisation context are flagged
|
|
248
|
-
|
|
249
|
-
4. **Test error handling**:
|
|
250
|
-
- Invalid UUIDs
|
|
251
|
-
- Malformed permission strings
|
|
252
|
-
- Missing required fields
|
|
253
|
-
|
|
254
|
-
## Support
|
|
255
|
-
|
|
256
|
-
For questions or issues with the migration, please:
|
|
257
|
-
1. Check the [Troubleshooting Guide](./troubleshooting.md)
|
|
258
|
-
2. Review the [API Reference](./api-reference.md)
|
|
259
|
-
3. Open an issue on the project repository
|
|
260
|
-
|