Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Faux Sures provides a heavily typed system with immediate validation checks to provide a tactile experience while exploring complex domain logic. Faux Sures is designed for use in a python shell, a notebook, or a short script. The self evaluating Fields system triggers everytime you set an attribute on a model, giving you guardrails while you play around with data. All while encapsulating logic in the Model definition itself
In [5]: from faux_sures import not_db
In [6]: from faux_sures.recipes.curries import in_range
In [7]: class Student(not_db.Model):
...: first_name = not_db.Field(str)
...: last_name = not_db.Field(str)
...: age = not_db.Field(int, in_range(14, 19))
...:
...: name_constraint = not_db.UniqueTogetherRestraint(("first_name", "last_name"))
...:
In [8]: arjun = Student()
In [9]: arjun.age = "13"
---------------------------------------------------------------------------
TypeFieldRequirementException Traceback (most recent call last)
<ipython-input-9-0a7edcc14936> in <module>
----> 1 arjun.age = "13"
~/Documents/code/faux_sures/faux_sures/not_db.py in __set__(self, instance, value)
79 pass
80 elif not isinstance(value, self._type):
---> 81 raise TypeFieldRequirementException(
82 f"{self.name!r} values must one of types {self._type!r} not {type(value)}"
83 )
TypeFieldRequirementException: 'age' values must one of types <class 'int'> not <class 'str'>
In [10]: arjun.age = 13
---------------------------------------------------------------------------
ValidatorFieldRequirementException Traceback (most recent call last)
<ipython-input-10-65acbd50e86f> in <module>
----> 1 arjun.age = 13
~/Documents/code/faux_sures/faux_sures/not_db.py in __set__(self, instance, value)
85 for validator in self.validators:
86 if validator(value) is False:
---> 87 raise ValidatorFieldRequirementException(f"{self.name} failed to validate {validator.__name__}")
88 instance.__dict__[self.name] = value
89
ValidatorFieldRequirementException: age failed to validate in_range_14_to_19
In [11]: arjun.age = 17
In [12]: arjun.age
Out[12]: 17
pip install faux-sures==0.0.1
FAQs
A REPL for fast Model ProtoTyping
We found that faux-sures demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.