Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolykeyAgent and PolykeyClient now accept the rpcMiddlewareFactory for Custom Middleware + versionMetadata option for defining version information for agentStatus RPC call #664

Merged
merged 3 commits into from
Jan 10, 2024

Conversation

amydevs
Copy link
Contributor

@amydevs amydevs commented Jan 10, 2024

Description

This PR aims to allow for users of PolykeyAgent and PolykeyClient to insert additional middleware onto the Client RPC service. The main goal, is to be able to have the agentStatus RPC handler be able to report additional information about the Polykey-CLI binary that is running the node, such as the commitHash of the source used to produce binary.

The implementation is based on the middlewareFactory chaining originally found in https://github.com/MatrixAI/Polykey/blob/004ee0827b685622af860395879a53c5c9214014/src/client/utils/middleware.ts;

The versionMetadata field has also been added to the agentStatus RPC call so that the user can provide arbitrary information about the version through the PolykeyAgent constructor parameters.

Issues Fixed

Tasks

  • 1. Parameterize rpcMiddlewareFactory
  • 2. Modify client/middleware.ts to accept custom middleware factories
  • 3. Add versionMetadata field to agentStatus RPC handler.

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

…tory` option to allow for custom middleware to be inserted alongside authentication
@ghost
Copy link

ghost commented Jan 10, 2024

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@amydevs amydevs changed the title PolykeyAgent and PolykeyClient now accept the rpcMiddlewareFactory option to allow for custom middleware to be inserted alongside authentication PolykeyAgent and PolykeyClient now accept the rpcMiddlewareFactory for Custom Middleware + versionMetadata option for defining version information for agentStatus RPC call Jan 10, 2024
@amydevs amydevs merged commit 78651fe into staging Jan 10, 2024
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant