Skip to content

refactor(plugins): move SSL classifiers into PluginKit and drop the test mirror#1744

Merged
datlechin merged 1 commit into
mainfrom
refactor/plugin-ssl-classifiers-to-pluginkit
Jun 21, 2026
Merged

refactor(plugins): move SSL classifiers into PluginKit and drop the test mirror#1744
datlechin merged 1 commit into
mainfrom
refactor/plugin-ssl-classifiers-to-pluginkit

Conversation

@datlechin

Copy link
Copy Markdown
Member

Problem

Each plugin's classifySSLError (maps a driver's raw TLS error string to an SSLHandshakeError) was duplicated by hand in TableProTests/PluginTestSources/PluginSSLClassifiers.swift, because registry-only plugin code is not compiled into the TableProTests target. The real function and its mirror had to be kept byte-identical or the tests would pass while the shipped logic differed. The mirror had already drifted (FreeTDS returned a different type in the mirror than in the plugin, and Cassandra's real classifier was not mirrored at all).

This applies the same pattern as #1740 (OracleChannelFatalCode) to all eight plugin SSL/TLS classifiers.

Change

Extracted the pure classification logic into shared public types and pointed each plugin at it:

  • TableProPluginKit (one type per plugin): LibPQSSLClassifier, MariaDBSSLClassifier (holds sslOnlyErrorCodes + classifySSLError(code:message:)), MongoDBSSLClassifier, RedisSSLClassifier, OracleSSLClassifier, ClickHouseSSLClassifier, CassandraClientKeyClassifier. Tested in PluginSSLClassifierTests via import TableProPluginKit.
  • TableProMSSQLCore: MSSQLTLSClassifier. MSSQL's classifier returns MSSQLTLSFailureKind (which lives in that module, not in PluginKit), so it lives with the enum and is tested by the package's own TableProMSSQLCoreTests.
  • Cassandra's classifySSLError(rc:message:) stays in the plugin (it depends on the C CassError type); only its pure client-key logic moved.

Deleted the 191-line mirror PluginSSLClassifiers.swift and retargeted the tests at the real public types. Logic moved verbatim, so behavior is unchanged.

Adding new public types to PluginKit is additive ABI: no currentPluginKitVersion bump.

Verification

  • App target and all plugin targets: BUILD SUCCEEDED, 0 errors.
  • PluginSSLClassifierTests (7 plugin suites): all pass.
  • TableProMSSQLCoreTests MSSQL TLS suite: 6/6 pass.

@datlechin datlechin merged commit a6feadf into main Jun 21, 2026
5 checks passed
@datlechin datlechin deleted the refactor/plugin-ssl-classifiers-to-pluginkit branch June 21, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant