| 26 | |
| 27 | @plugin.init() |
| 28 | def init(options, configuration, plugin): |
| 29 | plugin.rpc.call( |
| 30 | "clnrest-register-path", |
| 31 | ["test/no/rune_restrictions", "dynamic-clnrest-method"], |
| 32 | ) |
| 33 | plugin.rpc.call( |
| 34 | "clnrest-register-path", |
| 35 | ["test/no/rune_required", "dynamic-clnrest-method", "GET", False], |
| 36 | ) |
| 37 | plugin.rpc.call( |
| 38 | "clnrest-register-path", |
| 39 | [ |
| 40 | "test/dynamic/clnrest", |
| 41 | "dynamic-clnrest-method", |
| 42 | "POST", |
| 43 | True, |
| 44 | {"method": "pay"}, |
| 45 | ], |
| 46 | ) |
| 47 | plugin.rpc.call( |
| 48 | "clnrest-register-path", |
| 49 | [ |
| 50 | "test/dynamic/clnrest", |
| 51 | "dynamic-clnrest-method-2", |
| 52 | "PATCH", |
| 53 | True, |
| 54 | {"method": "pay"}, |
| 55 | ], |
| 56 | ) |
| 57 | plugin.rpc.call( |
| 58 | "clnrest-register-path", |
| 59 | [ |
| 60 | "test/dynamic/clnrest", |
| 61 | "dynamic-clnrest-method", |
| 62 | "DELETE", |
| 63 | True, |
| 64 | {"method": "pay"}, |
| 65 | ], |
| 66 | ) |
| 67 | plugin.rpc.call( |
| 68 | "clnrest-register-path", |
| 69 | [ |
| 70 | "invalid/nodeid", |
| 71 | "invalid-nodeid", |
| 72 | "POST", |
| 73 | True, |
| 74 | { |
| 75 | "nodeid": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d" |
| 76 | }, |
| 77 | ], |
| 78 | ) |
| 79 | plugin.rpc.call( |
| 80 | "clnrest-register-path", |
| 81 | { |
| 82 | "path": r"v{version}/{capture}/go", |
| 83 | "rpc_method": "capture-route", |
| 84 | "rune_restrictions": {"params": {"amount_msat": 9999}}, |
| 85 | "http_method": "GET", |