Git Product home page Git Product logo

urlbox-python's People

Contributors

alandonohoe avatar cjroebuck avatar urlbox-io avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

urlbox-python's Issues

Question #1

Here’s a question…

I think:

options = {"full_page": True, "width": 300}
response = urlbox_client.get(url, format=format, options=options)

is a better, clearer, more intuitive, interface than:

options = {"url": "http://example.com/", "full_page": True, "width": 300}
response = urlbox_client.get(format=format, options=options)

I mean, urlbox_client.get(url, rest_of_params…) is so clear…
CLIENT, GET a URL.

Means that the other calls the Python API implements to get to existing API parity, can be: urlbox_client.post(url, …), urlbox_client.head(url, …) etc… Something along those lines…

But it does then break slightly with how the current/ direct API works, where the url is included in the options param: https://urlbox.io/docs/getting-started

I do think it will make the python API so much clearer to have it this way…

Is that cool?

it should be able to also POST options to the /v1/render endpoint, and handle the incoming webhook payload, as-in have a function to authenticate that the incoming webhook payload was from urlbox.

Test:

# TODO: need to get the server and client hashing working in sync
# Should test that the hexdigest of the sha256 hash of the payload passes/fails
# when the signature passed in is the correct/incorrect hexdigest respectively
# def test_call_invalid_hash():
#     header_signature = f"t={timestamp_one_minute_ago},sha256={fake.pystr()}"

#     with pytest.raises(InvalidHeaderSignatureError) as exception:
#         webhook_validator.call(header_signature, payload, api_secret)

#     assert "" in str(exception.value)

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.