Skip to content
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

If you keep writing weird runes, I'll be back... #5539

Merged

Commits on Sep 12, 2022

  1. Makefile: fix msggen regeneration when schemas change.

    1. It depends on both request and reply schemas.
    2. Wildcards aren't natively expanded in make, so use $(wildcard).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    e096751 View commit details
    Browse the repository at this point in the history
  2. pytest: test for escapes in commando values.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    00bcdb2 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. CCAN: update to get latest rune decode fix.

    We didn't handle \ in fields properly, unless they were one-char long.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    8352eb5 View commit details
    Browse the repository at this point in the history
  2. commando: unmangle JSON.

    JSON needs to escape \, since it can't be in front of anything unexpected,
    so no \|.  So we need to return \\ to \, and in theory handle \n etc.
    
    Changelog-Fixed: JSON-RPC: `commando-rune` now handles \\ escapes properly.
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    08d2fc0 View commit details
    Browse the repository at this point in the history
  3. commando: make rune alternatives a JSON array.

    This avoids having to escape | or &, though we still allow that for
    the deprecation period.
    
    To detect deprecated usage, we insist that alternatives are *always*
    an array (which could be loosened later), but that also means that
    restrictions must *always* be an array for now.
    
    Before:
    
    ```
    # invoice, description either A or B
    lightning-cli commando-rune '["method=invoice","pnamedescription=A|pnamedescription=B"]'
    # invoice, description literally 'A|B'
    lightning-cli commando-rune '["method=invoice","pnamedescription=A\\|B"]'
    ```
    
    After:
    
    ```
    # invoice, description either A or B
    lightning-cli commando-rune '[["method=invoice"],["pnamedescription=A", "pnamedescription=B"]]'
    # invoice, description literally 'A|B'
    lightning-cli commando-rune '[["method=invoice"],["pnamedescription=A|B"]]'
    ```
    
    Changelog-Deprecated: JSON-RPC: `commando-rune` restrictions is always an array, each element an array of alternatives.  Replaces a string with `|`-separators, so no escaping necessary except for `\\`.
    rustyrussell committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    1d53827 View commit details
    Browse the repository at this point in the history