Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
There is a single class of interest in this project: Replacer
.
It is an object for replacing strings with other strings in json-like objects.
The initializer takes a list of assignments, each of which is a dictionary containing a name
, a type
, and optionally args
and kwargs
.
There are currently 6 implemented types:
identity
: returns the argument passed to it.localfile
: passes the args
and kwargs
to open
and then reads the file object. The mode is always 'r'.fsspec
: passes the args
and kwargs
to fsspec.open
, opens that, and reads. The mode is always 'r'. Requires fsspec to be installed. fsspec has multiple protocols installed, e.g. http(s), (s)ftp and zip. This can also be used for data on S3, if s3fs is installed.awssecret
: takes two arguments: region_name
and secret_id
. Uses boto to call secretsmanager, and returns the returned SecretString
.env
: takes two arguments: name
, and optionally a default
value. If the environment variable doesn't exist and no default value was passed, an AssertionError will be raised.base64uuid4
: the base64 (the url safe "-_" variant) of a uuid.uuid4
call. Use this to create a unique id that can be used in multiple derived replacements.Example:
Replacer([{
"name": "name",
"type": "identity",
"args": ["World"]
}])("Hello, ${name}!")
returns "Hello, World!"
There can be dependencies between the assignments. They are resolved linearly using the list order:
Replacer([
{
"name": "name",
"type": "identity",
"args": ["World"]
},
{
"name": "greeting",
"type": "identity",
"args": ["Hello, ${name}!"]
}
])("${greeting}")
also returns "Hello, World!"
FAQs
Replace strings with other strings
We found that replacements 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.