[[nodiscard]] oidc::v1::OidcProvider_Scope DbTextToProtoScope(std::string_view text); |
Maps a DB identity_provider_scope enum text to the proto OidcProvider.Scope value. text: DB enum value as text (one of ADMIN, TENANT). Returns: Proto scope value. Throws: ServerAdminDbOperationError when text is not one of the documented enum labels. |
- |
[[nodiscard]] oidc::v1::OidcConnection_TokenMode DbTextToProtoTokenMode( std::string_view text ); |
Maps a DB oidc_token_mode enum text to the proto OidcConnection.TokenMode value. text: DB enum value as text (one of OIDC_TOKEN_MODE_JWT_LOCAL, OIDC_TOKEN_MODE_JWT_USERINFO, OIDC_TOKEN_MODE_OPAQUE_INTROSPECT, OIDC_TOKEN_MODE_AUTO). Returns: Proto token-mode value. Throws: ServerAdminDbOperationError when text is not one of the documented enum labels. |
- |
void PopulatePublicOidcConnectionFieldsFromRow( oidc::v1::OidcConnection &connection, const pqxx::row &row ); |
Populates the public, secret-free fields of an OidcConnection proto from a row that exposes the standard column set. Reads the columns issuer, audience, use_discovery, token_mode, the four URL overrides, introspection_client_id, the two fallback flags, clock_skew_seconds, connect_timeout_ms, read_timeout_ms. Skips uuid and idp_uuid because the column names differ across the SELECT statements that need them — callers wire those up themselves. introspection_client_secret is intentionally never populated by this helper; the public read paths must not surface the secret. connection: Proto value to populate. row: PostgreSQL row carrying the standard columns. |
- |
[[nodiscard]] oidc::v1::OidcProvider MapRowToOidcProvider(const pqxx::row &row); |
Maps a row that exposes provider + connection columns to a fully populated OidcProvider proto (no secrets). Expected columns: provider_uuid, scope, tenant_uuid (nullable), connection_uuid (nullable), and the standard connection columns documented on PopulatePublicOidcConnectionFieldsFromRow. When connection_uuid is null the returned provider has no embedded connection; callers wanting to enforce non-null connections must check provider.has_connection(). row: PostgreSQL row carrying the standard columns. Returns: Provider proto with uuid, scope, optional tenant_uuid and (when present) connection.uuid, connection.idp_uuid, and every public connection field. |
- |