Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/sdks/_category_.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"label": "SDK",
"position": 6,
"label": "SDKs",
"position": 4,
"link": {
"type": "generated-index",
"description": "The OpenTDF platform provides Software Development Kits in the Go, Java, and JavaScript languages. The SDKs include guides and working examples for managing policy, creating Trusted Data Format (TDF) protected objects, and making authorization decisions within an application."
"description": "Documentation for official OpenTDF SDK guidelines and implementations"
}
}
}
8 changes: 8 additions & 0 deletions docs/sdks/go/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Go SDK",
"position": 3,
"link": {
"type": "generated-index",
"description": "Documentation for the Go SDK - the reference implementation of OpenTDF"
}
}
8 changes: 8 additions & 0 deletions docs/sdks/java/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Java SDK",
"position": 4,
"link": {
"type": "generated-index",
"description": "Documentation for the Java SDK implementation of OpenTDF"
}
}
325 changes: 325 additions & 0 deletions docs/sdks/official-sdk-guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@
---
sidebar_position: 2
title: Official SDK Guidelines
description: Official guidelines and standards for implementing OpenTDF SDKs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Open TDF
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

---

# Official SDK Guidelines

This document provides the official guidelines and standards for:
- OpenTDF contributors implementing new language SDKs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Open TDF
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

- Developers who want to understand the official SDK architecture and implementation details

If you're looking to *use* an existing OpenTDF SDK, please see the [SDK Overview](/sdks/overview) instead.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Open TDF
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: SDKs, SDS, SDK, JDKs, SDFS, SDGs, SDIS, SDPS, Saks, says, sees, sets, sides, sons, asks, sits, sky, CDs, adds, ads, odds, sake, seas, seeks, ski, SAS, SD, SK, sacks, sins, sums, DNS, SBS, SMS, SOS, Sikh, Sikhs, eds, inks, oaks, sans, sinks, ska, skis, socks, DMS, DSS, DTS, IDs, PDS, RDS, SARS, SDA, SDL, SNES, SUVs, Sims, Suns, Sykes, sacs, saws, sous, spas, BDS, DDS, DKK, KDKA, MDS, SCS, SDI, SDR, SIDS, SLRs, SLS, SNPs, SRS, odes, silks, sows, suns, CDOs, DLS, GDS, PDFs, SATs, SDC, SDM, STDs, Saki, auks, secs, soaks, sobs, sodas, sols, sues, yaks, DPs, DVS, HDDs, HDS, SKU, sags, saps, sass, sews, sips, sis, woks, BKS, SSAS, arks, elks, ides, irks, sods, suds, sulks, ODs, Sirs, sicks, sirs, sops, sups, DJs, LDS, OKs, SOs, mks, sics, Odis, dds, socs, sots, yuks, ADBS, ADK, ADLs, ADS, AKS, APKs, Adas, BDK, BSDs, CDK, CDNs, CDS, CKS, CKs, CSDGS, DCS, DDTs, DDoS, DES, DFS, DGS, DHS, DK, DKA, DKB, DKP, DKR, DKZ, DMs, DOS, DPS, DRS, DS, DUS, Dis, DoS, EDS, FDES, FDS, GDPs, HDDS, HDPS, ID3S, IDES, IDEs, IDK, IDMS, IDPs, IDS, JDK, KDS, KKS, KS, Ks, LDCs, LDK, MDK, MDs, MKS, NAKs, NDAs, NDK, NDS, ODAS, ODMs, ODS, PDK, PDMS, PKS, SAK, SALS, SAVS, SBK, SCRS, SCSS, SDD, SDE, SDEI, SDF, SDG, SDGE, SDH, SDIO, SDJ, SDLC, SDN, SDO, SDP, SDPC, SDPJ, SDSI, SDSU, SDU, SDV, SEAS, SEK, SEPs, SES, SFS, SGHS, SGK, SGS, SHK, SHS, SIMs, SIS, SITS, SKA, SKI, SKK, SKN, SKUs, SKZ, SLAs, SMBs, SMEs, SMK, SNS, SOCS, SOEs, SOPs, SPS, SQS, SS, SSDs, SSK, SSNs, SSRS, SSS, STIs, STS, SUK, SUS, SVGs, SVK, SVPs, SaaS, Sask, SoCs, TDPS, TDS, TKS, UDPS, UDS, WDS, dis, dms, dos, ids, ilks, ks, oiks, sades, saké, sens, shes, sims, souks, subs, sucks, suss, LUKS, mDNS
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


## Core Principles for Official OpenTDF SDKs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Open TDF
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


All official OpenTDF SDKs must adhere to these core principles to ensure functional parity and consistent developer experience across languages:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Open TDF
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


### 1. Platform-First Initialization

