mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
Without this, we have hardly any enforcement. This is why the schema mistake fixed in the previous patches weren't spotted immediately. The hard work was done by: ``` $ for f in lightning-*.json; do grep -v '^ "additionalProperties": false,' $f | bagto $f; done $ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done $ make fmt-schemas ``` Then checking where 'additionalProperties: true' had been turned to false (we deliberately use it in some places where there are if statements in the schema, or occasionally where there can be arbitrary fields). [Including doc/rpc-schema-draft.json update by Shahana] Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
78 lines
1.8 KiB
JSON
78 lines
1.8 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"rpc": "makesecret",
|
|
"title": "Command for deriving pseudorandom key from HSM",
|
|
"description": [
|
|
"The **makesecret** RPC command derives a secret key from the HSM_secret."
|
|
],
|
|
"request": {
|
|
"required": [],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"hex": {
|
|
"type": "hex",
|
|
"description": [
|
|
"One of `hex` or `string` must be specified: `hex` can be any hex data."
|
|
]
|
|
},
|
|
"string": {
|
|
"type": "string",
|
|
"description": [
|
|
"One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"required": [
|
|
"secret"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"secret": {
|
|
"type": "secret",
|
|
"description": [
|
|
"The pseudorandom key derived from HSM_secret."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"errors": [
|
|
"The following error codes may occur:",
|
|
"",
|
|
"- -1: Catchall nonspecific error."
|
|
],
|
|
"author": [
|
|
"Aditya <<aditya.sharma20111@gmail.com>> is mainly responsible."
|
|
],
|
|
"resources": [
|
|
"Main web site: <https://github.com/ElementsProject/lightning>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:makesecret#1",
|
|
"method": "makesecret",
|
|
"params": [
|
|
"73636220736563726574"
|
|
]
|
|
},
|
|
"response": {
|
|
"secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:makesecret#2",
|
|
"method": "makesecret",
|
|
"params": {
|
|
"string": "scb secret"
|
|
}
|
|
},
|
|
"response": {
|
|
"secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
|
|
}
|
|
}
|
|
]
|
|
}
|