-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
# Conflicts: # package.json
src/auth/index.ts
Outdated
case "cached": | ||
return new CachedSigner(options.secretKey, options.expirationTime); | ||
case "payload": | ||
return new PayloadSigner(options.secretKey); |
There was a problem hiding this comment.
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
src/auth/payload-signer.ts
Outdated
import nacl from "tweetnacl"; | ||
import { Signer } from "./index.js"; | ||
|
||
export class PayloadSigner implements Signer { |
There was a problem hiding this comment.
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
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: