-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
There's some opportunity for refactoring our remote attestation implementation, this issue is meant to track aspects that could be improved. It's worth noting that we currently support remote attestation over both unary and bidi-streaming gRPC. We plan to remove support for attestations over bidi-streaming gRPC in the future. It'll be easiest to tackle these issues once that has happened.
Probable refactoring opportunities:
- Overlap between the Handshaker & Encryptor struct, both of which can represent the same state. See discussion on Implement Server Side Unary Remote Attestation #2596: (relevant comment)
- The Handshaker maintains duplicate handshake state in a transcript key and state enum, which are implicitly expected to have the same state. It'd be nice to deduplicate this, to increase resilience to future changes and prevent unexpected behavior.
- Shared configuration state is cloned into each Handshaker. Cloning shared state may lead to issues down the road when state changes may not be in all clones. It'd be nice to use references instead. Ref: Stop cloning additional_info into each ServerHandshaker #2574
- The handshaker exposes
next_stepmethod that optionally returns a next step (if not completed) and ais_completedmethod. They're expected to behave the same, ifis_completedreturns falsenext_stepshould returnNone. However with future changes that may not be the case, which would lead to infinite loops in our client implementation: link. It'd be nice to simplify the API of Handshaker in that regard. Ref Implement unary request client #2607 - Attestation clients expose an inconsistent
sendmethod, which expects a proto instance as an argument but returns a serialized proto. See [this chat thread for more details], and also this PR: Implement unary request client #2607
Metadata
Metadata
Assignees
Labels
No labels