-
Notifications
You must be signed in to change notification settings - Fork 197
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
fix: issues with invoices #271
Conversation
Pull Request Test Coverage Report for Build 4638676897Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
return | ||
} | ||
|
||
if (this.getRelayPublicKey() === event.pubkey) { | ||
return undefined |
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.
Inconsistent returns, is this intentional?
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 is fine, we return undefined
if user is admitted/whitelisted or a string with the reason if they are not admitted
this new check fixes the issue of the relay's public key not being allowed on the relay when payment is enabled which is a big oversight
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.
in the future we could change this pattern to using constants or symbols
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.
Ah got it, I was referring more to line 261
vs line 265
, cause one is just return
and the other return undefined
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.
Ah, I'll remove the extra undefined
src/utils/event.ts
Outdated
@@ -181,15 +181,33 @@ export const identifyEvent = async (event: UnidentifiedEvent): Promise<UnsignedE | |||
return { ...event, id } | |||
} | |||
|
|||
export function getRelayPrivateKey(relayUrl: string): string { | |||
let privateKeyCache: string | undefined | |||
export function getRelayPrivateKey(secret: string): string { |
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.
Is secret
an optional parameter? If so we could make the type indicate this
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.
it should always be the relay's URL, but it is ignored when RELAY_PRIVATE_KEY
env var is set
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.
Ok, why is the param called secret
?
SonarCloud Quality Gate failed. |
# [1.23.0](v1.22.6...v1.23.0) (2023-05-12) ### Bug Fixes * add SECRET as env variable ([#298](#298)) ([58a1254](58a1254)) * invoice auto marked as paid ([be6d6f1](be6d6f1)) * issues with invoices ([#271](#271)) ([e1561e7](e1561e7)) ### Features * add LNURL processor ([#202](#202)) ([f237400](f237400)) * allow lightning zap receipts on paid relays ([#303](#303)) ([14bc96f](14bc96f))
🎉 This PR is included in version 1.23.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [1.23.0](v1.22.6...v1.23.0) (2023-05-12) ### Bug Fixes * add SECRET as env variable ([#298](#298)) ([58a1254](58a1254)) * invoice auto marked as paid ([be6d6f1](be6d6f1)) * issues with invoices ([#271](#271)) ([e1561e7](e1561e7)) ### Features * add LNURL processor ([#202](#202)) ([f237400](f237400)) * allow lightning zap receipts on paid relays ([#303](#303)) ([14bc96f](14bc96f))
* chore: hide powered by zebedee if payment processor is not * chore: add nodeless as payments processor to settings * fix: bad content type on zebedee callback req handler * chore(release): 1.23.0 [skip ci] # [1.23.0](v1.22.6...v1.23.0) (2023-05-12) ### Bug Fixes * add SECRET as env variable ([#298](#298)) ([58a1254](58a1254)) * invoice auto marked as paid ([be6d6f1](be6d6f1)) * issues with invoices ([#271](#271)) ([e1561e7](e1561e7)) ### Features * add LNURL processor ([#202](#202)) ([f237400](f237400)) * allow lightning zap receipts on paid relays ([#303](#303)) ([14bc96f](14bc96f)) * feat: implement nodeless payments processor * docs: add accepting payments section * chore: validate nodeless webhook secret * chore: hide powered-by-zebedee for non-zebedee processors --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: