-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Added self-contained http/network requests implementation #1121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host header is not considered in RAW format compared to base format, additionally, we can extend this support for network templates as well.
Base format:-
id: example-self-contained-input-2
info:
name: example-self-contained-input-2
author: pdteam
severity: info
self-contained: true
requests:
- path:
- "https://example.com/gg"
headers:
Host: "{{randstr}}.tld"
matchers:
- type: status
status:
- 302
RAW format:-
id: example-self-contained-input
info:
name: example-self-contained
author: pdteam
severity: info
self-contained: true
requests:
- raw:
- |
GET https://example.com/gg HTTP/1.1
Host: {{randstr}}.tld
matchers:
- type: status
status:
- 302
… self-contained-templates
… self-contained-templates
Added the support to network requests as well which is now possible after the merge of #1138. id: api-sendgrid
info:
name: Sendgrid API Test
author: zzeitlin
reference: https://docs.sendgrid.com/for-developers/sending-email/getting-started-smtp
severity: info
tags: token-spray,sendgrid
self-contained: true
network:
- inputs:
- data: "ehlo\r\n"
read: 1024
- data: "AUTH PLAIN {{base64(hex_decode('00')+'apikey'+hex_decode('00')+token)}}\r\n"
read: 1024
host:
- "tls://smtp.sendgrid.net:465"
matchers:
- type: word
words:
- "Authentication successful" |
… self-contained-templates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in my previous comment (#1086 (comment)), I believe the self-contained
attribute should be declared per-template level and not per-request etc.
Changed it to be per-template instead. id: example-self-contained-input
info:
name: example-self-contained
author: pdteam
severity: info
self-contained: true
requests:
- raw:
- |
GET https://example.com/gg HTTP/1.1
Host: {{randstr}}.tld
matchers:
- type: status
status:
- 302 |
This PR resolves #1086 by adding a new attribute to HTTP requests that marks all the HTTP Requests in that template as self-sufficient, meaning they do not require any input to be executed.
Few examples are provided below. The attribute was added to HTTP requests as the implementation was only relevant for HTTP.