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.
@pact-foundation/grunt-pact
Advanced tools
UPGRADE NOTICE
If you are using grunt-pact as a dependency in your project, please update it to @pact-foundation/grunt-pact.
A grunt task to run pact on node.
This plugin requires Grunt >=0.4.0
(works with 1.X)
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-pact --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-pact');
In your project's Gruntfile, add a section named pact
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
pact: {
options: {
// Grunt Pact Specific Options
force: <Boolean>, // Continue if one of the pact files errors, defaults to 'false'
logLevel: <String>, // Specify log level, either 'trace', 'debug', 'info', 'warn', 'error' or 'fatal', defaults to 'info'
// Pact Specific Options Go Here
port: <Number>, // Port number that the server runs on, defaults to 1234
host: <String>, // Host on which to bind the server on, defaults to 'localhost'
log: <String>, // File to log output on relative to current working directory, defaults to none
ssl: <Boolean>, // Create a self-signed SSL cert to run the server over HTTPS, defaults to 'false'
cors: <Boolean>, // Allow CORS OPTION requests to be accepted, defaults to 'false'
dir: <String>, // Directory to write the pact contracts relative to the current working directory, defaults to none
spec: <Number>, // The pact specification version to use when writing pact contracts, defaults to '1'
consumer: <String>, // The name of the consumer to be written to the pact contracts, defaults to none
provider: <String> // The name of the provider to be written to the pact contracts, defaults to none
},
your_target: {
// Specify Pact configuration files here
src:['mocks/**/*.pact.js']
},
},
});
All pact-mock-service options are available to grunt-pact.
Type: Boolean
Default value: false
While running through pact files, this will prevent grunt from stopping if an error occurs.
Type: String
Default value: 'info'
Sets the log level for Pact when running. Can be set to 'trace', 'debug', 'info', 'warn', 'error' or 'fatal'.
Type: Number
Default value: 1234
Port number that the server runs on.
Type: String
Default value: 'localhost'
Host on which to bind the server on. You probably don't need to use this.
Type: String
Default value: ''
File to log output on relative to current working directory.
Type: Boolean
Default value: false
Create a self-signed SSL cert to run the server over HTTPS.
Type: Boolean
Default value: false
Allow CORS OPTION requests to be accepted.
Type: String
Default value: ''
Directory to write the pact contracts relative to the current working directory.
Type: Number
Default value: 1
The pact specification version to use when writing pact contracts.
Type: String
Default value: ''
The name of the consumer to be written to the pact contracts. This can be set via the API.
Type: String
Default value: '.'
The name of the provider to be written to the pact contracts. This can be set via the API.
FAQs
A grunt task to run pact easily
We found that @pact-foundation/grunt-pact demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.