@atlashub/smartstack-cli 3.53.0 → 3.54.0

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": "@atlashub/smartstack-cli",
3
- "version": "3.53.0",
3
+ "version": "3.54.0",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -1390,3 +1390,29 @@ public class {Module}DevDataSeeder : IDevDataSeeder
1390
1390
  > **Pipeline validation:**
1391
1391
  > - ralph-loop POST-CHECK warns if GUID not found in project config
1392
1392
  > - validate-feature step-05 verifies FK exists in real database via SQL query
1393
+
1394
+ ---
1395
+
1396
+ ## DataExportEndpoint Seed Data Pattern
1397
+
1398
+ When adding a new export endpoint, add seed data in `DataExportEndpointConfiguration.cs`:
1399
+
1400
+ ```csharp
1401
+ builder.HasData(new {
1402
+ Id = new Guid("{random-guid}"),
1403
+ NavigationApplicationId = NavigationApplicationSeedData.{App}AppId,
1404
+ NavigationModuleId = NavigationModuleSeedData.{Module}ModuleId,
1405
+ Code = "{entity-code}",
1406
+ Name = "{Entity} Export",
1407
+ Description = "Export {entity} data with metadata",
1408
+ RouteTemplate = "/api/v1/export/{entity-code}",
1409
+ RequiredPermission = "{app}.{module}.export",
1410
+ EntityType = "{Entity}",
1411
+ IsActive = true,
1412
+ DefaultRateLimitPerMinute = 60,
1413
+ DefaultMaxPageSize = 1000,
1414
+ CreatedAt = seedDate
1415
+ });
1416
+ ```
1417
+
1418
+ Requires matching controller in `Controllers/DataExport/v1/Export{Entity}Controller.cs`.
@@ -810,6 +810,40 @@ services.AddValidatorsFromAssemblyContaining<Create{Name}DtoValidator>();
810
810
 
811
811
  ---
812
812
 
813
+ ## External Application & Data Export Pattern
814
+
815
+ ### Entities
816
+
817
+ | Entity | Table | Description |
818
+ |--------|-------|-------------|
819
+ | `ExternalApplication` | `auth_ExternalApplications` | Machine-to-machine API account (ClientId, ClientSecret, IsActive, IP whitelist) |
820
+ | `ExternalApplicationRole` | `auth_ExternalApplicationRoles` | Role assignment per app (AppId, RoleId, optional TenantId) |
821
+ | `ExternalApplicationExportAccess` | `auth_ExternalApplicationExportAccesses` | Per-app access to specific export endpoint (IsEnabled, RateLimitPerMinute, MaxPageSize) |
822
+ | `DataExportEndpoint` | `auth_DataExportEndpoints` | Registry of available export APIs (Code, RouteTemplate, RequiredPermission, EntityType) |
823
+ | `ExternalAppAuditLog` | `auth_ExternalAppAuditLogs` | Audit trail for all API calls (Authentication, DataExport actions) |
824
+
825
+ ### Architecture (3-layer security)
826
+
827
+ 1. **Authentication** — JWT assertion signed with ClientSecret → ExternalApplicationAuthService validates → generates SmartStack JWT with permissions resolved via ExternalApplicationRole → Role → RolePermission chain
828
+ 2. **Authorization** — RequirePermissionFilter checks JWT claims (e.g., `administration.users.export`)
829
+ 3. **Access Control** — DataExportAccessMiddleware verifies per-app endpoint access in ExternalApplicationExportAccess table
830
+
831
+ ### Rate Limiting
832
+
833
+ ExternalAppRateLimitPolicy resolves limits: app override → endpoint default → 60/min fallback.
834
+ Partition key: `{clientId}:{endpointCode}`.
835
+
836
+ ### Seed Data
837
+
838
+ DataExportEndpoints are seeded in DataExportEndpointConfiguration.cs with FK to NavigationApplication and NavigationModule. Each endpoint maps to a controller in `Controllers/DataExport/v1/`.
839
+
840
+ ### Controller Pattern
841
+
842
+ Export controllers: `[Route("api/v1/export")]` + `[RequirePermission]` + `[EnableRateLimiting]`
843
+ Management controllers: `[NavRoute("api.accounts")]` with CustomSegment
844
+
845
+ ---
846
+
813
847
  ## PaginatedResult Pattern
814
848
 
815
849
  > **Canonical type for ALL paginated responses.** One name, one contract, everywhere.
@@ -19,6 +19,7 @@
19
19
  | `support.*` | `support_` | `Support` | Table: `support_Tickets`, Controller: `Controllers/Support/TicketsController.cs` |
20
20
  | `*` (business apps) | `ref_` or domain-specific | `{ApplicationPascal}` | Table: `ref_Products`, Controller: `Controllers/Sales/ProductsController.cs` |
21
21
  | `myspace.*` | `usr_` | `MySpace` | Table: `usr_Preferences`, Controller: `Controllers/MySpace/PreferencesController.cs` |
22
+ | `api.*` | `auth_` or `ext_` | `Api` | Table: `auth_ExternalApplications`, Controller: `Controllers/Platform/Api/ExternalApplications/` |
22
23
 
23
24
  ---
24
25
 
@@ -26,6 +26,7 @@ Suggests companion modules based on primary module type:
26
26
  | **Permissions/Security** | permission, role, access, authority, rbac | UserRoles, Groups, Policies, Audit, Delegation | Permission systems need fine-grained control, group policies, and audit trails |
27
27
  | **Notifications** | notification, alert, email, message, broadcast | Templates, Channels, Scheduling, Preferences | Notification systems need template management, multi-channel support, scheduling |
28
28
  | **Reporting** | report, dashboard, analytics, BI, metrics | Dashboards, Exports, Scheduling, AlertRules | Reporting needs visualization, scheduled distribution, and data export |
29
+ | **API Management / Integrations** | api, external, integration, webhook, export, data-export, machine-to-machine | ExternalApps, DataExportEndpoints, ExportAccess, AuditLogs, ApiKeys | API platforms need app registration, key management, granular endpoint access, rate limiting, and audit logging |
29
30
 
30
31
  ---
31
32
 
@@ -66,6 +67,7 @@ Suggests system integrations based on requirements:
66
67
  | **Geographical features** | Maps/Location Service | Spatial data handling | Add section with provider selection, geocoding, distance calculation |
67
68
  | **Data synchronization** | Event Bus/Messaging | Async data consistency | Add section with message types, subscription strategy, retry logic |
68
69
  | **File storage** | Cloud Storage Integration | Large file handling | Add section with provider selection, access control, cleanup policy |
70
+ | **Machine-to-machine API** | External app, M2M, JWT assertion, API key | Data Export API | Add section with app registration, key generation, endpoint-level access grants, per-app rate limits, and audit log |
69
71
 
70
72
  ---
71
73