From 3df7dfc041c808be1b32a6034e580810383b1c3a Mon Sep 17 00:00:00 2001 From: Ben Krieger Date: Fri, 4 Oct 2024 21:39:48 -0400 Subject: [PATCH] Update outdated API references in plugin/README.md Signed-off-by: Ben Krieger --- plugin/README.md | 6 +++--- plugin/plugin.go | 2 +- sqlite/sqlite.go | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/plugin/README.md b/plugin/README.md index ca05a10..0723208 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -4,13 +4,13 @@ Service info modules can either be implemented using the "internal" Go interface ## Using Plugin Device Modules -FDO clients use plugin device service info modules the same way as statically compiled ones. `(*fdo.Client).TransferOwnership2(...)` takes a `map[string]serviceinfo.DeviceModule` argument. +FDO clients use plugin device service info modules the same way as statically compiled ones. `(fdo.TO2Config).DeviceModules` is a `map[string]serviceinfo.DeviceModule` and can contain plugin and non-plugin modules simultaneously, since they both satisfy the `serviceinfo.DeviceModule` interface. -If a `devmod` module is provided, then the value of `(*Client).Devmod` will be ignored. However, any `devmod` plugin module must NOT write serviceinfo for the `devmod:nummodules` and `devmod:modules` keys as these are handled by the library. +If a `devmod` module is provided, then the value of `(fdo.TO2Config).Devmod` will be ignored. However, any `devmod` plugin module must NOT write serviceinfo for the `devmod:nummodules` and `devmod:modules` keys as these are handled by the library. ## Using Plugin Owner Modules -FDO owner services use plugin owner service info modules the same way as statically compiled ones. `(*fdo.Server).StartFSIMs` is a required field that must be set to a function returning a `serviceinfo.OwnerModuleList`. However this interface is satisfied - it is just an iterator - plugin modules may be included side by side with compiled modules. +FDO owner services use plugin owner service info modules the same way as statically compiled ones. `(fdo.TO2Server).OwnerModules` is a required field that must be set to an `iter.Seq2` yielding a module name and `serviceinfo.OwnerModule`. As with device modules, plugin owner modules may be included side by side with compiled modules. ## Plugin Format diff --git a/plugin/plugin.go b/plugin/plugin.go index ec5140f..96a8cb6 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -3,7 +3,7 @@ // Package plugin defines a line-based protocol and implements service info // device and owner module adapters to plugins communicating over a reader- -// writer pair (i.e. pipe). +// writer pair. package plugin import ( diff --git a/sqlite/sqlite.go b/sqlite/sqlite.go index fcad3da..339c99a 100644 --- a/sqlite/sqlite.go +++ b/sqlite/sqlite.go @@ -1108,8 +1108,7 @@ func (db *DB) SetSetupDeviceNonce(ctx context.Context, nonce protocol.Nonce) err ) } -// SetupDeviceNonce returns the Nonce used in TO2.SetupDevice and -// TO2.Done2. +// SetupDeviceNonce returns the Nonce used in TO2.SetupDevice and TO2.Done2. func (db *DB) SetupDeviceNonce(ctx context.Context) (protocol.Nonce, error) { sessID, ok := db.sessionID(ctx) if !ok { @@ -1134,8 +1133,8 @@ func (db *DB) SetupDeviceNonce(ctx context.Context) (protocol.Nonce, error) { return nonce, nil } -// AddOwnerKey to retrieve with [DB.Signer]. chain may be nil, in which -// case X509 public key encoding will be used instead of X5Chain. +// AddOwnerKey to retrieve with [DB.OwnerKey]. chain may be nil, in which case +// X509 public key encoding will be used instead of X5Chain. func (db *DB) AddOwnerKey(keyType protocol.KeyType, key crypto.PrivateKey, chain []*x509.Certificate) error { der, err := x509.MarshalPKCS8PrivateKey(key) if err != nil {