Every SDK requires a platform base URL (endpoint) at initialization, along with necessary credentials. This endpoint is the entry point to OpenTDF platform services. The SDK will automatically:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Open TDF
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call out that the SDK can do some things (like discover the well-known config) without credentials?


- Discover service endpoints (KAS, Policy, etc.)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: WAS, AS, HAS, GAS, SAS, KAI, KAY, PAS, IAS, KBS, KAT, OAS, KSS, KANS, AAS, AKS, BAS, CAS, EAS, FAS, KAL, KAV, KAZ, KDS, KES, KHS, KIAS, KKS, KMS, KOS, KS, KSA, KTS, KAN, LAS, MAS, NAS, PAs, RAS, UAS
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

- Configure network clients
- Retrieve well-known configuration

### 2. Service Communication via Generated Clients

SDKs use auto-generated API clients (using Protocol Buffers/Connect RPC) for communicating with OpenTDF services. This ensures:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Open TDF
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


- Consistent interfaces across languages
- Type-safe API calls
- Reduced boilerplate code
- Up-to-date API definitions

### 3. Format Support and Cryptography

Every SDK must support:

- Standard TDF (ZIP/JSON format) with manifest
- NanoTDF (compact binary format)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Reynolds, Anode, Keynote, Nantes, Nanette, Keynotes, Nanook, Canoed, Keynoted, Keynoter, NAND, Reynold, Nanite, Nanites, Nanobot, Nanodot, Nanolux, Nanoohm, Nanotech, Nanotori, Nanotube
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

- Attribute-Based Access Control (ABAC)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: ABACK, ADAC, APAC, ABACI, ABC, AAC, ABA, ABAP, ABMC, BAC, A BAC, ABA C
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

- Signed assertions and policy binding

### 4. Language-Idiomatic Design

While maintaining functional parity, each SDK should follow patterns natural to its language:

