Skip to content

Commit 3c5cd5a

Browse files
authored
Merge pull request #269 from Police-Data-Accessibility-Project/mc_268_pdap_access_manager
feat(app): replace in-project access manager with `pdap_access_manager`
2 parents f913410 + b4326d6 commit 3c5cd5a

File tree

13 files changed

+224
-325
lines changed

13 files changed

+224
-325
lines changed

alembic/versions/2025_05_13_0704-864107b703ae_create_url_checked_for_duplicate_table.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def upgrade() -> None:
6363
def downgrade() -> None:
6464
op.drop_table('url_checked_for_duplicate')
6565

66+
# Delete tasks of type "Duplicate Detection"
67+
op.execute("DELETE FROM TASKS WHERE TASK_TYPE = 'Duplicate Detection';")
68+
6669
switch_enum_type(
6770
table_name='tasks',
6871
column_name='task_type',

api/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
from contextlib import asynccontextmanager
32

43
import aiohttp
@@ -28,7 +27,7 @@
2827
from html_tag_collector.RootURLCache import RootURLCache
2928
from html_tag_collector.URLRequestInterface import URLRequestInterface
3029
from hugging_face.HuggingFaceInterface import HuggingFaceInterface
31-
from pdap_api_client.AccessManager import AccessManager
30+
from pdap_access_manager import AccessManager
3231
from pdap_api_client.PDAPClient import PDAPClient
3332
from util.DiscordNotifier import DiscordPoster
3433

pdap_api_client/AccessManager.py

Lines changed: 0 additions & 159 deletions
This file was deleted.

pdap_api_client/DTOs.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from enum import Enum
2-
from http import HTTPStatus
32
from typing import Optional, List
43

54
from pydantic import BaseModel
@@ -20,57 +19,11 @@ class ApprovalStatus(Enum):
2019
PENDING = "pending"
2120
NEEDS_IDENTIFICATION = "needs identification"
2221

23-
24-
2522
class UniqueURLDuplicateInfo(BaseModel):
2623
original_url: str
2724
approval_status: ApprovalStatus
2825
rejection_note: Optional[str] = None
2926

30-
class UniqueURLResponseInfo(BaseModel):
31-
is_unique: bool
32-
duplicates: list[UniqueURLDuplicateInfo]
33-
34-
35-
class Namespaces(Enum):
36-
AUTH = "auth"
37-
MATCH = "match"
38-
CHECK = "check"
39-
DATA_SOURCES = "data-sources"
40-
SOURCE_COLLECTOR = "source-collector"
41-
42-
43-
class RequestType(Enum):
44-
POST = "POST"
45-
PUT = "PUT"
46-
GET = "GET"
47-
DELETE = "DELETE"
48-
49-
50-
class RequestInfo(BaseModel):
51-
type_: RequestType
52-
url: str
53-
json: Optional[dict] = None
54-
headers: Optional[dict] = None
55-
params: Optional[dict] = None
56-
timeout: Optional[int] = 10
57-
58-
def kwargs(self) -> dict:
59-
d = {
60-
"url": self.url,
61-
}
62-
if self.json is not None:
63-
d['json'] = self.json
64-
if self.headers is not None:
65-
d['headers'] = self.headers
66-
return d
67-
68-
69-
class ResponseInfo(BaseModel):
70-
status_code: HTTPStatus
71-
data: Optional[dict]
72-
73-
7427
class MatchAgencyResponse(BaseModel):
7528
status: MatchAgencyResponseStatus
7629
matches: List[MatchAgencyInfo]

0 commit comments

Comments
 (0)