-
Notifications
You must be signed in to change notification settings - Fork 80
Feat (Insomnia) Add detail for exporting collection run results to JSON #3493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
TuannasCodeCatastrophe
wants to merge
7
commits into
main
from
Feat-Insomnia-Add-detail-for-exporting-collection-run-results-to-JSON-3451
Closed
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8902634
Feat Insomnia Add detail for exporting collection run results to JSON
34dcbf9
updated from how-to to reference doc.
8c4d514
Apply suggestions from code review
TuannasCodeCatastrophe c6972ea
Updated doc from reference to how-to
0166f90
tweak
36fc4a4
drafted content after queries
b30ce51
tweak contraction
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,197 @@ | ||
| --- | ||
| title: Export collection run results to JSON | ||
| content_type: reference | ||
| layout: reference | ||
| description: Learn how the Inso CLI exports Insomnia collection run results as JSON, including metadata-only mode, full-data export, redaction, truncation, and JSON structure. | ||
|
|
||
| products: | ||
| - insomnia | ||
|
|
||
| tools: | ||
| - inso-cli | ||
|
|
||
| related_resources: | ||
| - text: Collections | ||
| url: /insomnia/collections/ | ||
| - text: Inso CLI overview | ||
| url: /inso-cli/ | ||
| - text: Inso CLI configuration | ||
| url: /inso-cli/configuration/ | ||
| --- | ||
|
|
||
| The Inso CLI exports JSON reports for Insomnia collection runs. JSON output follows a Postman-style structure and supports metadata-only and full-data export modes. Redaction and truncation ensure that sensitive information is protected. | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Run the following command to export: | ||
|
|
||
| ``` | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| inso run collection <collection name> --env <environment> --output <file> | ||
| ``` | ||
|
|
||
| ## Export modes | ||
|
|
||
| The Inso CLI supports two export modes. | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| {% table %} | ||
| columns: | ||
| - title: Mode | ||
| key: mode | ||
| - title: Description | ||
| key: description | ||
| rows: | ||
| - mode: Metadata only | ||
| description: "Exports identifiers, timings, status codes, and test results. Does not include headers, bodies, authentication fields, or environment data." | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - mode: Full data | ||
| description: "Exports complete request and response information. Requires an includeFullData mode and an explicit acceptance flag for security." | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {% endtable %} | ||
|
|
||
| ### Metadata-only export | ||
|
|
||
| Metadata reports include: | ||
|
|
||
| - request identifiers | ||
| - timestamps | ||
| - response status codes | ||
| - execution timings | ||
| - test results | ||
|
|
||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Example: | ||
|
|
||
| ``` | ||
| inso run collection "My Collection" \ | ||
| --env "Base Environment" \ | ||
| --output results.json | ||
| ``` | ||
|
|
||
| ### Full data export | ||
|
|
||
| Full export includes: | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - request headers | ||
| - authentication fields | ||
| - query parameters and request bodies | ||
| - response headers | ||
| - response bodies | ||
| - execution timings | ||
| - environment data (redacted or plaintext depending on mode) | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To prevent accidental exposure of secure credentials, full export requires: | ||
|
|
||
| 1. A data-exposure mode | ||
| 2. Explicit risk acceptance | ||
|
|
||
| ## Supported includeFullData values | ||
|
|
||
| {% table %} | ||
| columns: | ||
| - title: Value | ||
| key: value | ||
| - title: Behaviour | ||
| key: behaviour | ||
| rows: | ||
| - value: redact | ||
| behaviour: "Exports all fields but replaces sensitive values with `<Redacted by Insomnia>`." | ||
| - value: plaintext | ||
| behaviour: "Exports every field exactly as stored. Sensitive information is not redacted." | ||
| {% endtable %} | ||
|
|
||
| ### Example: redact mode | ||
|
|
||
| ``` | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| inso run collection "My Collection" \ | ||
| --env "Base Environment" \ | ||
| --includeFullData=redact \ | ||
| --acceptRisk \ | ||
| --output results.json | ||
| ``` | ||
|
|
||
| ### Example: plaintext mode | ||
|
|
||
| ``` | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| inso run collection "My Collection" \ | ||
| --env "Base Environment" \ | ||
| --includeFullData=plaintext \ | ||
| --acceptRisk \ | ||
| --output results.json | ||
| ``` | ||
|
|
||
| ## Risk warning | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| If a full-data mode is set without `--acceptRisk`, Inso interrupts the operation and displays: | ||
|
|
||
| ``` | ||
| SECURITY WARNING | ||
| The output file may contain sensitive data like API tokens. Exposing this file is a security risk. | ||
| To continue, run again with --acceptRisk. | ||
| ``` | ||
|
|
||
| ## Redaction behaviour | ||
|
|
||
| When using `includeFullData=redact`, Insomnia preserves keys but replaces sensitive values with: | ||
|
|
||
| ``` | ||
| <Redacted by Insomnia> | ||
| ``` | ||
|
|
||
| Sensitive fields include: | ||
|
|
||
| - cookies | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - authorization headers | ||
| - bearer tokens | ||
| - API keys | ||
| - CSRF and XSRF tokens | ||
| - refresh tokens | ||
| - proxy authorization values | ||
|
|
||
| Redaction applies to request fields, response fields, and environment variables. | ||
|
|
||
| ## Truncation rules | ||
|
|
||
| To prevent oversized output, Inso truncates large fields. | ||
|
|
||
| - Default limit: **4 KB** | ||
| - Applies to request and response bodies | ||
| - Truncated fields remain valid JSON and indicate truncation | ||
|
|
||
| Override the limit with `--maxDataSize` (bytes): | ||
|
|
||
| ``` | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| inso run collection "My Collection" \ | ||
| --env "Base Environment" \ | ||
| --includeFullData=redact \ | ||
| --acceptRisk \ | ||
| --maxDataSize 16384 \ | ||
| --output results.json | ||
| ``` | ||
|
|
||
| ## JSON structure | ||
TuannasCodeCatastrophe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Exported run results follow this structure: | ||
|
|
||
| ``` | ||
| { | ||
| "timings": {}, | ||
| "stats": {}, | ||
| "collection": {}, | ||
| "environment": {}, | ||
| "executions": [ | ||
| { | ||
| "request": {}, | ||
| "response": {}, | ||
| "tests": [] | ||
| } | ||
| ], | ||
| "proxy": {}, | ||
| "error": null | ||
| } | ||
| ``` | ||
|
|
||
| ## Validate exported results | ||
|
|
||
| Confirm the generated results file contains: | ||
|
|
||
| 1. A `collection` object with metadata | ||
| 2. An `environment` section (redacted or plaintext) | ||
| 3. A populated `executions` array | ||
| 4. Redacted values marked as `<Redacted by Insomnia>` | ||
| 5. Truncated fields where expected | ||
| 6. Full request and response data only when includeFullData is set | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.