-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweaks to new citation lookup tool #3924
Comments
Second, looks like we didn't do any auth. It should use the same auth as other areas of the API at least at first, though we may want to tighten it down the road, if performance is an issue. |
I tossed a really big blob of text at it and got this: Sentry Issue: COURTLISTENER-6ZF |
@mlissner It seems like Eyecite was able to identify the reporter and page number in a citation but could not extract the volume. The citation object is:
should we ignore this citation in the response? or should we include it with an error message? |
Interesting. This fails too:
But the front end looks fine: |
I tried "Shapiro v. Thompson, 394 U. S. 618" in the web citation tool and it's also failing. 🤔 |
APIs, man, they never fail to find problems in other places! Good news, we get to fix both! |
COURTLISTENER-6ZE is fixed: |
Let's not forget here that we also need to add auth to this endpoint before anybody can start using it. Want to suggest something, @ERosendo? |
@mlissner You're right. We can add auth to this endpoint using two approaches: Option 1: Simple Authentication The IsAuthenticated class provides a simple way to restrict access to this endpoint. Users only need to include the authentication token found in their profile's developer tab within their request. This ensures only registered users can access the tool. Option 2: Granular Permissions We use a custom class inheriting from DjangoModelPermissions. This approach offers finer control over who can access the endpoint because it allows us to define specific user permissions that grant access. However, users would need to request API access beforehand, and permissions are assigned manually through the admin interface. We're using this approach for some endpoints like the one to retrieve/list docket entries(the RECAPUsersReadOnly class uses the Let me know what you think |
Simple auth seems fine. What about throttling? |
Considering that users can send large payloads, I believe that the |
I was thinking more about a throttle_class: https://www.django-rest-framework.org/api-guide/throttling/. We'll need more than 2/m though. Maybe what we really need are citations/s. I don't care how much empty text you send at me. I care how many citations I have to look up. It looks like making a custom throttle to do that should be pretty easy using DRF, if you look at the But assuming we can pull that off, how many do we want people to be able to look up per second? I'm not sure. I think these queries are very well optimized. Maybe 1/s? |
First, I just tried clicking here:
https://www.courtlistener.com/api/rest/v3/citation-lookup/
And got a crash: COURTLISTENER-6ZE
The text was updated successfully, but these errors were encountered: