Skip to content

feat(oracle): 10G password verifier + 23ai TTC capability fixes#969

Merged
datlechin merged 2 commits intomainfrom
feat/oracle-auth-1.2.0
May 3, 2026
Merged

feat(oracle): 10G password verifier + 23ai TTC capability fixes#969
datlechin merged 2 commits intomainfrom
feat/oracle-auth-1.2.0

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Closes #483 (10G password verifier + 23ai cloud Oracle handshake failure). Adds support for Oracle accounts whose password_versions contains 10G, fixes the speculative root cause of zetkey's 23ai uncleanShutdown report, and ships a focused Oracle diagnostic sheet for connection-test failures. Targets a plugin-oracle-v1.2.0 release.

Layer 1 (fork: TableProApp/oracle-nio:tablepro-main, 6bbaee5)

  • New Sources/OracleNIO/Helper/Oracle10GHash.swift: canonical Oracle 10G O5LOGON hash (UTF-16BE(uppercase(username + password)), null-padded to 8 bytes, two-pass DES-CBC with fixed initial key, second pass keyed by last 8 bytes of pass 1) via CommonCrypto. Verified against passlib canonical vector (username/password -> 872805F3F4C83365) and SCOTT/TIGER -> F894844C34402B67.
  • OracleFrontendMessageEncoder.swift: verifier11g: Bool flag replaced with VerifierKind enum (tenG/elevenG/twelveC). 10G uses the same AUTH_SESSKEY / AUTH_PASSWORD shape as 11G, with the 8-byte hash zero-padded to a 24-byte AES-192 key. No AUTH_PBKDF2_SPEEDY_KEY for 10G or 11G.
  • OracleSQLError.unsupportedVerifierType(UInt32) case added so callers see the actual verifier flag instead of a generic serverVersionNotSupported.
  • 23ai compile-capability advertisement now matches python-oracledb: indices 9 (DEQUEUE_WITH_SELECTOR), 35 (OCI3_OCSSYNC), 39 (SESS_SIGNATURE_VERSION), 40 (TTC4 adds EXPLICIT_BOUNDARY), 44 (TTC5 adds TOKEN_SUPPORTED/PIPELINING_SUPPORT/PIPELINING_BREAK/SESSIONLESS_TXNS), 45 (FEATURE_BACKPORT2 + END_USER_SEC_CTX), 52 (VECTOR_FEATURES + SPARSE).
  • OOB urgent-byte send now requires the server to advertise TNS_ACCEPT_FLAG_CHECK_OOB (0x01), matching python-oracledb's supports_oob_check gate. 23ai cloud and containerized deployments often omit this flag, causing the server to FIN the connection mid-handshake when oracle-nio sent an unexpected OOB byte.
  • Tests: 5 new 10G hash tests + 4 new capability tests (OOB-check gating, capability byte parity, encode/decode round-trip). All 111 unit tests pass; only failures are integration tests that need a live DB.

Layer 2 (this repo)

  • SPM pin bumped to fork 6bbaee5.
  • Plugins/OracleDriverPlugin/OracleConnection.swift: connect-error catch now produces actionable diagnostic messages for unsupportedVerifierType, uncleanShutdown, and serverVersionNotSupported instead of a raw error description. Each message names the host/service and points the user at the right next action (check password_versions, file an issue, etc.).
  • TablePro/Views/Connection/OracleDiagnosticSheet.swift (new): focused SwiftUI sheet shown when an Oracle Test Connection fails with one of the auth-class errors. Includes copy-able diagnostic info, suggested actions, and a link to the issue tracker.
  • docs/databases/oracle.mdx: new "Auth Compatibility" section with password_versions matrix and rotation SQL.

Test plan

After merge: tag plugin-oracle-v1.2.0 from main.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…rovider

Reviewer feedback (conventions + simplicity passes):

- Plugin↔host error classification was string-prefix matching on
  `OracleSQLError.Code.description` (plugin) and `error.localizedDescription.contains(...)`
  (host). Both are brittle: `description` is not a stable contract,
  and the host matcher breaks under non-English locales. Replaced
  with typed plumbing.

- New TableProPluginKit primitives: `PluginDiagnostic` value type
  (title, message, suggestedActions, diagnosticInfo, supportURL)
  and `PluginDiagnosticProvider` protocol. Plugins opt-in by
  conforming their main type; no DriverPlugin ABI bump needed.

- `OracleError` is now a struct with a `Category` enum (.notConnected,
  .authVerifierUnsupported(flag:), .authConnectionDropped,
  .authVersionNotSupported, etc.). `OracleConnection.connect`
  classifies upstream OracleSQLError into a category and throws a
  rich OracleError that carries it. The classification stays at
  the throw site where the most context is available.

- `OraclePlugin` conforms to PluginDiagnosticProvider. Its
  `diagnose(error:)` casts to `OracleError`, switches on
  `category`, and emits a localized PluginDiagnostic with
  suggested actions. The user-facing copy moves from the
  connection-form helpers into the plugin where it belongs.

- `PluginManager.diagnose(error:for:)` looks up the driver by
  type id, casts to PluginDiagnosticProvider, and forwards.
  ~5 lines.

- Generic `PluginDiagnosticSheet` replaces the Oracle-specific
  one. Renders any PluginDiagnostic; classifier
  `PluginDiagnosticItem.classify(error:connection:username:)`
  routes through PluginManager and is testable.

- Drops `oracleDiagnosticPayload` helper from ConnectionFormView+Helpers
  and the Oracle-specific `OracleDiagnosticSheet`. Diagnostic UI
  is now driver-agnostic.

- Bumps SPM pin to fork commit 7c01c8f (free-function 10G hash +
  VerifierKind.init(verifierFlag:) refactor pushed to TableProApp/oracle-nio).

- Pre-existing OraclePlugin.swift had a magic-number lint
  violation surfaced by --strict on the touched file:
  `defaultPort = 1521` -> `1_521`.
@datlechin datlechin merged commit 13a1503 into main May 3, 2026
2 checks passed
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.

Oracle connection fails with uncleanShutdown on non-TLS server

1 participant