Island: Remove from_credentials in StolenCredentials model
This commit is contained in:
parent
e5702032d9
commit
2ad2d94746
|
@ -3,7 +3,6 @@ from __future__ import annotations
|
|||
from mongoengine import Document, ListField, ReferenceField
|
||||
|
||||
from monkey_island.cc.models import Monkey
|
||||
from monkey_island.cc.services.telemetry.processing.credentials import Credentials
|
||||
|
||||
|
||||
class StolenCredentials(Document):
|
||||
|
@ -20,12 +19,3 @@ class StolenCredentials(Document):
|
|||
monkey = ReferenceField(Monkey)
|
||||
identities = ListField()
|
||||
secrets = ListField()
|
||||
|
||||
@staticmethod
|
||||
def from_credentials(credentials: Credentials) -> StolenCredentials:
|
||||
stolen_creds = StolenCredentials()
|
||||
|
||||
stolen_creds.secrets = [secret["credential_type"] for secret in credentials.secrets]
|
||||
stolen_creds.identities = credentials.identities
|
||||
stolen_creds.monkey = Monkey.get_single_monkey_by_guid(credentials.monkey_guid).id
|
||||
return stolen_creds
|
||||
|
|
Loading…
Reference in New Issue