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

Updated signing process #17

Merged
merged 12 commits into from
Nov 29, 2023
Merged

Conversation

JulienR1
Copy link
Contributor

@JulienR1 JulienR1 commented Nov 27, 2023

This PR adds the possibility to sign a temporary token and cache it for an predefined amount of time. This allows every connected sink to reduce the required work to validate signatures because the received signature will be already known.

This feature is turned off by default. It can be turned on by setting --signature cached when launching the sink.
The signature expiry time can be controlled via --expiry-time <number>

The caching offers these performance on my machine:

image

case "cached":
return new CachedSigner(options.secretKey, options.expirationTime);
case "payload":
return new PayloadSigner(options.secretKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh let's not provide both options

Either or, not both

This makes the documentation really confusing because then we need to explain both

import nacl from "tweetnacl";
import { Signer } from "./index.js";

export class PayloadSigner implements Signer {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't need to be a class

@DenisCarriere DenisCarriere merged commit 413b4b3 into main Nov 29, 2023
1 check passed
@JulienR1 JulienR1 deleted the feature/updated-signing-process branch November 29, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants