Coder Social home page Coder Social logo

Auth tests are failing about hydrus HOT 5 CLOSED

http-apis avatar http-apis commented on June 2, 2024
Auth tests are failing

from hydrus.

Comments (5)

alohamora avatar alohamora commented on June 2, 2024

@xadahiya I checked with the codebase...the assertion error is because we have set up authentication for all the endpoints in api. with set_authentication(self.app, True): at line 55 in test_auth.py.
Hence it shall always give a response with status code 401.
So should I remove the authentication for the tests or shall I change the assertion to
assert response_get.status_code == 401

from hydrus.

chrizandr avatar chrizandr commented on June 2, 2024

Try reverting to before #88 and then running the tests.

As far as I know no major changes other than that were made.

from hydrus.

alohamora avatar alohamora commented on June 2, 2024

I reverted to before #88 but the tests were still failing.
But instead I changed the encoding format of the authentication header as follows:
self.auth_header = {"Authorization": "Basic " + b64encode(b"1:test").decode("ascii")}
and the byte string generated in the auth header matched with that generated while requesting through a web browser i.e. MTp0ZXN0 and then all the tests were passing.
@xadahiya @chrizandr comments on this approach??

from hydrus.

xadahiya avatar xadahiya commented on June 2, 2024

@alohamora this is fine, create a PR. This is actually how authentication works now. Nice work 👎

from hydrus.

xadahiya avatar xadahiya commented on June 2, 2024

Fixed in #115

from hydrus.

Related Issues (20)

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.