Skip to content

Endpoints

DBConnectionAPI exposes two controllers with six endpoints in total: three GET retrieval endpoints on ConnectionsController that return a composed connection string, and three POST inspection endpoints on AdminController that return the raw credential parts. All routes are attribute-routed and carry a literal v1 prefix.

This page is the endpoint catalog and hub. Each controller's endpoints are documented in detail on its own page under endpoints/.

Route composition

Aspect Finding
Routing mode Attribute routes ([ApiController] + [Route])
Controller route template v1/Connections on ConnectionsController; v1/Admin followed by the action name on AdminController (the class-level [Route] templates use a controller-name token)
Versioning Literal v1 prefix — not API versioning; see Hosting pipeline
Base path / (the IIS application path is deployment-defined and not determined from source)

A resolved route is the controller [Route] template composed with the action's [HttpGet("<template>")], with the controller-name token replaced by the controller name minus its Controller suffix and the action-name token by the action name. ConnectionsController actions each declare an [HttpGet] template. AdminController actions declare a bare [HttpPost], so the action name supplies the last segment. Query-string parameters are listed on each endpoint page, not in the route.

Controller catalog

Controller Route template API version Base Endpoints Documentation
AdminController v1/Admin plus the action name — ControllerBase 3 Details
ConnectionsController v1/Connections — ControllerBase 3 Details

Endpoint catalog

Neither controller declares [ProducesResponseType], so every non-200 status listed below is undeclared in source. All endpoints are protected by the same resource requirement (see Authentication and authorization). The endpoints return credential material (CRITICAL, see Authentication and authorization).

Endpoint Controller Action Auth Success Errors Rules
POST /v1/Admin/GetOracleConnectionInfo AdminController GetOracleConnectionInfo DBConnAPIRetrieveResource 200 OK 401/403 **, 500 ** BR-DBC-023, BR-DBC-024, BR-DBC-025
POST /v1/Admin/GetPostgresConnectionInfo AdminController GetPostgresConnectionInfo DBConnAPIRetrieveResource 200 OK 401/403 **, 500 ** BR-DBC-006, BR-DBC-023, BR-DBC-024, BR-DBC-025
POST /v1/Admin/GetSqlConnectionInfo AdminController GetSqlConnectionInfo DBConnAPIRetrieveResource 200 OK 401/403 **, 500 ** BR-DBC-023, BR-DBC-024, BR-DBC-025
GET /v1/Connections/ORA/{instance}/{username} ConnectionsController GetOraConnectionString DBConnAPIRetrieveResource 200 OK 400, 404, 500, 401/403 ** BR-DBC-001, BR-DBC-009, BR-DBC-015, BR-DBC-016, BR-DBC-025
GET /v1/Connections/PostgreSQL/{instance}/{username} ConnectionsController GetPostgreSqlConnectionString DBConnAPIRetrieveResource 200 OK 404, 500 **, 401/403 ** BR-DBC-006, BR-DBC-020, BR-DBC-021, BR-DBC-025
GET /v1/Connections/SQL/{server}/{instance}/{username} ConnectionsController GetSqlConnectionString DBConnAPIRetrieveResource 200 OK 400 *, 404, 500, 401/403 ** BR-DBC-001, BR-DBC-009, BR-DBC-016, BR-DBC-018, BR-DBC-025

The 400 * on the SQL Server endpoint arises only if a TNS-alias-style lookup error is surfaced by the SQL Server path. This is inferred, not confirmed; the confirmed 400 mapping is Oracle-only (BR-DBC-015).

Error mechanisms

Two mechanisms produce error responses across the surface. Their body shapes are not visible in source for the first one.

Mechanism Endpoints covered Behavior
ConnectionManagerException : HttpStatusCodeException thrown by ConnectionManager, handled by package middleware DynamicErrorHandler contributed by SAIF.NetCore.ServiceExtensions † The three ConnectionsController endpoints Sets 404 (secure setting missing), 400 (Oracle alias not found) or 500 (all other failures); the exact written envelope is not visible in source**
Local bare try/catch in AdminController.GetConnectionInfo The three AdminController endpoints Swallows a credential-split failure and still returns 200 OK with an Error entry (BR-DBC-024); any other exception flows to the opaque middleware**

Request flow diagram

flowchart TD
    REQ["Client request"] --> PIPE["Middleware pipeline<br/>see hosting-pipeline.md"]
    PIPE --> ROUTE{"Route match"}
    ROUTE -->|"GET /v1/Connections/..."| C["ConnectionsController action"]
    ROUTE -->|"POST /v1/Admin/..."| A["AdminController action"]
    ROUTE -->|"No match"| NF["404 Not Found *"]
    C --> CAUTH{"Connections request authorized for<br>DBConnAPIRetrieveResource?"}
    A --> AAUTH{"Admin request authorized for<br>DBConnAPIRetrieveResource?"}
    CAUTH -->|"No"| DENY["401 / 403 ** (status not visible in source)"]
    AAUTH -->|"No"| DENY
    CAUTH -->|"Yes"| TPL["Read and format Environment API template"]
    AAUTH -->|"Yes"| ATPL["Read template and secure setting"]
    TPL -->|"Template missing or read fails"| ERRU["Unhandled/package error, status not visible"]
    TPL --> CACHE{"Cache hit?"}
    CACHE -->|"Yes"| OK["200 connection string"]
    CACHE -->|"No"| PROBE["Retrieve credential, compose string,<br>probe Oracle / SQL Server"]
    PROBE -->|"Success, cached"| OK
    PROBE -->|"Failure"| ERR["400 (Oracle) / 400* (SQL Server) /<br>404 / 500 via DynamicErrorHandler"]
    ATPL -->|"Read fails"| ERRU
    ATPL --> SPLIT["Split credential at first pipe, compose string;<br>no cache, no probe"]
    SPLIT --> OKA["200 JSON object (credentials, user, pw, connectionString)"]
    SPLIT -->|"Split fails"| OKE["200 with Error entry"]

Endpoints by operation

Endpoint Operation
GET /v1/Connections/SQL/{server}/{instance}/{username} OP-01 — see Operations and processes
GET /v1/Connections/PostgreSQL/{instance}/{username} OP-02 — see Operations and processes
GET /v1/Connections/ORA/{instance}/{username} OP-03 — see Operations and processes
POST /v1/Admin/GetOracleConnectionInfo OP-04 — see Operations and processes
POST /v1/Admin/GetPostgresConnectionInfo OP-05 — see Operations and processes
POST /v1/Admin/GetSqlConnectionInfo OP-06 — see Operations and processes

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/Controllers/ConnectionsController.cs
  • DBConnectionAPI/DBConnectionAPI/Controllers/AdminController.cs
  • DBConnectionAPI/DBConnectionAPI/Services/ConnectionManager.cs
  • DBConnectionAPI/DBConnectionAPI/Exceptions/ConnectionManagerException.cs
  • DBConnectionAPI/DBConnectionAPI/Startup.cs