Skip to content

Commit

Permalink
Update outdated API references in plugin/README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Krieger <ben.krieger@intel.com>
  • Loading branch information
ben-krieger committed Oct 5, 2024
1 parent 5b174bc commit 3df7dfc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
7 changes: 3 additions & 4 deletions sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 3df7dfc

Please sign in to comment.