feat(cli): Stage-1 KAS OAuth encrypt/decrypt for ztdf - #47
Conversation
OpenTDFKitCLI ztdf path for community xtest interop with go: - Encrypt: client_credentials + RSA PublicKey fetch + existing TDFEncryptor wrap - Decrypt: ephemeral P-256 rewrap + unwrapKey(salt: empty) for Standard TDF - supports: honest hexless/connectrpc; unknown features exit 2
- Use if-expression assignment for OAuth token URL (conditionalAssignment) - Use try? when parsing KAS public-key JSON so raw PEM fallback is reachable - Drop XT_WITH_TARGET_MODE from TDF specVersion (mode name, not schema version) - Document supports exit codes (0/1/2) matching the xtest contract - Wrap if statement bodies for SwiftFormat wrapIfStatementBodies
Code Review ✅ Approved 3 resolved / 3 findingsImplements Stage-1 KAS OAuth and P-256 ephemeral decryption for ztdf interoperability, resolving previous JSON parsing errors, spec versioning issues, and exit-code contract inconsistencies. No open findings remain. ✅ 3 resolved✅ Bug: Raw-PEM KAS response unreachable due to throwing JSON parse
✅ Bug: specVersion falls back to XT_WITH_TARGET_MODE (mode name, not version)
✅ Quality: supportsCommand default now returns 2, changing exit-code contract
Was this helpful? React with 👍 / 👎 | Gitar |
1 similar comment
Code Review ✅ Approved 3 resolved / 3 findingsImplements Stage-1 KAS OAuth and P-256 ephemeral decryption for ztdf interoperability, resolving previous JSON parsing errors, spec versioning issues, and exit-code contract inconsistencies. No open findings remain. ✅ 3 resolved✅ Bug: Raw-PEM KAS response unreachable due to throwing JSON parse
✅ Bug: specVersion falls back to XT_WITH_TARGET_MODE (mode name, not version)
✅ Quality: supportsCommand default now returns 2, changing exit-code contract
Was this helpful? React with 👍 / 👎 | Gitar |
Summary
OpenTDFKitCLI Stage-1 ztdf interop with go (no nano in Stage-1 matrix).
unwrapKey(salt: Data())(Standard TDF)Test plan
swift build -c release --product OpenTDFKitCLISummary by Gitar
getOAuthTokenforclient_credentialsauthentication to support modern KAS workflows.fetchKASRSAPublicKeyto dynamically retrieve RSA keys via ConnectRPC or REST endpoints.decryptTDF.buildTDFConfigurationto support live KAS key fetching and OAuth integration.xtestfeature support inCommands.swiftto reflect Stage-1 capabilities.This will update automatically on new commits.