
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@apideck/portman
Advanced tools
Port OpenAPI Spec to Postman Collection!
Portman sits on top of @thim81's open PR. Tim has made awesome progress in converting an OAS to a Postman Collection with automated test injection. At Apideck, we wanted to include this as part of an automated process that could be injecting directly into our CI/CD pipeline.
With Portman, we can:
.env.example
to .env
and add environment variables you need available to your collection.Usage: -u <url> -l <local> -b <baseUrl> -t <includeTests>
Options:
--help Show help [boolean]
--version Show version number [boolean]
-u, --url URL of OAS to port to postman collection [string]
-l, --local Use local OAS to port to postman collection [string]
-b, --baseUrl Override spec baseUrl to use in test suite [string]
-n, --runNewman Run newman on newly created collection [boolean]
-d, --newmanIterationData Iteration data to run newman with newly created collection [string]
-p, --postmanUid Collection ID to upload generated collection to postman [string]
-t, --includeTests Inject test suite (default: true) [boolean]
-c, --portmanConfigFile Path to portman-config.json [string]
-s, --postmanConfigFile Path to postman-config.json [string]
-g, --testSuiteConfigFile Path to postman-testsuite.json [string]
Portman uses dotenv
to not only access variables for functionality, but you can easily add environment variables that you'd like declared within your postman environment.
Simply prefix any variabled name with PORTMAN_
, and it will be availble for use in your postman collection as the camelcased equivalent. For example:
PORTMAN_CONSUMER_ID=test_user_id
will be available in your collection or tests by referencing:
{{consumerId}}
To generate the collection with tests, define a JSON file like the example (portman-config.json) below and run the CLI with the --generate option.
{
"preRequestScripts": [
"pm.collectionVariables.set('statusId', '12345')"
],
"variableOverwrites": {
"x-apideck-app-id": "{{applicationId}}"
}
}
Pass in the remote hosted spec:
yarn portman -u https://specs.apideck.com/crm.yml
Overwrite the baseUrl in spec and run newman.
yarn portman -u https://specs.apideck.com/crm.yml -b http://localhost:3050 -n true
Path pass to local data file for newman to use for iterations.
yarn portman -u https://specs.apideck.com/crm.yml -b http://localhost:3050 -n true -d ./tmp/newman/data/crm.json
Pass path to a local spec (useful when updating your specs)
yarn portman -l ./tmp/specs/crm.yml
Skip tests and just generate collection.
yarn portman -l ./tmp/specs/crm.yml -t false
Upload newly generated collection to Postman using the collection ID.
yarn portman -l ./tmp/specs/crm.yml -p 9601963a-53ff-4aaa-92a0-2e70a8a2a748
Pass custom paths for config files
yarn portman -u https://specs.apideck.com/crm.yml -c ./tmp/crm/portman-config.json -g ./tmp/crm/postman-testsuite.json -s ./common/postman-config.json
Your generated Postman Collection is written to ./tmp/converted/${specName}.json
if you are manually importing to Postman or need to inspect for debugging.
v0.0.3 - (2021-05-06)
FAQs
Port OpenAPI Spec to Postman Collection, with contract & variation tests included
The npm package @apideck/portman receives a total of 7,008 weekly downloads. As such, @apideck/portman popularity was classified as popular.
We found that @apideck/portman demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.