dyne / restroom-mw

🛠 Easy REST API builder executing Zencode
https://restroom.dyne.org
GNU Affero General Public License v3.0
3 stars 11 forks source link

Search keys by name in redis #171

Closed andrea-dintino closed 2 years ago

andrea-dintino commented 2 years ago

We'd need to be able to search keys by name, with a statement like:

Given I read from redis the data under the keys containing 'string' and save the output into 'output'

Input:

{
"string": "did:example"
}

The output should be an array of of string dictionaries, like:

{
    "output": [
        {
            "@context": [
                "https://www.w3.org/ns/did/v1",
                "https://w3id.org/security/suites/ed25519-2020/v1"
            ],
            "id": "did:example:123456789abcdefghi",
            "verificationMethod": [
                {
                    "id": "did:example:123456789abcdefghi#key-1",
                    "type": "Ed25519VerificationKey2020",
                    "controller": "did:example:123456789abcdefghi",
                    "publicKeyMultibase": "zH3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
                }
            ],
            "authentication": [
                "#key-1"
            ]
        },
        {
            "@context": [
                "https://www.w3.org/ns/did/v1",
                "https://w3id.org/security/suites/ed25519-2020/v1"
            ],
            "id": "did:example:abcde123456789abcdefghi",
            "verificationMethod": [
                {
                    "id": "did:example:abcde123456789abcdefghi#key-1",
                    "type": "Ed25519VerificationKey2020",
                    "controller": "did:example:123456789abcdefghi",
                    "publicKeyMultibase": "zH3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
                }
            ],
            "authentication": [
                "#key-2"
            ]
        }
    ]
}
puria commented 2 years ago

Implemented in https://github.com/dyne/restroom-mw/pull/172

andrea-dintino commented 2 years ago

The output of this statement is stringified, it shouldn't be so.