Exemple #1
0
 class Meta:
     always_return_data = True
     authorization = authorization.Authorization()
     authentication = authentication.MultiAuthentication(
         authentication.SessionAuthentication(),
         authentication.ApiKeyAuthentication(),
     )
     list_allowed_methods = ['get', 'put', 'post', 'delete']
     detail_allowed_methods = ['get', 'put', 'post', 'delete']
     filter_fields = [
         'status',
         'due',
         'entry',
         'id',
         'imask',
         'modified',
         'parent',
         'recur',
         'status',
         'urgency',
         'uuid',
         'wait',
     ]
     limit = 100
     max_limit = 400
Exemple #2
0
 class Meta:
     authentication = authentication.MultiAuthentication(
         BasicAuthenticationWithUser(realm="courtlistener.com"),
         authentication.SessionAuthentication())
     throttle = PerUserCacheThrottle(throttle_at=1000)
     resource_name = 'document'
     queryset = Document.objects.all().select_related('docket', 'citation')
     max_limit = 20
     allowed_methods = ['get']
     include_absolute_url = True
     excludes = ['is_stub_document', 'cases_cited']
     filtering = {
         'id': ('exact', ),
         'time_retrieved': good_time_filters,
         'date_modified': good_time_filters,
         'date_filed': good_date_filters,
         'sha1': ('exact', ),
         'citation': ALL,
         'citation_count': numerical_filters,
         'precedential_status': ('exact', 'in'),
         'date_blocked': good_date_filters,
         'blocked': ALL,
         'extracted_by_ocr': ALL,
         'supreme_court_db_id': ('exact', ),
     }
     ordering = [
         'time_retrieved', 'date_modified', 'date_filed', 'date_blocked'
     ]
Exemple #3
0
 class Meta:
     authentication = authentication.MultiAuthentication(
         BasicAuthenticationWithUser(realm="courtlistener.com"),
         authentication.SessionAuthentication())
     throttle = PerUserCacheThrottle(throttle_at=1000)
     resource_name = 'jurisdiction'
     queryset = Court.objects.exclude(jurisdiction='T')
     max_limit = 1000
     allowed_methods = ['get']
     filtering = {
         'id': ('exact', ),
         'date_modified': good_time_filters,
         'in_use': ALL,
         'has_opinion_scraper': ALL,
         'has_oral_argument_scraper': ALL,
         'position': numerical_filters,
         'short_name': ALL,
         'full_name': ALL,
         'url': ALL,
         'start_date': good_date_filters,
         'end_date': good_date_filters,
         'jurisdictions': ALL,
     }
     ordering = [
         'date_modified', 'start_date', 'end_date', 'position',
         'jurisdiction'
     ]
Exemple #4
0
 class Meta:
     authentication = authentication.MultiAuthentication(
         BasicAuthenticationWithUser(realm="courtlistener.com"),
         authentication.SessionAuthentication())
     throttle = PerUserCacheThrottle(throttle_at=1000)
     resource_name = 'search'
     max_limit = 20
     include_absolute_url = True
     allowed_methods = ['get']
     filtering = {
         'q': ('search', ),
         'case_name': ('search', ),
         'judge': ('search', ),
         'stat_': ('boolean', ),
         'filed_after': ('date', ),
         'filed_before': ('date', ),
         'argued_after': ('date', ),
         'argued_before': ('date', ),
         'citation': ('search', ),
         'neutral_cite': ('search', ),
         'docket_number': ('search', ),
         'cited_gt': ('int', ),
         'cited_lt': ('int', ),
         'court': ('csv', ),
         'type': ('search', ),
     }
     ordering = [
         'dateFiled+desc',
         'dateFiled+asc',
         'dateArgued+desc',
         'dateArgued+asc',
         'citeCount+desc',
         'citeCount+asc',
         'score+desc',
     ]
Exemple #5
0
 class Meta:
     queryset = models.TestRun.objects.all()
     resource_name = 'testruns'
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
 class Meta:
     queryset = Store.objects.all()
     resource_name = 'store'
     authentication = authentication.MultiAuthentication(
         ReadOnlyAuthentication(),
         authentication.SessionAuthentication(),
     )
     authorization = authorization.DjangoAuthorization()
Exemple #7
0
 class Meta:
     authentication = authentication.MultiAuthentication(
         BasicAuthenticationWithUser(realm="courtlistener.com"),
         authentication.SessionAuthentication())
     throttle = PerUserCacheThrottle(throttle_at=1000)
     queryset = Citation.objects.all()
     max_limit = 20
     excludes = [
         'slug',
     ]  # Why?
Exemple #8
0
 class Meta:
     always_return_data = True
     queryset = User.objects.all()
     authorization = UserAuthorization()
     list_allowed_methods = ['get']
     detail_allowed_methods = ['get']
     authentication = authentication.MultiAuthentication(
         authentication.ApiKeyAuthentication(),
         authentication.SessionAuthentication(),
     )
