Giter Site home page Giter Site logo

API about check HOT 3 OPEN

arlolra avatar arlolra commented on May 28, 2024
API

from check.

Comments (3)

Ryman avatar Ryman commented on May 28, 2024

What's the idea around fleshing it out? What service/info is wanted? Or just to make bulk more useful?

I'd suggest versioning the api if it is something you want to adopt for the project long term (e.g. .../api/1.0/...), I guess it depends what the goal of the api is!

from check.

arlolra avatar arlolra commented on May 28, 2024

What's the idea around fleshing it out? What service/info is wanted? Or just to make bulk more useful?

Nothing really wants this at the moment, it just seems like it could be useful to have around. An idea stemming from, https://trac.torproject.org/projects/tor/ticket/9529#comment:20

The fleshing out is to determine what info we have and how to expose it. Something like,

/api/ip?address=123.123.123.123&port=80  // returns { tor: true/false, fingerprint: ... }
/api/ip?fingerprint=AD2344243... // returns { exitip: 123.123.123.123 }
/api/bulk/all  // returns [ ... list of all known exits and their ips ... ]

I'd suggest versioning the api if it is something you want to adopt for the project long term (e.g. .../api/1.0/...), I guess it depends what the goal of the api is!

There are other services, besides the TBB, that depend on check, so long term support is a goal. See https://trac.torproject.org/projects/tor/ticket/10183

I'd rather not have the version number in the url. That can be accomplished with an Accept header. I guess see GitHub's API or this article as a model.

from check.

Ryman avatar Ryman commented on May 28, 2024

/api/ip?address=123.123.123.123&port=80 // returns { tor: true/false, fingerprint: ... }

Seems sound, how about RESTful-ish /api/ip/-ip-/-port-
Should multiple IPs be supported per query? (I don't think so)

It could be useful to provide a lastseen timestamp for the IP lookups so consumers can make their own decisions for how many hours they're willing to allow true/false for instead of providing true/false? (or could be additional?)

If no port is given, we could return the accept/reject policies? (Since isTor can't be known for that?)
Could also list alternative IPs seen for the matched fingerprint (with last seen time for each?)

/api/ip?fingerprint=AD2344243... // returns { exitip: 123.123.123.123 }

Perhaps /api/router? Again, might want to provide ip/time combos?

/api/bulk/all // returns [ ... list of all known exits and their ips ... ]

So this is an exit list basically? , (I think we can drop the /all , no query implies all)

Would providing microdesc/fulldesc endpoints be overkill? Any consumer should probably be using the fingerprints to lookup atlas/globe/whatever for further information? Perhaps supplying a 'further info' link we can update to the service of the day might be useful?

I'd rather not have the version number in the url. That can be accomplished with an Accept header. I guess see GitHub's API or this article as a model.

I don't feel that strongly about implementation on that as long as it's there :) But I would note that having it in the url makes it easier to test in browser (not a big issue really)

On another aesthetic note: I noticed in the code it's looking for format=json, /i/like/endpoint.{json,xml,...} personally :)

from check.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.