MCPcopy Create free account
hub / github.com/ElementsProject/lightning / readonly_restrictions

Function readonly_restrictions

plugins/commando.c:722–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720}
721
722static struct rune_restr **readonly_restrictions(const tal_t *ctx)
723{
724 struct rune_restr **restrs = tal_arr(ctx, struct rune_restr *, 2);
725
726 /* Any list*, get*, or summary:
727 * method^list|method^get|method=summary
728 */
729 restrs[0] = rune_restr_new(restrs);
730 rune_restr_add_altern(restrs[0],
731 take(rune_altern_new(NULL,
732 "method",
733 RUNE_COND_BEGINS,
734 "list")));
735 rune_restr_add_altern(restrs[0],
736 take(rune_altern_new(NULL,
737 "method",
738 RUNE_COND_BEGINS,
739 "get")));
740 rune_restr_add_altern(restrs[0],
741 take(rune_altern_new(NULL,
742 "method",
743 RUNE_COND_EQUAL,
744 "summary")));
745 /* But not listdatastore!
746 * method/listdatastore
747 */
748 restrs[1] = rune_restr_new(restrs);
749 rune_restr_add_altern(restrs[1],
750 take(rune_altern_new(NULL,
751 "method",
752 RUNE_COND_NOT_EQUAL,
753 "listdatastore")));
754
755 return restrs;
756}
757
758static struct rune_altern *rune_altern_from_json(const tal_t *ctx,
759 const char *buffer,

Callers 1

param_restrictionsFunction · 0.85

Calls 3

rune_restr_newFunction · 0.85
rune_restr_add_alternFunction · 0.85
rune_altern_newFunction · 0.85

Tested by

no test coverage detected