new Certificate(optionsopt)
A Certificate definition that represents the ssl certificate
to be used for an url.
Properties can then use the .toObjectResolved
function to procure an object representation of the property with
all the variable references replaced by corresponding values.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Certificate.definition |
<optional> |
Object with matches, key, cert and passphrase |
- Source:
Example
var Certificate = require('postman-collection').Certificate,
certificate = new Certificate({
name: 'Certificate for example.com',
matches: ['example.com'],
key: { src: '/User/path/to/certificate/key' },
cert: { src: '/User/path/to/certificate' },
passphrase: 'iampassphrase'
});
Extends
Members
cert :Object
Certificate
Type:
- Object
- Source:
disabled :Boolean
This (optional) flag denotes whether this property is disabled or not. Usually, this is helpful when a property is part of a PropertyList. For example, in a PropertyList of Headers, the ones that are disabled can be filtered out and not processed.
Type:
- Boolean
- Inherited From:
- Source:
id :String
Unique identifier
Type:
- String
- Overrides:
- Source:
key :Object
Private Key
Type:
- Object
- Source:
matches :UrlMatchPatternList
List of match pattern
Type:
- Source:
name :String
Name for user reference
Type:
- String
- Overrides:
- Source:
passphrase :Object
passphrase
Type:
- Object
- Source:
pfx :Object
PFX or PKCS12 Certificate
Type:
- Object
- Source:
Methods
(static) isCertificate(obj) → {Boolean}
Checks if the given object is a Certificate
Parameters:
Name | Type | Description |
---|---|---|
obj |
* |
- Source:
Returns:
- Type
- Boolean
canApplyTo(url)
Checks if the certificate can be applied to a given url
Parameters:
Name | Type | Description |
---|---|---|
url |
String | Url | The url string for which the certificate is checked for match. |
- Source:
describe(content, typeopt)
This function allows to describe the property for the purpose of detailed identification or documentation
generation. This function sets or updates the description
child-property of this property.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
content |
String | The content of the description can be provided here as a string. Note that it is expected
that if the content is formatted in any other way than simple text, it should be specified in the subsequent
|
||
type |
String |
<optional> |
"text/plain" | The type of the content. |
- Inherited From:
- Source:
Example
var Collection = require('postman-collection').Collection,
mycollection;
// create a blank collection
myCollection = new Collection();
myCollection.describe('Hey! This is a cool collection.');
console.log(myCollection.description.toString()); // read the description
findInParents(property, customizeropt) → {*|undefined}
Tries to find the given property locally, and then proceeds to lookup in each parent,
going up the chain as necessary. Lookup will continue until customizer
returns a truthy value. If used
without a customizer, the lookup will stop at the first parent that contains the property.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
property |
String | ||
customizer |
function |
<optional> |
- Inherited From:
- Source:
Returns:
- Type
- * | undefined
forEachParent(options, iterator)
Invokes the given iterator for every parent in the parent chain of the given element.
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | A set of options for the parent chain traversal. Properties
|
||||||||||
iterator |
function | The function to call for every parent in the ancestry chain. |
- Inherited From:
- Source:
- To Do:
-
- Cache the results
meta() → {*}
Returns the meta keys associated with the property
- Inherited From:
- Source:
Returns:
- Type
- *
parent() → {*|undefined}
Returns the parent of item
- Inherited From:
- Source:
Returns:
- Type
- * | undefined
toJSON()
Allows the serialization of a Certificate
This is overridden, in order to ensure that certificate contents are not accidentally serialized, which can be a security risk.
- Overrides:
- Source:
update(optionsopt)
Updates the certificate with the given properties.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Certificate.definition |
<optional> |
Object with matches, key, cert and passphrase |
- Source:
Type Definitions
definition
The following is the object representation accepted as param for the Certificate constructor. Also the type of the object returned when Property#toJSON or Property#toObjectResolved is called on a Certificate instance.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String |
<optional> |
A name for the certificate |
matches |
Array |
<optional> |
A list of match patterns |
key |
Object |
<optional> |
Object with path on the file system for private key file, as src |
cert |
Object |
<optional> |
Object with path on the file system for certificate file, as src |
passphrase |
String |
<optional> |
The passphrase for the certificate key |
- Source:
Example
{
"name": "My certificate for example.com",
"matches": ["https://example.com/*"],
"key": { "src": "/path/to/key" },
"cert": { "src": "/User/path/to/certificate" },
"passphrase": "iampassphrase"
}