Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,17 @@ skinparam packageStyle rectangle

package "NOTIP Management API" <<Rectangle>> {

class "TenantEntity" as TenantEntity {
+id: string
+name: string
+status: TenantStatus
+suspensionIntervalDays: number
+suspensionUntil: Date
+createdAt: Date
+updatedAt: Date
+users: UserEntity[]
+gateways: GatewayEntity[]
package "Common Module" as CommonModule {
class "EnvValidation" as EnvValidation
class "TenantEntity" as TenantEntity
class "MetricsInterceptor" as MetricsInterceptor
class "LastAccessInterceptor" as LastAccessInterceptor
class "AuditInterceptor" as AuditInterceptor
}

class "EnvValidation" as EnvValidation {
+validate(config): AppConfig
}

class "MetricsInterceptor" as MetricsInterceptor
class "LastAccessInterceptor" as LastAccessInterceptor
class "AuditInterceptor" as AuditInterceptor

package "Auth Module" as AuthModule {
class "JwtStrategy" as JwtStrategy
class "AuthController" as AuthController
class "JwtStrategy" as JwtStrategy
class "ImpersonationService" as ImpersonationService
class "JwtAuthGuard" as JwtAuthGuard
class "RolesGuard" as RolesGuard
Expand All @@ -44,16 +32,23 @@ package "NOTIP Management API" <<Rectangle>> {
class "TenantsService" as TenantsService
class "TenantsPersistenceService" as TenantsPersistenceService
class "KeycloakAdminService" as KeycloakAdminService
class "AdminGatewaysController" as AdminGatewaysController
class "AdminGatewaysService" as AdminGatewaysService
class "AdminGatewaysPersistenceService" as AdminGatewaysPersistenceService
class "GatewaysController" as AdminGatewaysController
class "GatewaysService" as AdminGatewaysService
class "GatewaysPersistenceService" as AdminGatewaysPersistenceService
}

package "Metrics Module" as MetricsModule {
class "MetricsController" as MetricsController
class "MetricsService" as MetricsService
}

package "Api-Client Module" as ApiClientModule {
class "ApiClientController" as ApiClientController
class "ApiClientService" as ApiClientService
class "ApiClientPersistenceService" as ApiClientPersistenceService
class "ApiClientEntity" as ApiClientEntity
}

' Core relationships
MetricsInterceptor --> MetricsService
LastAccessInterceptor ..> UserEntity
Expand All @@ -69,12 +64,17 @@ package "NOTIP Management API" <<Rectangle>> {
TenantsService --> TenantsPersistenceService
TenantsService --> KeycloakAdminService
TenantsPersistenceService --> TenantEntity
TenantsPersistenceService --> UserEntity
AdminGatewaysController --> AdminGatewaysService
AdminGatewaysService --> AdminGatewaysPersistenceService

' Metrics relationships
MetricsController --> MetricsService

' Api-Client relationships
ApiClientController --> ApiClientService
ApiClientService --> ApiClientPersistenceService
ApiClientService --> KeycloakAdminService
ApiClientPersistenceService --> ApiClientEntity
}

note top of TenantEntity
Expand All @@ -90,4 +90,10 @@ note top of AuthModule
User impersonation support
end note

note top of ApiClientModule
Manages OAuth2 API clients
Sync with Keycloak for client credentials
Client secret management
end note

@enduml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package "NOTIP Management API" <<Rectangle>> {
class "AlertsController" as AlertsController
class "AlertsService" as AlertsService
class "AlertsPersistenceService" as AlertsPersistenceService
class "AlertsNatsService" as AlertsNatsService
class "AlertConfigNatsResponderService" as AlertConfigNatsResponderService
class "AlertsEntity" as AlertsEntity
class "AlertsConfigEntity" as AlertsConfigEntity
Expand Down Expand Up @@ -53,10 +54,14 @@ package "NOTIP Management API" <<Rectangle>> {
' Alerts relationships
AlertsController --> AlertsService
AlertsService --> AlertsPersistenceService
AlertsService --> AlertsNatsService
AlertsPersistenceService --> AlertsEntity
AlertsPersistenceService --> AlertsConfigEntity
AlertsConfigEntity --> TenantEntity
TenantEntity -[hidden]-> GatewayMetadataEntity
AlertsConfigEntity --> GatewayEntity
AlertsEntity --> TenantEntity
AlertsEntity --> GatewayEntity

' Command relationships
CommandController --> CommandService
Expand Down Expand Up @@ -88,6 +93,7 @@ note top of AlertsModule
Gateway offline detection
Default and per-gateway timeouts
NATS request-reply for configs
NATS JetStream consumer for alert events
end note

note top of CommandModule
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ package "NOTIP Management API" <<Rectangle>> {
class "KeysController" as KeysController
class "ProvisioningController" as ProvisioningController
class "KeysService" as KeysService
class "GatewaysKeysPersistenceService" as GatewaysKeysPersistenceService
class "KeysNatsService" as KeysNatsService
class "KeysPersistenceService" as KeysPersistenceService
class "ProvisioningNatsResponderService" as ProvisioningNatsResponderService
class "KeyEntity" as KeyEntity
}
Expand Down Expand Up @@ -42,9 +43,11 @@ package "NOTIP Management API" <<Rectangle>> {
' Keys relationships
KeysController --> KeysService
ProvisioningController --> KeysService
KeysService --> GatewaysKeysPersistenceService
KeysService --> KeysPersistenceService
KeysService --> KeysNatsService
KeysService --> ProvisioningNatsResponderService
KeysService --> GatewaysService
GatewaysKeysPersistenceService --> KeyEntity
KeysPersistenceService --> KeyEntity
KeyEntity --> GatewayEntity

' Users relationships
Expand Down Expand Up @@ -72,6 +75,7 @@ note top of KeysModule
Factory key validation (bcrypt)
Provisioning with transactions
Gateway key lifecycle
NATS integration for key events
end note

note top of UsersModule
Expand All @@ -90,6 +94,7 @@ end note
note top of AuditLogModule
Audit logging for operations
Provisioning audit consumer
NATS consumer for provisioning events
Time-range queries
Tenant-scoped access
end note
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
title: Specifica tecnica - Management API
changelog:
- version: "1.1.0"
date: "2026-04-17"
authors:
- Alessandro Mazzariol
verifier: Leonardo Preo
description: >
Correzione immagini diagrammi
- version: "1.0.0"
approver: Leonardo Preo
baseline: PB
Expand All @@ -10,7 +17,7 @@ changelog:
- Alessandro Mazzariol
verifier: Alessandro Contarini
description: >
Fix error
Correzione errori di battitura e refusi
- version: "0.2.0"
date: "2026-04-10"
authors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@

= Architettura logica

Il servizio adotta una Layered Architecture con organizzazione interna di tipo modulare. All'interno dei vari moduli è
utilizzato prevalentemente il pattern Controller-Service-Persistence, che consente una chiara separazione delle
responsabilità tra esposizione API, logica di business e accesso ai dati. I componenti collaborano tramite Dependency
Injection e, dove opportuno, tramite interfacce e contratti applicativi. La presenza di Business Models, DTO ed
Entities ha portato all'introduzione di Mappers per la conversione dei dati tra i diversi livelli dell'applicazione.
Il microservizio adotta una Layered Architecture con organizzazione interna di tipo modulare. All'interno dei vari
moduli è utilizzato prevalentemente il pattern Controller-Service-Persistence, che consente una chiara separazione
delle responsabilità tra esposizione API, logica di business e accesso ai dati. I componenti collaborano tramite
Dependency Injection e, dove opportuno, tramite interfacce e contratti applicativi. La presenza di Business Models,
DTO ed Entities ha portato all'introduzione di Mappers per la conversione dei dati tra i diversi livelli
dell'applicazione.

== Layout dei moduli
Essendo il microservizio troppo grande per essere contenuto in un unico diagramma, di seguito è riportata la struttura
Expand Down Expand Up @@ -3013,5 +3014,5 @@
- gestione alert e threshold;
- invio e tracciamento dei comandi;
- audit delle operazioni rilevanti;
- corretto caricamento della configurazione e bootstrap del servizio.
- corretto caricamento della configurazione e bootstrap del microservizio.
]
Loading