Subject: [weirds] JSON generation python lib

From: Alex Sergeyev <[email-masked]>
Date: Wed, 19 Dec 2012 14:02:48 -0500

All,

I'm currently working on improving experimental weirds code that we
run in Dyn, same time I was going thru new proposals, and modified lib
we published 5 months ago.

https://github.com/dyninc/flask-weirds

This has interesting component, objects.py that I'll try to keep
updated according to draft-ietf-weirds-json-response in future.

You can see that I'm lazy programmer and did not really write enough
tests, but more of a demonstration that lib works:
              https://github.com/dyninc/flask-weirds/blob/master/flask_weirds/objects_test.py

Anyway. In order to play with it over REST you'll need to have flask
(pip install flask) and some modules that flask requires.
You may not install this module to your system just play with it in
command line, something like this:

------------------
asergeyev@:~$ python weirdsexample.py  --debug
Running the app, you should be able to query
http://hostname:5000/fakedomain/example.org
...
Try also .net .edu .info and other domains and later with
"example:password" authentication.
 * Running on http://0.0.0.0:5000/
 * Restarting with reloader
Running the app, you should be able to query
http://hostname:5000/fakedomain/example.org
...
Try also .net .edu .info and other domains and later with
"example:password" authentication.
--------------------

It's really minimalistic app that only knows few "fakedomain" objects
and nothing else.... Using different screen you might do:

------------------
asergeyev@:~$  curl -L http://127.0.0.1:5000/fakedomain/example.net
{
    "name": "example.net"
}
asergeyev@:~$ curl -L
http://example:[email-masked]:5000/fakedomain/example.net
{
    "entities": {
        "entityNames": [
            "Internet Assigned Numbers Authority"
        ]
    },
    "name": "example.net",
    "remarks": [
        "You're very valuable for us and we'll give you all the info."
    ]
}
asergeyev@:~$  curl -L http://127.0.0.1:5000/fakedomain/example.biz
{
    "errorCode": 65281,
    "description": [
        "Requested object was not found in our database."
    ],
    "title": "Not Found"
}
------------------

Or use "rdapper" mentioned on the list earlier:
------------------
asergeyev@:rdapper (master)$ ./rdapper --host=localhost:5000
--TYPE=fakedomain example.net
Name : example.net
asergeyev@:rdapper (master)$ ./rdapper --host=localhost:5000
--TYPE=fakedomain example.biz
Error: 404 Not Found
------------------

I did not look hard enough to make rdapper understand authentication
(obvious --username and --password did not help). Really want to get
to our public-facing weirds first.

Hope it has some value for this WG and wish you all happy holidays.

Alex.