Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions DEVELOPMENT.md

This file was deleted.

21 changes: 0 additions & 21 deletions lib/id3c/api/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,6 @@ def login(username: str, password: str) -> DatabaseSession:
raise AuthenticationRequired() from None


@export
@catch_permission_denied
def store_enrollment(session: DatabaseSession, document: str) -> None:
"""
Store the given enrollment JSON *document* (a **string**) in the backing
database using *session*.

Raises a :class:`BadRequestDatabaseError` exception if the given *document*
isn't valid and a :class:`Forbidden` exception if the database reports a
`permission denied` error.
"""
with session, session.cursor() as cursor:
try:
cursor.execute(
"INSERT INTO receiving.enrollment (document) VALUES (%s)",
(document,))

except (DataError, IntegrityError) as error:
raise BadRequestDatabaseError(error) from None


@export
@catch_permission_denied
def store_presence_absence(session: DatabaseSession, document: str) -> None:
Expand Down
22 changes: 0 additions & 22 deletions lib/id3c/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,6 @@ def index():
return send_file("static/index.html", "text/html; charset=UTF-8")


@api_v1.route("/receiving/enrollment", methods = ['POST'])
@api_unversioned.route("/enrollment", methods = ['POST'])
@content_types_accepted(["application/json"])
@check_content_length
@authenticated_datastore_session_required
def receive_enrollment(*, session):
"""
Receive a new enrollment document.

POST /enrollment with a JSON body. Note that we don't actually need to
parse the JSON body. The body is passed directly to the database which
will check its validity.
"""
document = request.get_data(as_text = True)

LOG.debug(f"Received enrollment")

datastore.store_enrollment(session, document)

return "", 204


@api_v1.route("/receiving/presence-absence", methods = ['POST'])
@api_unversioned.route("/presence-absence", methods = ['POST'])
@content_types_accepted(["application/json"])
Expand Down
11 changes: 7 additions & 4 deletions lib/id3c/api/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ <h2>Status codes</h2>

<h2>Routes</h2>

<h3 class="code">POST /v1/receiving/enrollment</h3>
<p>Stores the request data as an enrollment document in a receiving area of
the study database. Accepts any JSON object.

<h3 class="code">POST /v1/receiving/presence-absence</h3>
<p>Stores the request data as presence/absence calls in a receiving area of
the study database. Accepts any JSON object.
Expand Down Expand Up @@ -113,5 +109,12 @@ <h3 class="code">POST /sequence-read-set</h3>
]
}</pre>

<h2>Deprecated Routes</h2>
<p>
These routes are no longer supported.
</p>

<h3 class="code">POST /v1/receiving/enrollment</h3>

</body>
</html>
2 changes: 0 additions & 2 deletions lib/id3c/cli/command/etl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ def etl():

# Load all ETL subcommands.
__all__ = [
"enrollments",
"manifest",
"presence_absence",
"kit",
"consensus_genome",
"redcap_det",
"fhir",
Expand Down
Loading