Skip to content
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

doc: argument types for crypto methods #11799

Closed

Conversation

ameliavoncat
Copy link
Contributor

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

documentation.

Description of changes

Adds argument data types to the docs for crypto methods.

@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations. labels Mar 11, 2017
@ameliavoncat ameliavoncat force-pushed the argument-types-for-crypto branch 3 times, most recently from 1e1f04e to 8f1bea4 Compare March 11, 2017 08:21
@ameliavoncat ameliavoncat force-pushed the argument-types-for-crypto branch from 8f1bea4 to 887f799 Compare March 12, 2017 03:44
@@ -62,6 +62,7 @@ const cert2 = crypto.Certificate();
<!-- YAML
added: v0.11.8
-->
- `spkac` {string | Buffer}
Copy link
Member

@joyeecheung joyeecheung Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence below:

The `spkac` argument can be either a string
 or a [`Buffer`][].

can be removed now.

Also, while you are at it, you can just add the return type here

* Returns {Buffer} The challenge component of the `spkac` data structure,
  which includes a public key and a challenge.

and remove the whole paragragh

 The `spkac` data structure includes a public key and a challenge. The
  `certificate.exportChallenge()` returns the challenge component in the
 form of a Node.js [`Buffer`][]. The `spkac` argument can be either a string
 or a [`Buffer`][].

Doesn't need to happen in this PR though :D

@@ -80,6 +81,7 @@ console.log(challenge.toString('utf8'));
<!-- YAML
added: v0.11.8
-->
- `spkac` {string | Buffer}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -80,6 +81,7 @@ console.log(challenge.toString('utf8'));
<!-- YAML
added: v0.11.8
-->
- `spkac` {string | Buffer}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -98,6 +100,7 @@ console.log(publicKey);
<!-- YAML
added: v0.11.8
-->
- `spkac` {Buffer}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -214,6 +219,7 @@ been completed using the [`cipher.final()`][] method.
<!-- YAML
added: v0.7.1
-->
- `auto_padding` {boolean}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The auto_padding=true part above can be modified to cipher.setAutoPadding([auto_padding]) if we make this item:

- `auto_padding` {boolean} Defaults to true.

@@ -372,6 +384,7 @@ Returns `this` for method chaining.
<!-- YAML
added: v0.7.1
-->
- `auto_padding` {boolean}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@@ -1599,6 +1682,8 @@ time is right after boot, when the whole system is still low on entropy.
<!-- YAML
added: v0.11.11
-->
- `engine` {string}
- `flags` {constant} Defaults to `crypto.constants.ENGINE_METHOD_ALL`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is {number}... or {crypto.constants} would be a bit clearer.

@ameliavoncat ameliavoncat force-pushed the argument-types-for-crypto branch 2 times, most recently from b22c732 to 0fbbc74 Compare March 13, 2017 17:57
@@ -189,15 +186,15 @@ once will result in an error being thrown.
<!-- YAML
added: v1.0.0
-->
- `buffer` {Buffer}
- Returns {this} for method chaining.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the common format in docs is:

Returns: {Cipher}

@ameliavoncat ameliavoncat force-pushed the argument-types-for-crypto branch from 0fbbc74 to 92d6668 Compare March 14, 2017 18:45
jasnell pushed a commit that referenced this pull request Mar 15, 2017
Refs: #9399
PR-URL: #11799
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@jasnell
Copy link
Member

jasnell commented Mar 15, 2017

Landed in 73e2d0b. Thank you!

@jasnell jasnell closed this Mar 15, 2017
jungx098 pushed a commit to jungx098/node that referenced this pull request Mar 21, 2017
Refs: nodejs#9399
PR-URL: nodejs#11799
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@italoacasas
Copy link
Contributor

This PR need backport to v7

@gibfahn
Copy link
Member

gibfahn commented Jun 17, 2017

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants