Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

BUG: dictionary/package doesnt work anymore #1312

Closed rem0g closed 1 week ago

rem0g commented 1 month ago

https://signbank.cls.ru.nl/dictionary/package/?dataset_name=NGT&extended_fields=true&since_timestamp=1704067200

I am getting error message when trying to access the URL:

TypeError at /dictionary/package/
Field 'id' expected a number but got <SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x77719b046180>>.

Has something changed to GET dictionary/package/ ?

susanodd commented 1 month ago

The API checks were moved to match the other API urls to look for the Bearer. #1278 #1279

rem0g commented 1 month ago

It doesnt seem it looks to API Bearer. When logged in with cookie it does work again, guess my cookies were expired.

Can you confirm if it looks to Bearer Authorization or not?

susanodd commented 1 month ago

@vanlummelhuizen implemented the new permission check.

It could be that your cookie was deleted. @Woseseltops discovered that there was an extreme amount of sessions data being stored in the database by Django. He deleted this in order to reduce the size. He implemented a tool for using Amazon for the pull requst branches. So he reduced the size of the database for that because it creates a new temporary signbank on Amazon for the pull request.)

susanodd commented 1 month ago

It doesnt seem it looks to API Bearer. When logged in with cookie it does work again, guess my cookies were expired.

Can you confirm if it looks to Bearer Authorization or not?

No, it's still as it was.

I think the package got delayed for adding the Bearer to it because it's also used by MPI.

Although since the sessions are being deleted, I don't know what the plans are with that. I think @vanlummelhuizen suggested to delete them in a cron job every so often. (It was circa 50% of the database.)

Woseseltops commented 1 month ago

Indeed my database cleanup action might have erased your cookie @rem0g . The ideal solution would be to switch to the token approach. @susanodd , could you implement it so we support both the old and new approach for this endpoint?

rem0g commented 1 month ago

That would be nice to have! Thank you.