#### Go SDK (Reference Implementation)
```go
// Functional options pattern
client := tdf.NewClient(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: TDF, IDF, PDF, TDI, UDF, GDF, MDF, TDD, TEF, TTF, TD, ADF, BDF, CDF, EDF, FDF, HDF, LDF, NDF, ODF, RDF, SDF, TAF, TBF, TCF, TDA, TDC, TDE, TDG, TDM, TDP, TDR, TDS, TDT, TF, TFF, TGF, THF, TLF, TNF, TOF, TPF, TWF, TIF, the, of, to, two, if, off, too, do, top, ten, CD, Dr, add, tax, tho, try, Tom, ad, odd, tag, tea, tie, tip, ton, CDs, GDP, HD, Ltd, WWF, ads, tide, tight, tin, toy, FDP, ID, SD, SF, TNA, TNT, TT, Ted, Todd, UHF, cf, id, ref, tan, tap, toe, tow, turf, ADC, ADP, AF, CDC, CDU, DA, DDR, DDT, DL, DM, DT, DX, GDR, HF, IMF, ITF, JD, PD, PDP, SDS, TCP, TLC, TTC, TV, Taft, UDP, dB, eds, elf, ta, tab, tar, thy, tub, tug, ADR, AIF, Ada, CDA, CDR, CSF, DG, ELF, FD, FDR, IDs, LD, MDC, MDR, MF, MSF, NDA, NSF, PDA, PDS, RDS, RPF, SDA, SDK, SDL, TAC, TCS, TCU, TFS, THC, TLS, TSA, TTL, TVs, TWA, Tao, TeX, Tide, USF, ode, tau, tee, til, tofu, tuff, AD, ADD, ADT, AEF, ARF, BDS, BWF, CBF, CDO, CDT, CMF, CTF, DDS, DQ, FDI, GDI, HDB, HDD, HDR, HDV, IDC, JDM, JTF, LDA, MDI, MDS, NDC, OSF, PDT, PSF, RDA, RDC, SDI, SDR, SPF, TBI, TCA, TCM, TCR, TLD, TMZ, TNG, TOC, TPA, TPC, TPM, TRC, TSS, TUC, Tia, Tod, UDC, UDR, WD, sf, tai, tam, tat, tidy, tot, ts, tuft, Adm, CDN, CPF, DCF, DDA, DDB, DDC, DDD, DDE, DTMF, EDP, EHF, FDC, GAF, GDS, GEF, IDB, IDG, IDL, JDL, LDC, MCF, MDL, MDM, MDP, MDT, MDX, MLF, MTBF, NDB, NFF, PDFs, SDC, SDM, SMF, SNF, STDs, TBA, TBC, TLDs, TLR, TTA, VLF, dz, emf, inf, tel, tum, CDV, EOF, EPF, HDS, PDQ, RIF, SHF, TCO, TEFL, TPL, TPN, Tut, Twp, VDU, adj, ado, oaf, tad, tut, TBD, TWX, Tue, VDT, adv, ted, tiff, tsp, tux, ETD, ODs, YTD, CDP, DJ, LDS, MD, NDP, RAF, Tim, vhf, dds, teds, 1D, 2D, 3D, 3DO, 4D, 8D, AAF, ABF, ACF, ADA, ADB, ADG, ADH, ADI, ADJ, ADK, ADL, ADM, ADN, ADQ, ADS, ADU, ADV, ADVF, ADX, ADY, ADZ, AFF, AGF, AHF, AJF, AKF, ALF, AMF, ANF, AOF, APF, AQF, ASF, ATD, ATF, AUF, AVF, AWF, AZF, BAF, BBF, BCF, BD, BDA, BDB, BDC, BDD, BDE, BDG, BDH, BDI, BDJ, BDK, BDL, BDM, BDN, BDNF, BDO, BDP, BDQ, BDR, BDT, BDU, BDV, BDW, BDX, BDY, BDZ, BEF, BF, BFF, BGF, BHF, BIF, BKF, BLF, BMF, BNF, BOF, BPF, BRF, BSF, BTF, BUF, BVF, CAF, CCF, CDB, CDD, CDE, CDG, CDH, CDI, CDJ, CDK, CDL, CDM, CDS, CDTF, CDW, CDZ, CEF, CF, CFDF, CFF, CGF, CHF, CIF, CJF, CNF, COF, CQF, CRF, CTIF, CUF, CVF, CWF, CZF, Cd, Cf, D, D8, DAF, DBF, DC, DD, DDAF, DDH, DDI, DDL, DDM, DDO, DDV, DE, DFA, DFB, DFC, DFE, DFF, DFG, DFI, DFL, DFM, DFN, DFO, DFP, DFS, DFT, DFV, DFW, DGF, DH, DI, DIF, DJF, DK, DLF, DMF, DN, DNF, DO, DOF, DP, DR, DS, DSF, DXF, Di, Du, Dy, EBF, EDA, EDB, EDC, EDD, EDFA, EDI, EDL, EDM, EDS, EDT, EDU, EDW, EDX, EEDF, EGF, EKF, EMF, ENF, EQF, ERDF, ERF, ESF, ETF, EUF, EVF, EZF, Ed, F, F&F, FAF, FBF, FDA, FDB, FDM, FDS, FEF, FF, FFF, FGF, FIF, FOF, FPF, FRF, FSF, FTF, FTPF, FVF, GCF, GDB, GDC, GDD, GDE, GDM, GDN, GDT, GF, GIF, GMF, GNF, GSF, GTD, GUF, Gd, HDE, HDFC, HDI, HDL, HDM, HDO, HEF, HIF, HNF, HSF, HTF, HUF, Hf, IAF, ICF, ID3, IDE, IDFA, IDH, IDK, IDM, IDN, IDP, IDQ, IDR, IDS, IDT, IEF, IF, IFF, IGF, IIF, IJF, INF, IOF, IPF, ISF, IUF, IVF, IWF, Ida, JAF, JDE, JDG, JDK, JDN, JDSF, JEF, JMF, JPF, JSF, KDG, KDP, KDS, KEF, KMF, KOF, KPF, KTD, L&F, LBF, LCF, LDD, LDE, LDH, LDIF, LDK, LDL, LDT, LDW, LEF, LGF, LOF, LPF, LRF, LSF, LTD, LTF, LUF, MAF, MDA, MDB, MDD, MDE, MDG, MDJ, MDK, MDN, MDQ, MDV, MDs, MEF, MFF, MGF, MIF, MOF, MRF, MTD, MTF, Md, NAF, NBF, ND, NDH, NDK, NDR, NDS, NDT, NF, NHF, NIF, NMF, NPF, NRF, NTD, Nd, OD, ODB, ODC, ODD, ODG, ODI, ODM, ODN, ODP, ODR, ODS, ODT, OGF, OKF, OLF, ONF, OVF, PAF, PCF, PDB, PDC, PDD, PDG, PDI, PDJ, PDK, PDL, PDMF, PDO, PDU, PDX, PEF, PGF, PIF, PLF, PMF, PNF, POF, PPDF, PRF, PTF, PUF, PWF, PYF, Pd, QDD, QDR, QF, QMF, QRF, RBF, RCF, RD, RDB, RDI, RDJ, RDM, RDP, RDT, RF, RGF, RHF, RMF, RNF, RRF, RSF, RTBF, RTD, RTF, RUF, RWF, Rd, Rf, SAF, SBF, SDD, SDE, SDFS, SDG, SDH, SDJ, SDN, SDO, SDP, SDU, SDV, SEF, SFF, SGDF, SGF, SLF, SRF, SSDF, SSF, STD, STF, STIF, T, T&C, T&S, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T28, T30, T37, T38, T40, T50, T7J, T99, TA, TAA, TAAF, TAD, TAE, TAG, TAH, TAI, TAJ, TAM, TAN, TAO, TAP, TAT, TB, TBH, TBJ, TBK, TBL, TBM, TBP, TBS, TBT, TBTF, TBW, TC, TCC, TCD, TCG, TCH, TCI, TCK, TCL, TCN, TCV, TCW, TDPS, TDSB, TEB, TEC, TED, TEDx, TEE, TEI, TEM, TEP, TEQ, TER, TES, TEU, TEV, TFA, TFB, TFC, TFE, TFK, TFL, TFR, TFT, TG, TGA, TGB, TGD, TGE, TGI, TGIF, TGL, TGN, TGP, TGS, TGU, TGV, TGW, TGX, TGZ, TH, THA, THB, THD, THM, THP, THS, THT, THX, TI, TIC, TID, TIFF, TIG, TIP, TIS, TIV, TJ, TJC, TJJ, TJK, TJS, TK, TKD, TKK, TKL, TKM, TKO, TKP, TKS, TKT, TL, TLA, TLB, TLDR, TLE, TLH, TLM, TLN, TLP, TLT, TLV, TM, TMA, TMB, TMC, TMD, TME, TMG, TMI, TMJ, TMN, TMP, TMS, TMT, TMV, TMX, TN, TNB, TNC, TND, TNE, TNK, TNL, TNM, TNN, TNO, TNP, TNR, TNS, TNW, TO, TOB, TOE, TOG, TOK, TOM, TOP, TOR, TOS, TOT, TP, TPDS, TPE, TPFE, TPG, TPI, TPJ, TPO, TPP, TPR, TPS, TPT, TPV, TPX, TQ, TQC, TQM, TQS, TR, TRE, TRI, TRL, TRM, TRP, TRS, TRT, TRX, TRY, TS, TSAF, TSB, TSC, TSD, TSE, TSG, TSH, TSI, TSK, TSL, TSM, TSN, TSO, TSP, TSR, TSV, TSX, TTD, TTG, TTI, TTO, TTP, TTR, TTS, TTT, TTU, TTX, TTY, TTs, TU, TUA, TUB, TUG, TUI, TUN, TUP, TUV, TV7, TV8, TVA, TVH, TVM, TVO, TVP, TVQ, TVS, TVU, TW, TWC, TWD, TWE, TWS, TWU, TWV, TX, TXK, TXL, TXT, TY, TYC, TYO, TZ, TZA, TZC, TZN, TZS, Ta, Tad, Tai, Tb, Tc, Te, Tet, Tex, Th, Thu, Ti, TiB, Tl, Tm, ToC, ToS, Tu, Ty, UCF, UDB, UDL, UDM, UDS, UFF, UMF, UNF, UPF, UTCF, UTF, UVF, UYF, Udo, VCF, VD, VDA, VDB, VDC, VDD, VDI, VDM, VDN, VDX, VF, VFF, VHF, VRF, VSF, WBF, WCF, WDC, WDI, WDM, WDS, WF, WIF, WLF, WMF, WPF, WSF, WTF, XAF, XD, XDMF, XPF, XRF, ZAF, ZDJ, ZEF, ZF, ZIF, bf, d, db, dd, def, dm, ed, eff, f, ff, gtd, hf, ids, kcf, ltd, pd, pf, rd, std, t, tads, tb, tbs, ti, tic, tit, tldr, tmp, tn, toff, tog, tom, tor, tr, tun, twp, uhf, vlf, yd, °F, DTD, KDE, LF, TPU
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

WithPlatformURL("https://platform.example.com"),
WithClientCredentials("id", "secret"),
)
```

