Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Porting test framework #283

Closed
kralos opened this issue Jun 10, 2021 · 2 comments
Closed

Porting test framework #283

kralos opened this issue Jun 10, 2021 · 2 comments

Comments

@kralos
Copy link

kralos commented Jun 10, 2021

@hueniverse I'm considering starting a dart port and was wondering if you're open to exposing the tests in this library for validation in other languages. The way I could see it working is if we could move all test cases to load scenarios from a json file which would hold something like:

tests/client/returns_a_valid_authorization_header_sha1.json

{
    "input": [
        "http://example.net/somewhere/over/the/rainbow",
        "POST",
        {
            "credentials": {
                "id": "123456",
                "key": "2983d45yun89q",
                "algorithm": "sha1"
            },
            "ext": "Bazinga!",
            "timestamp": 1353809207,
            "nonce": "Ygvqdz",
            "payload": "something to write about"
        }
    ],
    "method": "Hawk.client.header",
    "expected": "Hawk id=\"123456\", ts=\"1353809207\", nonce=\"Ygvqdz\", hash=\"bsvY3IfUllw6V5rvk4tStEvpBhE=\", ext=\"Bazinga!\", mac=\"qbf1ZPG/r/e06F4ht+T77LXi5vw=\""
}

Note: Format to be determined after attempting to build test suite into all existing languages.

We would then treat the js implementation as the authority on tests / behavior. Ports would be expected to load the json test cases from this repo in order to verify compliance.

@hueniverse
Copy link
Contributor

I no longer maintain this.

@jwhitlock
Copy link
Member

Refactoring the test code would go beyond Mozilla's commitment to security-related bug fixes. A language-independent test suite with a modern license sounds like a useful stand-alone project.

You may want to collaborate with this dart project: https://github.com/tiagohm/restio

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants