Skip to content

Commit

Permalink
Pull naming in line
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkst-pieter committed Nov 19, 2024
1 parent 65da710 commit 342ad3d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions canarytokens/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def check_process_name(value: str):
return value


class FakeWindowsFSTokenRequest(TokenRequest):
class WindowsFakeFSTokenRequest(TokenRequest):
token_type: Literal[TokenTypes.WINDOWS_FAKE_FS] = TokenTypes.WINDOWS_FAKE_FS
windows_fake_fs_root: str
windows_fake_fs_file_structure: str
Expand Down Expand Up @@ -802,7 +802,7 @@ class CreditCardV2TokenRequest(TokenRequest):
CCTokenRequest,
PWATokenRequest,
CMDTokenRequest,
FakeWindowsFSTokenRequest,
WindowsFakeFSTokenRequest,
FastRedirectTokenRequest,
QRCodeTokenRequest,
AWSKeyTokenRequest,
Expand Down Expand Up @@ -901,7 +901,7 @@ class CMDTokenResponse(TokenResponse):
reg_file: str


class FakeWindowsFSTokenResponse(TokenResponse):
class WindowsFakeFSTokenResponse(TokenResponse):
token_type: Literal[TokenTypes.WINDOWS_FAKE_FS] = TokenTypes.WINDOWS_FAKE_FS
powershell_file: str

Expand Down Expand Up @@ -1128,7 +1128,7 @@ class CreditCardV2TokenResponse(TokenResponse):
CCTokenResponse,
PWATokenResponse,
CMDTokenResponse,
FakeWindowsFSTokenResponse,
WindowsFakeFSTokenResponse,
CustomImageTokenResponse,
SMTPTokenResponse,
SvnTokenResponse,
Expand Down Expand Up @@ -1660,7 +1660,7 @@ class CMDTokenHit(TokenHit):
token_type: Literal[TokenTypes.CMD] = TokenTypes.CMD


class FakeWindowsFSTokenHit(TokenHit):
class WindowsFakeFSTokenHit(TokenHit):
token_type: Literal[TokenTypes.WINDOWS_FAKE_FS] = TokenTypes.WINDOWS_FAKE_FS


Expand Down Expand Up @@ -1806,7 +1806,7 @@ class LegacyTokenHit(TokenHit):
CCTokenHit,
PWATokenHit,
CMDTokenHit,
FakeWindowsFSTokenHit,
WindowsFakeFSTokenHit,
DNSTokenHit,
AWSKeyTokenHit,
AzureIDTokenHit,
Expand Down Expand Up @@ -1948,9 +1948,9 @@ class CMDTokenHistory(TokenHistory[CMDTokenHit]):
hits: List[CMDTokenHit]


class FakeWindowsFSTokenHistory(TokenHistory[FakeWindowsFSTokenHit]):
class WindowsFakeFSTokenHistory(TokenHistory[WindowsFakeFSTokenHit]):
token_type: Literal[TokenTypes.WINDOWS_FAKE_FS] = TokenTypes.WINDOWS_FAKE_FS
hits: List[FakeWindowsFSTokenHit]
hits: List[WindowsFakeFSTokenHit]


class SlowRedirectTokenHistory(TokenHistory[SlowRedirectTokenHit]):
Expand Down Expand Up @@ -2061,7 +2061,7 @@ class LegacyTokenHistory(TokenHistory[LegacyTokenHit]):
CCTokenHistory,
PWATokenHistory,
CMDTokenHistory,
FakeWindowsFSTokenHistory,
WindowsFakeFSTokenHistory,
DNSTokenHistory,
AWSKeyTokenHistory,
AzureIDTokenHistory,
Expand Down Expand Up @@ -2542,7 +2542,7 @@ class DownloadCMDRequest(TokenDownloadRequest):
fmt: Literal[DownloadFmtTypes.CMD] = DownloadFmtTypes.CMD


class DownloadFakeWindowsFSRequest(TokenDownloadRequest):
class DownloadWindowsFakeFSRequest(TokenDownloadRequest):
fmt: Literal[DownloadFmtTypes.WINDOWS_FAKE_FS] = DownloadFmtTypes.WINDOWS_FAKE_FS


Expand Down Expand Up @@ -2573,7 +2573,7 @@ class DownloadCreditCardV2Request(TokenDownloadRequest):
DownloadAzureIDCertRequest,
DownloadCCRequest,
DownloadCMDRequest,
DownloadFakeWindowsFSRequest,
DownloadWindowsFakeFSRequest,
DownloadCSSClonedWebRequest,
DownloadIncidentListCSVRequest,
DownloadIncidentListJsonRequest,
Expand Down Expand Up @@ -2691,7 +2691,7 @@ class DownloadCMDResponse(TokenDownloadResponse):
auth: str


class DownloadFakeWindowsFSResponse(TokenDownloadResponse):
class DownloadWindowsFakeFSResponse(TokenDownloadResponse):
contenttype: Literal[
DownloadContentTypes.TEXTPLAIN
] = DownloadContentTypes.TEXTPLAIN
Expand Down
20 changes: 10 additions & 10 deletions frontend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
DownloadCSSClonedWebResponse,
CMDTokenRequest,
CMDTokenResponse,
FakeWindowsFSTokenRequest,
FakeWindowsFSTokenResponse,
WindowsFakeFSTokenRequest,
WindowsFakeFSTokenResponse,
CreditCardV2TokenRequest,
CreditCardV2TokenResponse,
CustomBinaryTokenRequest,
Expand All @@ -82,8 +82,8 @@
DownloadCCResponse,
DownloadCMDRequest,
DownloadCMDResponse,
DownloadFakeWindowsFSRequest,
DownloadFakeWindowsFSResponse,
DownloadWindowsFakeFSRequest,
DownloadWindowsFakeFSResponse,
DownloadCreditCardV2Request,
DownloadCreditCardV2Response,
DownloadIncidentListCSVRequest,
Expand Down Expand Up @@ -1013,10 +1013,10 @@ def _(

@create_download_response.register
def _(
download_request_details: DownloadFakeWindowsFSRequest, canarydrop: Canarydrop
) -> DownloadFakeWindowsFSResponse:
download_request_details: DownloadWindowsFakeFSRequest, canarydrop: Canarydrop
) -> DownloadWindowsFakeFSResponse:
""""""
return DownloadFakeWindowsFSResponse(
return DownloadWindowsFakeFSResponse(
token=download_request_details.token,
auth=download_request_details.auth,
content=windows_fake_fs.make_windows_fake_fs(
Expand Down Expand Up @@ -1650,14 +1650,14 @@ def _(

@create_response.register
def _(
token_request_details: FakeWindowsFSTokenRequest, canarydrop: Canarydrop
) -> FakeWindowsFSTokenResponse:
token_request_details: WindowsFakeFSTokenRequest, canarydrop: Canarydrop
) -> WindowsFakeFSTokenResponse:
canarydrop.windows_fake_fs_root = token_request_details.windows_fake_fs_root
canarydrop.windows_fake_fs_file_structure = (
token_request_details.windows_fake_fs_file_structure
)
queries.save_canarydrop(canarydrop=canarydrop)
return FakeWindowsFSTokenResponse(
return WindowsFakeFSTokenResponse(
email=canarydrop.alert_email_recipient or "",
webhook_url=canarydrop.alert_webhook_url
if canarydrop.alert_webhook_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<script setup lang="ts">
import { downloadAsset } from '@/api/main';
type FakeWindowsFSDataType = {
type WindowsFakeFSDataType = {
auth: string;
token: string;
};
const props = defineProps<{
tokenData: FakeWindowsFSDataType;
tokenData: WindowsFakeFSDataType;
}>();
async function handleDownloadMSregistryFile() {
Expand Down

0 comments on commit 342ad3d

Please sign in to comment.