Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions paranoia.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ def assert_valid_bolt11(invoice: str):
assert_printable(invoice)


# Check if string is a valid bolt12 string
def assert_valid_bolt12(bolt12: str):
if not ENABLE_HARDENING:
return
assert_printable(bolt12)


# Check if boolean
def assert_boolean(v: bool):
if not ENABLE_HARDENING:
Expand Down
21 changes: 21 additions & 0 deletions permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,34 @@
"pay": {
"name": "Send payments",
"methods": [
"fetch_invoice",
"multi_pay_invoice",
"pay_invoice",
"pay_keysend",
"multi_pay_keysend",
],
"default": True,
},
"offer": {
"name": "Create offer",
"methods": ["make_offer"],
"default": True,
},
"lookup_offer": {
"name": "Lookup status of offer",
"methods": ["lookup_offer"],
"default": True,
},
"enable_disable_offer": {
"name": "Enabling/disabling an offer",
"methods": ["enable_offer", "disable_offer"],
"default": True,
},
"list_offers": {
"name": "Read list of offers",
"methods": ["list_offers"],
"default": True,
},
"invoice": {
"name": "Create invoices",
"methods": ["make_invoice"],
Expand Down
Loading
Loading