#### Java SDK
```java
// Builder pattern
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

TdfClient client = TdfClient.builder()
.platformUrl("https://platform.example.com")
.clientCredentials("id", "secret")
.build();
```

#### JavaScript/TypeScript SDK
```typescript
// Options object pattern
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const client = new TdfClient({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

platformUrl: "https://platform.example.com",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: platformer, platformers
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

credentials: {
clientId: "id",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: client Id
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

clientSecret: "secret"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: client Secret
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

}
});
```

## Unified Interface Strategy

### Java SDK Implementation

The Java SDK should provide a clean, unified interface through the new `TdfClient` class:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


```java
// Future unified API
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

TdfClient client = TdfClient.builder()
.platformUrl("https://platform.example.com")
.clientCredentials("id", "secret")
.build();

// Encrypt with data attributes
client.setDataAttributes(List.of("attr1", "attr2"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

client.addAssertion("classification", "SECRET", signingKey);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: signing Key
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


// Encrypt/decrypt methods support both formats
try (InputStream in = new FileInputStream("plain.txt");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Input Stream
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

OutputStream out = new FileOutputStream("encrypted.tdf")) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Output Stream
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: TDF, IDF, PDF, TDI, UDF, GDF, MDF, TDD, TEF, TTF, TD, ADF, BDF, CDF, EDF, FDF, HDF, LDF, NDF, ODF, RDF, SDF, TAF, TBF, TCF, TDA, TDC, TDE, TDG, TDM, TDP, TDR, TDS, TDT, TF, TFF, TGF, THF, TLF, TNF, TOF, TPF, TWF, TIF, the, of, to, two, if, off, too, do, top, ten, CD, Dr, add, tax, tho, try, Tom, ad, odd, tag, tea, tie, tip, ton, CDs, GDP, HD, Ltd, WWF, ads, tide, tight, tin, toy, FDP, ID, SD, SF, TNA, TNT, TT, Ted, Todd, UHF, cf, id, ref, tan, tap, toe, tow, turf, ADC, ADP, AF, CDC, CDU, DA, DDR, DDT, DL, DM, DT, DX, GDR, HF, IMF, ITF, JD, PD, PDP, SDS, TCP, TLC, TTC, TV, Taft, UDP, dB, eds, elf, ta, tab, tar, thy, tub, tug, ADR, AIF, Ada, CDA, CDR, CSF, DG, ELF, FD, FDR, IDs, LD, MDC, MDR, MF, MSF, NDA, NSF, PDA, PDS, RDS, RPF, SDA, SDK, SDL, TAC, TCS, TCU, TFS, THC, TLS, TSA, TTL, TVs, TWA, Tao, TeX, Tide, USF, ode, tau, tee, til, tofu, tuff, AD, ADD, ADT, AEF, ARF, BDS, BWF, CBF, CDO, CDT, CMF, CTF, DDS, DQ, FDI, GDI, HDB, HDD, HDR, HDV, IDC, JDM, JTF, LDA, MDI, MDS, NDC, OSF, PDT, PSF, RDA, RDC, SDI, SDR, SPF, TBI, TCA, TCM, TCR, TLD, TMZ, TNG, TOC, TPA, TPC, TPM, TRC, TSS, TUC, Tia, Tod, UDC, UDR, WD, sf, tai, tam, tat, tidy, tot, ts, tuft, Adm, CDN, CPF, DCF, DDA, DDB, DDC, DDD, DDE, DTMF, EDP, EHF, FDC, GAF, GDS, GEF, IDB, IDG, IDL, JDL, LDC, MCF, MDL, MDM, MDP, MDT, MDX, MLF, MTBF, NDB, NFF, PDFs, SDC, SDM, SMF, SNF, STDs, TBA, TBC, TLDs, TLR, TTA, VLF, dz, emf, inf, tel, tum, CDV, EOF, EPF, HDS, PDQ, RIF, SHF, TCO, TEFL, TPL, TPN, Tut, Twp, VDU, adj, ado, oaf, tad, tut, TBD, TWX, Tue, VDT, adv, ted, tiff, tsp, tux, ETD, ODs, YTD, CDP, DJ, LDS, MD, NDP, RAF, Tim, vhf, dds, teds, 1D, 2D, 3D, 3DO, 4D, 8D, AAF, ABF, ACF, ADA, ADB, ADG, ADH, ADI, ADJ, ADK, ADL, ADM, ADN, ADQ, ADS, ADU, ADV, ADVF, ADX, ADY, ADZ, AFF, AGF, AHF, AJF, AKF, ALF, AMF, ANF, AOF, APF, AQF, ASF, ATD, ATF, AUF, AVF, AWF, AZF, BAF, BBF, BCF, BD, BDA, BDB, BDC, BDD, BDE, BDG, BDH, BDI, BDJ, BDK, BDL, BDM, BDN, BDNF, BDO, BDP, BDQ, BDR, BDT, BDU, BDV, BDW, BDX, BDY, BDZ, BEF, BF, BFF, BGF, BHF, BIF, BKF, BLF, BMF, BNF, BOF, BPF, BRF, BSF, BTF, BUF, BVF, CAF, CCF, CDB, CDD, CDE, CDG, CDH, CDI, CDJ, CDK, CDL, CDM, CDS, CDTF, CDW, CDZ, CEF, CF, CFDF, CFF, CGF, CHF, CIF, CJF, CNF, COF, CQF, CRF, CTIF, CUF, CVF, CWF, CZF, Cd, Cf, D, D8, DAF, DBF, DC, DD, DDAF, DDH, DDI, DDL, DDM, DDO, DDV, DE, DFA, DFB, DFC, DFE, DFF, DFG, DFI, DFL, DFM, DFN, DFO, DFP, DFS, DFT, DFV, DFW, DGF, DH, DI, DIF, DJF, DK, DLF, DMF, DN, DNF, DO, DOF, DP, DR, DS, DSF, DXF, Di, Du, Dy, EBF, EDA, EDB, EDC, EDD, EDFA, EDI, EDL, EDM, EDS, EDT, EDU, EDW, EDX, EEDF, EGF, EKF, EMF, ENF, EQF, ERDF, ERF, ESF, ETF, EUF, EVF, EZF, Ed, F, F&F, FAF, FBF, FDA, FDB, FDM, FDS, FEF, FF, FFF, FGF, FIF, FOF, FPF, FRF, FSF, FTF, FTPF, FVF, GCF, GDB, GDC, GDD, GDE, GDM, GDN, GDT, GF, GIF, GMF, GNF, GSF, GTD, GUF, Gd, HDE, HDFC, HDI, HDL, HDM, HDO, HEF, HIF, HNF, HSF, HTF, HUF, Hf, IAF, ICF, ID3, IDE, IDFA, IDH, IDK, IDM, IDN, IDP, IDQ, IDR, IDS, IDT, IEF, IF, IFF, IGF, IIF, IJF, INF, IOF, IPF, ISF, IUF, IVF, IWF, Ida, JAF, JDE, JDG, JDK, JDN, JDSF, JEF, JMF, JPF, JSF, KDG, KDP, KDS, KEF, KMF, KOF, KPF, KTD, L&F, LBF, LCF, LDD, LDE, LDH, LDIF, LDK, LDL, LDT, LDW, LEF, LGF, LOF, LPF, LRF, LSF, LTD, LTF, LUF, MAF, MDA, MDB, MDD, MDE, MDG, MDJ, MDK, MDN, MDQ, MDV, MDs, MEF, MFF, MGF, MIF, MOF, MRF, MTD, MTF, Md, NAF, NBF, ND, NDH, NDK, NDR, NDS, NDT, NF, NHF, NIF, NMF, NPF, NRF, NTD, Nd, OD, ODB, ODC, ODD, ODG, ODI, ODM, ODN, ODP, ODR, ODS, ODT, OGF, OKF, OLF, ONF, OVF, PAF, PCF, PDB, PDC, PDD, PDG, PDI, PDJ, PDK, PDL, PDMF, PDO, PDU, PDX, PEF, PGF, PIF, PLF, PMF, PNF, POF, PPDF, PRF, PTF, PUF, PWF, PYF, Pd, QDD, QDR, QF, QMF, QRF, RBF, RCF, RD, RDB, RDI, RDJ, RDM, RDP, RDT, RF, RGF, RHF, RMF, RNF, RRF, RSF, RTBF, RTD, RTF, RUF, RWF, Rd, Rf, SAF, SBF, SDD, SDE, SDFS, SDG, SDH, SDJ, SDN, SDO, SDP, SDU, SDV, SEF, SFF, SGDF, SGF, SLF, SRF, SSDF, SSF, STD, STF, STIF, T, T&C, T&S, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T28, T30, T37, T38, T40, T50, T7J, T99, TA, TAA, TAAF, TAD, TAE, TAG, TAH, TAI, TAJ, TAM, TAN, TAO, TAP, TAT, TB, TBH, TBJ, TBK, TBL, TBM, TBP, TBS, TBT, TBTF, TBW, TC, TCC, TCD, TCG, TCH, TCI, TCK, TCL, TCN, TCV, TCW, TDPS, TDSB, TEB, TEC, TED, TEDx, TEE, TEI, TEM, TEP, TEQ, TER, TES, TEU, TEV, TFA, TFB, TFC, TFE, TFK, TFL, TFR, TFT, TG, TGA, TGB, TGD, TGE, TGI, TGIF, TGL, TGN, TGP, TGS, TGU, TGV, TGW, TGX, TGZ, TH, THA, THB, THD, THM, THP, THS, THT, THX, TI, TIC, TID, TIFF, TIG, TIP, TIS, TIV, TJ, TJC, TJJ, TJK, TJS, TK, TKD, TKK, TKL, TKM, TKO, TKP, TKS, TKT, TL, TLA, TLB, TLDR, TLE, TLH, TLM, TLN, TLP, TLT, TLV, TM, TMA, TMB, TMC, TMD, TME, TMG, TMI, TMJ, TMN, TMP, TMS, TMT, TMV, TMX, TN, TNB, TNC, TND, TNE, TNK, TNL, TNM, TNN, TNO, TNP, TNR, TNS, TNW, TO, TOB, TOE, TOG, TOK, TOM, TOP, TOR, TOS, TOT, TP, TPDS, TPE, TPFE, TPG, TPI, TPJ, TPO, TPP, TPR, TPS, TPT, TPV, TPX, TQ, TQC, TQM, TQS, TR, TRE, TRI, TRL, TRM, TRP, TRS, TRT, TRX, TRY, TS, TSAF, TSB, TSC, TSD, TSE, TSG, TSH, TSI, TSK, TSL, TSM, TSN, TSO, TSP, TSR, TSV, TSX, TTD, TTG, TTI, TTO, TTP, TTR, TTS, TTT, TTU, TTX, TTY, TTs, TU, TUA, TUB, TUG, TUI, TUN, TUP, TUV, TV7, TV8, TVA, TVH, TVM, TVO, TVP, TVQ, TVS, TVU, TW, TWC, TWD, TWE, TWS, TWU, TWV, TX, TXK, TXL, TXT, TY, TYC, TYO, TZ, TZA, TZC, TZN, TZS, Ta, Tad, Tai, Tb, Tc, Te, Tet, Tex, Th, Thu, Ti, TiB, Tl, Tm, ToC, ToS, Tu, Ty, UCF, UDB, UDL, UDM, UDS, UFF, UMF, UNF, UPF, UTCF, UTF, UVF, UYF, Udo, VCF, VD, VDA, VDB, VDC, VDD, VDI, VDM, VDN, VDX, VF, VFF, VHF, VRF, VSF, WBF, WCF, WDC, WDI, WDM, WDS, WF, WIF, WLF, WMF, WPF, WSF, WTF, XAF, XD, XDMF, XPF, XRF, ZAF, ZDJ, ZEF, ZF, ZIF, bf, d, db, dd, def, dm, ed, eff, f, ff, gtd, hf, ids, kcf, ltd, pd, pf, rd, std, t, tads, tb, tbs, ti, tic, tit, tldr, tmp, tn, toff, tog, tom, tor, tr, tun, twp, uhf, vlf, yd, °F, DTD, KDE, LF, TPU
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

client.encrypt(in, out, TdfClient.Format.TDF); // or Format.NANO
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: NATO, NANA, ANO, CANO, KANO, NAND, NAO, NAN, NIÑO, N ANO
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

}
```

