How brunoleandro90/mend-sync-api works
MendSync API exposes Mend security-management data and synchronizes organization metadata into an Oracle-backed local store. The user-facing flow is API request → domain controller → service → Mend API; the sync operation additionally maps fetched applications, projects, labels, users, and groups into local entities and records sync status. The supplied excerpts show authentication, the shared Mend client, database context, and base-data sync. Other domain endpoints are present in the tree, but their internal behavior is not sampled, so their links are omitted.
Main entry points: SyncService.cs Base-data sync · MendApiClient.cs Mend HTTP client · AuthService.cs Authentication service · TokenStore.cs Token store
Components 19
API surface
- Authentication API
src/MendSync.API/Controllers/AuthController.cs - Catalog APIs
src/MendSync.API/Controllers - Findings API
src/MendSync.API/Controllers/FindingsController.cs - Scans API
src/MendSync.API/Controllers/ScansController.cs - Reports API
src/MendSync.API/Controllers/ReportsController.cs - Sync API
src/MendSync.API/Controllers/SyncController.cs
Domain services
- Authentication service
src/MendSync.Infrastructure/Services/AuthService.cs - Catalog services
src/MendSync.Infrastructure/Services - Findings service
src/MendSync.Infrastructure/Services/FindingsService.cs - Scans service
src/MendSync.Infrastructure/Services/ScansService.cs - Reports service
src/MendSync.Infrastructure/Services/ReportsService.cs - Base-data sync
src/MendSync.Infrastructure/Services/SyncService.cs - API and sync DTOs
src/MendSync.Application/DTOs
Mend integration
- Mend API
- Mend HTTP client
src/MendSync.Infrastructure/HttpClients/MendApiClient.cs - Token store
src/MendSync.Infrastructure/Token/TokenStore.cs
Local state
- Oracle data context
src/MendSync.Infrastructure/Data/MendSyncDbContext.cs - Oracle database
Other components
- API consumer
Connections 21
- API consumer → Authentication API: requests
- API consumer → Catalog APIs: requests
- API consumer → Findings API: requests
- API consumer → Scans API: requests
- API consumer → Reports API: requests
- API consumer → Sync API: requests
- Authentication API → Authentication service: delegates to
- Catalog APIs → Catalog services: delegates to
- Findings API → Findings service: delegates to
src/MendSync.API/Controllers/FindingsController.cs - Scans API → Scans service: delegates to
src/MendSync.API/Controllers/ScansController.cs - Reports API → Reports service: delegates to
src/MendSync.API/Controllers/ReportsController.cs - Sync API → Base-data sync: delegates to
- Authentication service → Mend HTTP client: uses raw HTTP
src/MendSync.Infrastructure/Services/AuthService.cs - Authentication service → Token store: stores tokens
src/MendSync.Infrastructure/Services/AuthService.cs - Mend HTTP client → Mend API: sends requests
src/MendSync.Infrastructure/HttpClients/MendApiClient.cs - Mend HTTP client → Token store: checks token
src/MendSync.Infrastructure/HttpClients/MendApiClient.cs - Base-data sync → Mend HTTP client: fetches records
src/MendSync.Infrastructure/Services/SyncService.cs - Base-data sync → Oracle data context: writes entities
src/MendSync.Infrastructure/Services/SyncService.cs - Oracle data context → Oracle database: persists data
- Base-data sync → Token store: reads organization
src/MendSync.Infrastructure/Services/SyncService.cs - Base-data sync → API and sync DTOs: maps records
src/MendSync.Infrastructure/Services/SyncService.cs