Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
= JCon -- JavaScript Type Conformance Checking
JCON (the "JavaScript Conformance" gem), is a companion to JSON. It
tests JSON values against ECMAScript 4.0-style type definitions
(PDF[http://www.ecmascript.org/es4/spec/overview.pdf]), such as
string?
, (int, boolean)
, or [string, (int, boolean), {x:double, y:double}?]
.
JCON also defines an RSpec matcher, conforms_to_js
.
Use JCON together with the {JavaScript Fu Rails plugin}[http://osteele.com/archives/2008/04/javascript-fu-rails-plugin] to test the argument values in generated JavaScript function calls.
== Install
gem install rcon
== Usage
type = JCON::parse "[string, int]" type.contains?(['a', 1]) # => true type.contains?(['a', 'b']) # => false type.contains?(['a', 1, 2]) # => true
type = JCON::parse "type S = (string, int); {a: [S], b: int}" type.contains?({:a => [1, 'b'], :b => 2}) # => true
== RSpec Matcher
[1, 'xyzzy'].should conform_to_js('[int, string]') [1, 2, 'xyzzy'].should_not conform_to_js('[int, string]') {:x => 1}.should conform_to_js('{x: int}')
Use this with the {JavaScript Fu Rails plugin}[http://osteele.com/archives/2008/04/javascript-fu-rails-plugin] to test JSON arguments:
''.should call_js('fn') do |args| args[0].should conform_to_js('string') args[1].should conform_to_js('{x:int, y:int}') args[2].should conform_to_js('boolean') # or: args.should conform_to_js('[string, {x:int, y:int}, boolean]') end
== License
Copyright 2008 by {Oliver Steele}[http://workingwithrails.com/person/12359-oliver-steele]. All rights reserved. Released under the MIT License.
FAQs
Unknown package
We found that osteele-jcon 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.