-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #477 from sparcs-kaist/develop
Deploy v3.4.4
- Loading branch information
Showing
30 changed files
with
1,512 additions
and
1,098 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
DJANGO_ENV=development|production | ||
SECRET_KEY= | ||
# AWS S3 | ||
AWS_BUCKET_NAME= | ||
AWS_BUCKET_NAME_STATIC= | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
|
||
# SPARCS SSO | ||
SSO_CLIENT_ID= | ||
SSO_SECRET_KEY= | ||
PORTAL_ID= | ||
PORTAL_PASSWORD= | ||
PORTAL_2FA_KEY=/[2-7A-Z]{16}/ | ||
DOCKERHUB_USERNAME= | ||
DOCKERHUB_PASSWORD= | ||
SENTRY_DSN= | ||
|
||
# Django | ||
DJANGO_ENV=development | ||
SECRET_KEY= | ||
|
||
# MySQL | ||
NEWARA_DB_HOST=127.0.0.1 | ||
NEWARA_DB_PORT=3306 | ||
NEWARA_DB_USER=root | ||
NEWARA_DB_PASSWORD= | ||
NEWARA_DB_NAME= | ||
|
||
# Redis | ||
NEWARA_REDIS_ADDRESS=127.0.0.1 | ||
NEWARA_REDIS_PORT=6379 | ||
|
||
# Celery | ||
C_FORCE_ROOT=true | ||
|
||
# Elasticsearch | ||
NEWARA_ELASTICSEARCH_HOST=127.0.0.1 | ||
NEWARA_ELASTICSEARCH_PORT=9200 | ||
|
||
# Logging | ||
LOG_FILE_PATH=logs/http_access.log | ||
|
||
# KAIST portal | ||
PORTAL_JSESSIONID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class AuthLoggedInUser: | ||
# TODO | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
from enum import IntEnum, unique | ||
|
||
|
||
@unique | ||
class HttpStatusCode(IntEnum): | ||
CONTINUE = 100 | ||
SWITCHING_PROTOCOLS = 101 | ||
OK = 200 | ||
CREATED = 201 | ||
ACCEPTED = 202 | ||
NON_AUTHORITATIVE_INFORMATION = 203 | ||
NO_CONTENT = 204 | ||
RESET_CONTENT = 205 | ||
PARTIAL_CONTENT = 206 | ||
MULTI_STATUS = 207 | ||
ALREADY_REPORTED = 208 | ||
IM_USED = 226 | ||
MULTIPLE_CHOICES = 300 | ||
MOVED_PERMANENTLY = 301 | ||
FOUND = 302 | ||
SEE_OTHER = 303 | ||
NOT_MODIFIED = 304 | ||
USE_PROXY = 305 | ||
RESERVED = 306 | ||
TEMPORARY_REDIRECT = 307 | ||
PERMANENT_REDIRECT = 308 | ||
BAD_REQUEST = 400 | ||
UNAUTHORIZED = 401 | ||
PAYMENT_REQUIRED = 402 | ||
FORBIDDEN = 403 | ||
NOT_FOUND = 404 | ||
METHOD_NOT_ALLOWED = 405 | ||
NOT_ACCEPTABLE = 406 | ||
PROXY_AUTHENTICATION_REQUIRED = 407 | ||
REQUEST_TIMEOUT = 408 | ||
CONFLICT = 409 | ||
GONE = 410 | ||
LENGTH_REQUIRED = 411 | ||
PRECONDITION_FAILED = 412 | ||
REQUEST_ENTITY_TOO_LARGE = 413 | ||
REQUEST_URI_TOO_LONG = 414 | ||
UNSUPPORTED_MEDIA_TYPE = 415 | ||
REQUESTED_RANGE_NOT_SATISFIABLE = 416 | ||
EXPECTATION_FAILED = 417 | ||
IM_A_TEAPOT = 418 | ||
UNPROCESSABLE_ENTITY = 422 | ||
LOCKED = 423 | ||
FAILED_DEPENDENCY = 424 | ||
UPGRADE_REQUIRED = 426 | ||
PRECONDITION_REQUIRED = 428 | ||
TOO_MANY_REQUESTS = 429 | ||
REQUEST_HEADER_FIELDS_TOO_LARGE = 431 | ||
UNAVAILABLE_FOR_LEGAL_REASONS = 451 | ||
INTERNAL_SERVER_ERROR = 500 | ||
NOT_IMPLEMENTED = 501 | ||
BAD_GATEWAY = 502 | ||
SERVICE_UNAVAILABLE = 503 | ||
GATEWAY_TIMEOUT = 504 | ||
HTTP_VERSION_NOT_SUPPORTED = 505 | ||
VARIANT_ALSO_NEGOTIATES = 506 | ||
INSUFFICIENT_STORAGE = 507 | ||
LOOP_DETECTED = 508 | ||
BANDWIDTH_LIMIT_EXCEEDED = 509 | ||
NOT_EXTENDED = 510 | ||
NETWORK_AUTHENTICATION_REQUIRED = 511 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import Any | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class PaginatedData(BaseModel): | ||
count: int | ||
next: str | None | ||
previous: str | None | ||
results: list[Any] | ||
|
||
|
||
class NesAraPagination: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from typing import TypeVar | ||
|
||
from django.contrib.auth import get_user_model | ||
from django.http import HttpRequest | ||
|
||
User = TypeVar("User", bound=get_user_model()) | ||
|
||
|
||
class LoggedInUserRequest(HttpRequest): | ||
user: User |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from http import HTTPStatus | ||
from typing import Any, NamedTuple | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class AraResponse(NamedTuple): | ||
status_code: HTTPStatus | ||
data: Any | ||
|
||
|
||
class AraErrorResponseBody(BaseModel): | ||
# necessary | ||
error_code: int | None | ||
error_reason: str = "" | ||
|
||
def __init__(self, exception: Exception): | ||
message = str(exception) | ||
# TODO: Create AraException and use error_code & error_reason | ||
data = {"message": message} | ||
super().__init__(**data) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from typing import Any | ||
|
||
from pydantic import BaseModel, PrivateAttr | ||
|
||
|
||
class AraEntity(BaseModel): | ||
_updated_fields: set[str] = PrivateAttr(set()) | ||
|
||
@property | ||
def updated_fields(self): | ||
return self._updated_fields | ||
|
||
@property | ||
def updated_values(self) -> dict[str, Any]: | ||
return {key: getattr(self, key) for key in self._updated_fields} | ||
|
||
def set_attribute(self, field_name: str, value: Any): | ||
self.__dict__[field_name] = value | ||
is_private_field = field_name.startswith("_") or field_name.startswith("__") | ||
if is_private_field is False: | ||
self._updated_fields.add(field_name) | ||
|
||
def __setattr__(self, name: str, value: Any) -> None: | ||
is_private_field = name.startswith("_") or name.startswith("__") | ||
if is_private_field is False: | ||
self._updated_fields.add(name) | ||
return super().__setattr__(name, value) | ||
|
||
class Config: | ||
arbitrary_types_allowed = True | ||
|
||
|
||
class AraEntityCreateInput(BaseModel): | ||
class Config: | ||
arbitrary_types_allowed = True |
Empty file.
Oops, something went wrong.