DBConnectionAPI overview¶
DBConnectionAPI hands authorized callers a ready-to-use database connection string for a named Oracle, SQL Server or PostgreSQL target. It builds the string from a per-database-type template and a per-user secure credential, both held in the SAIF Environment API, so that templates and credentials are sourced centrally rather than held by each caller. The responses themselves carry credential material, so callers must protect them accordingly. It also offers an administrative inspection surface that returns the individual credential parts.
Purpose¶
- Compose connection strings for Oracle, SQL Server and PostgreSQL from Environment API templates and secure credentials.
- Validate Oracle and SQL Server strings with a connectivity probe (retry on transient failure) and cache the validated result in process memory.
- Expose an administrative surface that returns raw credential parts for troubleshooting.
Business context¶
The service acts on behalf of callers that need to reach a database: it resolves the caller-named server, instance and user into a connection string and confirms that Oracle and SQL Server strings work before returning them. It reads and writes no business data in any table. It owns an in-memory cache of composed strings and nothing else. The effect of its unavailability on callers is not determined from source**.
| Attribute | Value |
|---|---|
| Business domain | Database connection provisioning |
| Owning team | Architecture (OpenTelemetry Owner value on the host builder in Program.cs) |
| Data ownership | None — in-memory connection cache only; credentials and templates are owned by the SAIF Environment API |
| Criticality | Not determined from source |
Capability summary¶
| Capability | Owning component | Endpoints | Description |
|---|---|---|---|
| Retrieve a SQL Server connection string | ConnectionsController |
GET /v1/Connections/SQL/{server}/{instance}/{username} | Returns a validated, cached SQL Server connection string |
| Retrieve a PostgreSQL connection string | ConnectionsController |
GET /v1/Connections/PostgreSQL/{instance}/{username} | Returns a composed PostgreSQL connection string; it is not probed |
| Retrieve an Oracle connection string | ConnectionsController |
GET /v1/Connections/ORA/{instance}/{username} | Returns a validated, cached Oracle connection string |
| Inspect Oracle credential parts | AdminController |
POST /v1/Admin/GetOracleConnectionInfo | Returns raw credential parts and the composed string, without probe or cache |
| Inspect PostgreSQL credential parts | AdminController |
POST /v1/Admin/GetPostgresConnectionInfo | Same, for PostgreSQL |
| Inspect SQL Server credential parts | AdminController |
POST /v1/Admin/GetSqlConnectionInfo | Same, for SQL Server |
The full catalog is on Endpoints. The rules behind these capabilities are on Business rules, for example the caching rule BR-DBC-001 and the credential-disclosure rule BR-DBC-023.
Request and response format¶
| Aspect | Finding |
|---|---|
| Media types | Not declared ([Produces] and [Consumes] absent). Connections actions return a string that the framework normally writes as text/plain*; Admin actions return a JSON object |
| Serializer | Not configured in source; decided inside the opaque CoreAPIStartup base** (System.Text.Json by framework default*) |
| Serializer settings | Framework defaults; no converters, naming policy or null handling in source |
| Response envelope | No envelope. Connections return a bare string; Admin returns Dictionary<string,string> as a JSON object; errors are written by opaque package middleware† whose exact body is not visible in source** |
Non-documented artifacts¶
- None found: the project has no Razor views, Razor Pages,
wwwrootor view registrations, so nothing was excluded from this document set.
Related documentation¶
- API index
- Architecture
- Hosting pipeline
- Endpoints
- Authentication and authorization
- Dependencies
- Configuration
- Operations and processes
- Business rules
- Data model
- Operational runbook
- Tech debt
Note: Statements marked with
†are derived from dependency library documentation via the Legends CLI. Statements marked with*were inferred from code structure or contextual evidence. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
- DBConnectionAPI/DBConnectionAPI/Program.cs
- DBConnectionAPI/DBConnectionAPI/Startup.cs
- DBConnectionAPI/DBConnectionAPI/Controllers/ConnectionsController.cs
- DBConnectionAPI/DBConnectionAPI/Controllers/AdminController.cs
- DBConnectionAPI/DBConnectionAPI/Services/ConnectionManager.cs