### Web SDK Implementation

The Web SDK should provide a similar unified interface through TypeScript:

```typescript
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const client = new TdfClient({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

platformUrl: "https://platform.example.com",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: platformer, platformers
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

oidcOrigin: "https://idp.example.com",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

credentials: {
clientId: "myClientId",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: client Id
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

clientSecret: "secretToken"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: client Secret
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: secret Token
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

}
});

// Set policy and assertions
await client.setDataAttributes(["https://opentdf.io/attr/class/value/secret"]);
await client.addAssertion("clearance", "SECRET", signingKey);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: signing Key
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


// Encrypt data (automatically selects format based on size/config)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const ciphertext = await client.encrypt(plaintext, { format: "nano" });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: NATO, Nana, ANO, Cano, Kano, NAND, NAO, Nan, Niño
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const decrypted = await client.decrypt(ciphertext); // auto-detects format
```

## Migration Strategy

Here's how to migrate existing code to the new unified interface:

### 1. Client Initialization Migration

**Old approach (pre-4.0):**
```typescript
// JavaScript/TypeScript

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const client = await NanoTDFClient.fromConfig({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: from Config
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

kasUrl: "https://kas.example.com",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Karl, leisure, casual, Kabul, Kassel, knurl, Kaur, Hasura
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

authProvider: new OIDCCredentials(/*...*/)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: auth Provider
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

});

// Java

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

NanoTDFClient client = new NanoTDFClient();
client.setKasUrl("https://kas.example.com");
client.setAuthProvider(new OIDCCredentials());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

```

