• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CenterForOpenScience / SHARE / 14839804620

05 May 2025 03:11PM UTC coverage: 79.141% (-12.6%) from 91.745%
14839804620

push

github

web-flow
Merge pull request #859 from CenterForOpenScience/release/25.2.0

Release/25.2.0 share cleanupgrade (milestone 1: simplify)

147 of 204 new or added lines in 33 files covered. (72.06%)

984 existing lines in 69 files now uncovered.

6101 of 7709 relevant lines covered (79.14%)

1.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

64.29
/api/authentication.py
1
from rest_framework.authentication import SessionAuthentication
2✔
2
from oauth2_provider.contrib.rest_framework import OAuth2Authentication
2✔
3

4

5
class NonCSRFSessionAuthentication(SessionAuthentication):
2✔
6
    def authenticate(self, request):
2✔
7
        """
8
        Returns a `User` if the request session currently has a logged in user.
9
        Otherwise returns `None`.
10
        """
11

12
        # Get the session-based user from the underlying HttpRequest object
13
        user = getattr(request._request, 'user', None)
2✔
14

15
        # Unauthenticated, CSRF validation not required
16
        if not user or not user.is_active:
2✔
17
            return None
2✔
18

19
        # self.enforce_csrf(request)
20

21
        # CSRF passed with authenticated user
22
        return (user, None)
×
23

24

25
class APIV1TokenBackPortAuthentication(OAuth2Authentication):
2✔
26

27
    def authenticate(self, request):
2✔
UNCOV
28
        token = request.META.get('HTTP_AUTHORIZATION')
×
UNCOV
29
        if token and isinstance(token, str):
×
UNCOV
30
            request.META['HTTP_AUTHORIZATION'] = token.replace('Token', 'Bearer')
×
UNCOV
31
        return super().authenticate(request)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc