diff options
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md')
-rwxr-xr-x | deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md index 43f15626f..cb1e9089f 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/README.md @@ -82,7 +82,12 @@ Returns a 401 Unauthorized error where: - `scheme` can be one of the following: - an authentication scheme name - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. -- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the 'WWW-Authenticate' in the format of 'key="value"'. `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header will not be present and `isMissing` will be true on the error object. +- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used + when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the + 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. + `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as + the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header + will not be present and `isMissing` will be true on the error object. If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response. @@ -111,7 +116,10 @@ Generates the following response: "payload": { "statusCode": 401, "error": "Unauthorized", - "message": "invalid password" + "message": "invalid password", + "attributes": { + "error": "invalid password" + } }, "headers" { "WWW-Authenticate": "sample error=\"invalid password\"" @@ -128,7 +136,13 @@ Generates the following response: "payload": { "statusCode": 401, "error": "Unauthorized", - "message": "invalid password" + "message": "invalid password", + "attributes": { + "error": "invalid password", + "ttl": 0, + "cache": "", + "foo": "bar" + } }, "headers" { "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\"" |