**New unified approach (4.0+):**
```typescript
// JavaScript/TypeScript

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const client = new TdfClient({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

platformUrl: "https://platform.example.com", // Single endpoint

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: platformer, platformers
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

credentials: {
clientId: "id",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: client Id
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

clientSecret: "secret"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: client Secret
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

}
});

// Java

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

TdfClient client = TdfClient.builder()
.platformUrl("https://platform.example.com")
.clientCredentials("id", "secret")
.build();
```

### 2. Encryption/Decryption Migration

**Old approach:**

```typescript
// JavaScript/TypeScript - separate clients for different formats

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const nanoClient = new NanoTDFClient(config);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: ancient
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: coast, cost, canst, cont, cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const tdfClient = new TDFClient(config);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: TDF Client
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LanguageTool] reported by reviewdog 🐶
Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Suggestions: Coast, Cost, Canst, Cont, Cons
Rule: https://community.languagetool.org/rule/show/MORFOLOGIK_RULE_EN_US?lang=en-US
Category: TYPOS

const nanoEncrypted = await nanoClient.encrypt(data);
const tdfEncrypted = await tdfClient.encrypt(data);

// Java
NanoTDFClient nanoClient = new NanoTDFClient();
TDFClient tdfClient = new TDFClient();

byte[] nanoEncrypted = nanoClient.encrypt(data);
byte[] tdfEncrypted = tdfClient.encrypt(data);
```