Exemple #9
0
class BaseMeta:
    """
    Use the same authentication and authorization mechanism on all resources.
    """
    authentication = authentication.MultiAuthentication(
        authentication.ApiKeyAuthentication(),
        authentication.Authentication(),
    )
    authorization = DjangoAuthorization()
    serializer = Serializer()
Exemple #10
0
 class Meta:
     queryset = models.ConfigIngredient.objects.all()
     filtering = {
         'name': ALL,
     }
     resource_name = 'ingredients'
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
Exemple #11
0
 class Meta:
     queryset = models.Release.objects.select_related('build').all()
     resource_name = 'releases'
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
     filtering = {
         'build': ALL_WITH_RELATIONS,
     }
Exemple #12
0
 class Meta:
     queryset = models.BuildPack.objects.all()
     resource_name = 'buildpacks'
     filtering = {
         'repo_url': ALL,
         'repo_type': ALL,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
Exemple #13
0
 class Meta:
     queryset = models.Squad.objects.all()
     resource_name = 'squads'
     filtering = {
         'hosts': ALL_WITH_RELATIONS,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
     detail_uri_name = 'name'
Exemple #14
0
 class Meta:
     queryset = models.OSStack.objects.all()
     resource_name = 'stacks'
     filtering = {
         'id': ALL,
         'name': ALL,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
     detail_uri_name = 'name'
Exemple #15
0
 class Meta:
     queryset = models.Host.objects.select_related('squad').all()
     resource_name = 'hosts'
     filtering = {
         'name': ALL,
         'active': ALL,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
     detail_uri_name = 'name'
Exemple #16
0
 class Meta:
     queryset = User.objects.all()
     resource_name = 'user'
     excludes = [
         'email', 'password', 'is_active', 'is_staff', 'is_superuser'
     ]
     filtering = {
         'username': ALL,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
Exemple #17
0
 class Meta:
     queryset = models.DeploymentLogEntry.objects.all()
     resource_name = 'logs'
     filtering = {
         'type': ALL,
         'time': ALL,
         'user': ALL_WITH_RELATIONS,
         'message': ALL,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
Exemple #18
0
 class Meta:
     authentication = authentication.MultiAuthentication(
         BasicAuthenticationWithUser(realm="courtlistener.com"),
         authentication.SessionAuthentication())
     throttle = PerUserCacheThrottle(throttle_at=1000)
     resource_name = 'cited-by'
     queryset = Document.objects.all()
     excludes = ('is_stub_document', 'html', 'html_lawbox',
                 'html_with_citations', 'plain_text')
     include_absolute_url = True
     max_limit = 20
     list_allowed_methods = ['get']
     detail_allowed_methods = []
     filtering = {
         'id': ('exact', ),
     }
Exemple #19
0
 class Meta:
     queryset = models.App.objects.select_related('buildpack',
                                                  'stack').all()
     resource_name = 'apps'
     filtering = {
         'id': ALL,
         'name': ALL,
         'buildpack': ALL_WITH_RELATIONS,
         'stack': ALL_WITH_RELATIONS,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()
     detail_uri_name = 'name'
Exemple #20
0
    class Meta:
        authentication = authentication.MultiAuthentication(
            BasicAuthenticationWithUser(realm="courtlistener.com"),
            authentication.SessionAuthentication())

        throttle = PerUserCacheThrottle(throttle_at=1000)
        resource_name = 'docket'
        queryset = Docket.objects.all()
        max_limit = 20
        allowed_methods = ['get']
        include_absolute_url = True
        filtering = {
            'id': ('exact', ),
            'date_modified': good_time_filters,
            'court': ('exact', ),
            'date_blocked': good_date_filters,
            'blocked': ALL,
        }
        ordering = ['date_modified', 'date_blocked']
Exemple #21
0
 class Meta:
     resource_name = 'activitylog'
     queryset = models.TaskStoreActivityLog.objects.order_by('-last_seen')
     authorization = TaskStoreAuthorization()
     list_allowed_methods = ['get']
     detail_allowed_methods = ['get']
     authentication = authentication.MultiAuthentication(
         authentication.ApiKeyAuthentication(),
         authentication.SessionAuthentication(),
     )
     filter_fields = [
         'last_seen',
         'created',
         'error',
         'message',
         'count'
     ]
     limit = 100
     max_limit = 400
Exemple #22
0
 class Meta:
     queryset = models.Swarm.objects.select_related(
         'app', 'squad', 'release').prefetch_related(
             'config_ingredients',
             'squad__hosts',
             'release__build',
             'release__build__app',
         ).all()
     resource_name = 'swarms'
     filtering = {
         'ingredients': ALL_WITH_RELATIONS,
         'squad': ALL_WITH_RELATIONS,
         'app': ALL_WITH_RELATIONS,
         'proc_name': ALL,
         'config_name': ALL,
         'pool': ALL,
     }
     authentication = auth.MultiAuthentication(
         auth.BasicAuthentication(),
         auth.SessionAuthentication(),
     )
     authorization = Authorization()