
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Parse varying urls with PublicSuffix the easy way.
The PublicSuffix gem works great if you give it nice, clean urls WITHOUT a transfer protocol. But what if your application has one (or multiple) urls with or without protocols?
LazyDomain assumes it could be either way and uses URI to make up the difference. Because URI can only parse a url WITH a protocol, Lazy Domain automatically adds 'http://' if it is not already present in a url. Now, you can easily use PublicSuffix for varying urls.
$ gem install lazy_domain
Because LazyDomain is simply a wrapper for PublicSuffix, the usage is exactly the same.
Example domain without subdomains.
domain = LazyDomain.parse("google.com")
# => #<PublicSuffix::Domain>
domain.tld
# => "com"
domain.sld
# => "google"
domain.trd
# => nil
domain.domain
# => "google.com"
domain.subdomain
# => nil
Example domain with subdomains.
domain = LazyDomain.parse("www.google.com")
# => #<PublicSuffix::Domain>
domain.tld
# => "com"
domain.sld
# => "google"
domain.trd
# => "www"
domain.domain
# => "google.com"
domain.subdomain
# => "www.google.com"
Simple validation example.
LazyDomain.valid?("google.com")
# => true
LazyDomain.valid?("www.google.com")
# => true
LazyDomain.valid?("x.yz")
# => false
You can do everything mentioned above, but the magic of LazyDomain is you can now pass different types of urls!
For example, all of this...
domain = LazyDomain.parse("google.com")
domain = LazyDomain.parse("http://google.com")
domain = LazyDomain.parse("ftp://google.com")
domain = LazyDomain.parse("somethingcrazy://google.com")
domain = LazyDomain.parse("http://abc.defg.hijk.google.com")
domain = LazyDomain.parse("http://abc.defg.hijk.google.com/asubdirectory/andanother")
...returns something like this.
# => #<PublicSuffix::Domain:0x0055c2344f0168 @sld="google", @tld="com", @trd="abc.defg.hijk">
Enjoy!
FAQs
Unknown package
We found that lazy_domain demonstrated a not healthy version release cadence and project activity because the last version was released 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.