**New unified approach:**
```typescript
// JavaScript/TypeScript - single client handles both formats
const client = new TdfClient(config);

// Format is auto-selected or explicitly specified
const encrypted = await client.encrypt(data, { format: "nano" });
const decrypted = await client.decrypt(encrypted); // Format auto-detected

// Java
Comment on lines +191 to +193
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get the suggestion to work properly because when I add "```" to break up the TS and Java code blocks, it thinks I'm ending my suggestion block in this comment, but it seems like we should separate these code blocks by language.

Suggested change
const decrypted = await client.decrypt(encrypted); // Format auto-detected
// Java
const decrypted = await client.decrypt(encrypted); // Format auto-detected

TdfClient client = TdfClient.builder().build();

// Streaming API with format selection
try (InputStream in = new FileInputStream("plain.txt");
OutputStream out = new FileOutputStream("encrypted.tdf")) {
client.encrypt(in, out, TdfClient.Format.NANO);
}
```

### 3. Testing Migration

Replace abstract test suites with concrete integration tests:

```typescript
describe('TDF Client Migration', () => {
// Test unified client with legacy format
it('should decrypt legacy NanoTDF format', async () => {
const unified = new TdfClient(config);
const legacyEncrypted = await getLegacyEncryptedData();
const decrypted = await unified.decrypt(legacyEncrypted);
expect(decrypted).toEqual(originalData);
});

// Test format interoperability
it('should support cross-format operations', async () => {
const client = new TdfClient(config);

// Encrypt as NanoTDF
const nano = await client.encrypt(data, { format: 'nano' });

// Decrypt with format auto-detection
const decrypted1 = await client.decrypt(nano);
expect(decrypted1).toEqual(data);

// Encrypt as standard TDF
const tdf = await client.encrypt(data, { format: 'tdf' });

// Decrypt with format auto-detection
const decrypted2 = await client.decrypt(tdf);
expect(decrypted2).toEqual(data);
});
});
```

### Migration Gotchas

1. **Attribute Format Changes**
- Legacy: Simple strings (`"SECRET"`)
- New: Full URIs (`"https://opentdf.io/attr/classification/value/secret"`)
- Migration helper: `client.normalizeAttribute(legacyAttr)`

2. **Error Handling Changes**
- Legacy: Multiple error types (`NanoTDFError`, `TDFError`)
- New: Unified `TdfError` with error codes
- Example: `TdfError.FORMAT_INVALID` instead of `InvalidNanoTDFError`

3. **Configuration Changes**
- Legacy configs won't work with unified client
- Use `ConfigMigrationTool` (included) to convert:
```typescript
const unifiedConfig = ConfigMigrationTool.migrate(legacyConfig);
const client = new TdfClient(unifiedConfig);
```

## Implementing a New SDK

### Prerequisites

1. Familiarize yourself with:
- [OpenTDF Architecture](/architecture)
- [TDF Specification](https://github.com/opentdf/spec)
- [Go SDK](https://github.com/opentdf/platform) (reference implementation)

2. Required capabilities:
- Protocol Buffers / Connect RPC support
- Modern cryptography library support
- ZIP handling (for standard TDF)
- JSON parsing

### Implementation Steps

1. **Service Client Generation**
- Generate API clients from Protocol Buffer definitions
- Implement authentication flow
- Configure service discovery

2. **Core Cryptographic Operations**
- Implement key derivation
- Support ECC for NanoTDF
- Implement signature verification

3. **Format Support**
- Implement TDF manifest creation/parsing
- Implement NanoTDF binary format
- Support streaming for large files

4. **Policy and Assertions**
- Implement ABAC policy binding
- Support signed assertions
- Validate integrity during decryption

## Implementation Checklist

For each new SDK implementation:

- [ ] Service Integration
- [ ] Platform URL configuration
- [ ] Well-known endpoint discovery
- [ ] Authentication flow
- [ ] Generated service clients

- [ ] TDF Support
- [ ] Manifest creation/parsing
- [ ] ZIP packaging
- [ ] Streaming support
- [ ] Policy binding

- [ ] NanoTDF Support
- [ ] Binary format handling
- [ ] ECC cryptography
- [ ] Performance optimization

- [ ] Policy & Security
- [ ] ABAC implementation
- [ ] Assertion signing/verification
- [ ] Key derivation
- [ ] Integrity validation

For detailed technical specifications and implementation guidance, see:
- [TDF Format Specification](/spec/schema/opentdf)
- [NanoTDF Specification](/spec/schema/nanotdf)
- [Protocol Documentation](/spec/protocol)
8 changes: 8 additions & 0 deletions docs/sdks/web/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "Web SDK",
"position": 5,
"link": {
"type": "generated-index",
"description": "Documentation for the JavaScript/TypeScript Web SDK implementation of OpenTDF"
}
}
Loading