- You can now submit
DELETE /to the admin endpoint to delete all configured stubbed endpoints (#89)
- BREAKING CHANGES from 4.x
- The exit code for the
stubbybin script will reflect the expected/error state of stubby.
- The exit code for the
- Dependencies have been updated to prevent vulnerabilities.
acornupdated from 7.0.0 to 7.1.1- updated node versions for testing
- lodash updated from 4.17.15 to 4.17.19
- Updates depenencies with reported vulnerabilities
- Adds support for POST forms as a hashmap
This project has been stable for some time, best we move to actual semver and
not prerelease versioning. This release on the old versioning system would have been release 0.4.0. It is now 4.0.0 instead.
-
BREAKING CHANGES from 0.3.x
- The
muteoption has been renamedquietto be more consistent with other cli tools
- The
-
New features
- Adds
hitsto the endpoint data that is returned from the admin portal that represents the amount of times that endpoint has been hit from the stubs portal.
- Adds
- Fixes
patherrors in Node 6
- BREAKING CHANGES from 0.2.x
- In
0.2.xand below, you could passrequest.headers.authorizationas ausername:passwordstring to signify Basic auth and stubby would automatically prefixBasicand base64-encode the user/pass string. This breaks other forms of web auth that uses theAuthorizationheader.
Stubby will still base64-encode the# Before request: headers: authorization: 'username:password' # Now request: headers: authorization: 'Basic username:password'
username:passwordif it sees thatBasicis specified and the:character is present. Otherwise it will take it as-is. - In
- New features
json:option for endpoints -- instead of usingpost:orfile:for matching the body of incoming requests, you can specifyjson:with a JSON string and its content will be deeply matched for incoming request bodies.
- fixes a crash when using
start()without any options
- fixes array representations in query strings
- fixes several scope-binding issues caused by the JavaScript rewrite (sorry!)
- clarify use of
PUTand the admin portal - added
_httpsOptionsto pass through options to the underlying tls server.
- fix colorsafe console wrapper errors (Esco Obong)
- Rewrote library in JavaScript (was CoffeeScript)
- fixes the status page display (Hadi Michael)
- fixes unhelpful output when the location given cannot be bound to
- fixes an issue where identical URLs with different request methods may throw an exception
- token replacement from regex capture groups is now usable for dynamic
file:usage
- added recording feature. If a
responseobject uses a string in place of an object (or a sequence of objects/string) the strings will be interpreted as a url to record the response from. Details configured in therequestobject (such asmethod,headers, etc) will be used to make the recording request to the specified url - improved CORS compliance with request/response headers
- added dynamic templating features for interpolating data captured in request regular expressions into response strings
- CORS compliance as per W3C specifications. Using
*as the--locationwill instruct stubby to listen on all interfaces. Implemented by Tomás Aparicio
- bugfix for "Could not render headers to client" from
h2non
- added cyclic responses.
responsecan now be a yaml sequence of responses. Backward compatible, thus the minor version bump - all string values for
responsecriteria are matched as regular expressions against the incoming request
- bugfix: admin and programmatic APIs correctly parse incoming data
- updating styling of status page.
- fixed a bug with the latest version of node where status page was no longer showing.
- urls are now matched via regular expressions. If you want an exact match, remember to prefix your urls with
^and postfix with$
- binary data files are working correctly when used as a response body
- fixed a bug were stubby's version number was appearing as
undefinedin theServerheader
- fixed a bug involving recursive use of
process.nextTick
- line endings are normalized to
\nand trailing whitespace is trimmed from the end when matching request's post/file contents
response.fileandrequest.fileare now relative paths from the root data.yaml instead of being relative from the source of execution
request.headers.authorizationcan now take values such asusername:passwordwhich will automatically be converted toBasic dXNlcm5hbWU6cGFzc3dvcmQ=.- parameterized flags can now be combined with non-parameterized flags. Example:
-dw data.yamlis equivalent to--watch --data data.yaml. - switched from handlebars to underscore for client-side templating
- added
PATCHto acceptable HTTP verbs. - bugfix where
--watchflag was always active. - added
manpage support
- bugfixes related to command line parsing
- fixed bug where query params were not being saved
- added
statusendpoint on admin portal.
- main
stubbymodule now correctly accepts all options availabel via the command line in it's first argument. - added
-w, --watchflag. Monitors the supplied-d, --datafile for changes and reloads the file if necessary. - for the
require('stubby')module, a filename is passed asoptions.watchfor thestart(options, callback)function.
- made method definitions (
PUT,POST, etc.) case insensitive. You could usepost,get, etc. instead. - made
responseobject completely optional. Defaults to200status with an emptybody. - you can now specify an array of acceptible
methods in your YAML:
- request:
url: /anything
method: [get, head]- added /ping endpoint to admin portal
- running stubs portal at both http and https by default
- addition of
-t, --tlsoption to specifying https port for stubs portal
- added
fileparameter torequestobject. When matching a request, if it hasfilespecified it will load it's contents from the filesystem as thepostvalue. If thefilecannot be found, it falls back topost.
- added
queryparameter forrequestobjects to allow comparison by variable instead of static querystring
- fixed severe issue where request headers were not being matched by the stubs portal
- renamed "stub" option to "stubs"
- NEW:
request.filecan be used to specify a file whose contents will be used as the response body. If the file cannot be found, it falls back to whatever was specified inresponse.body
- stubby can now be muted
- removed coffee-script as a dependency
- errors and warnings for missing or unparsable data files have been improved
- re-write of code operating the command-line interface
- admin portal console logging for responses
- reworked API contract failures for admin portal. Upon BAD REQUEST server returns an array of errors describing the endpoint validations that were violated.
- logging messages fixes for stub portal
- fixed callback parameters for stubby interface
- you can now make as many instances of stubby as you want by: require("stubby").Stubby and var stubby = new Stubby()
- callbacks now give copies of endoints instead of refernces. This prevents unexpected changes to endpoints outside of stubby
- bug fixes. optional dependency js-yaml is now really optional
- serval bugs fixed that were found while experimenting with a main module
- fixed but with endpoints with undefined headers not being accepted
- added -k, --key and -c, --cert and -p, -pfx options for stating stubby as an https server
- retired -f, --file option in lieu of -d, --data to prevent confusion between suppling files for data files versus ssl key/certificate files
- added -l flag for starting stubby at a particular address
- added -v --version command line option
- gracefully exits on error when starting stubby
- removed node-inspector as a dependency
- removed jasmine-node as a dependency
- default stub portal is now 8882 (from 80)
- default admin portal is now 8889 (from 81)
- initial release