Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Store decrypted request method and content data #359

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

bumi
Copy link

@bumi bumi commented May 30, 2024

this allows use to create an event log in the future and list the actual requests per app connection

bumi added 2 commits May 30, 2024 21:17
this allows use to create an event log in the future and list
the actual requests per app connection
It should not fail and if it fails it does not matter much I guess
@bumi bumi requested a review from rolznz May 30, 2024 19:21
@@ -541,6 +541,10 @@ func (svc *Service) HandleEvent(ctx context.Context, sub *nostr.Subscription, ev
return
}

requestEvent.Method = nip47Request.Method
requestEvent.ContentData = payload
Copy link
Collaborator

Choose a reason for hiding this comment

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

should the ContentData be nip47Request.params?

{
    "method": "pay_invoice",
    "params": {
        "invoice": "lnbc50n1...", // bolt11 invoice
        "amount": 123, // invoice amount in msats, optional
    }
}

And should we call it params to be consistent with the spec?

Copy link
Author

Choose a reason for hiding this comment

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

do you think that's better?
then I have to JSON dump the params here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

True. Maybe the way you did it is better.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need to store the Content then? or we can remove this along with the content in the response event?

Copy link
Collaborator

@rolznz rolznz left a comment

Choose a reason for hiding this comment

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

utACK

@bumi bumi merged commit 36fe4f5 into master Jun 4, 2024
3 checks passed
@bumi bumi deleted the presist-decrypted-request branch June 4, 2024 14:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants