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

commented Mar 11, 2017

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.

@ameliavoncat ameliavoncat force-pushed the ameliavoncat:argument-types-for-crypto branch 3 times, most recently Mar 11, 2017

@ameliavoncat ameliavoncat force-pushed the ameliavoncat:argument-types-for-crypto branch Mar 12, 2017

doc/api/crypto.md Outdated
@@ -62,6 +62,7 @@ const cert2 = crypto.Certificate();
<!-- YAML
added: v0.11.8
-->
- `spkac` {string | Buffer}

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Mar 13, 2017

Member

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

doc/api/crypto.md Outdated
@@ -80,6 +81,7 @@ console.log(challenge.toString('utf8'));
<!-- YAML
added: v0.11.8
-->
- `spkac` {string | Buffer}

This comment has been minimized.

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

This comment has been minimized.

Copy link
@joyeecheung
doc/api/crypto.md Outdated
@@ -98,6 +100,7 @@ console.log(publicKey);
<!-- YAML
added: v0.11.8
-->
- `spkac` {Buffer}

This comment has been minimized.

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

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Mar 13, 2017

Member

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.
doc/api/crypto.md Outdated
@@ -372,6 +384,7 @@ Returns `this` for method chaining.
<!-- YAML
added: v0.7.1
-->
- `auto_padding` {boolean}

This comment has been minimized.

Copy link
@joyeecheung
doc/api/crypto.md Outdated
@@ -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`.

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Mar 13, 2017

Member

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

@ameliavoncat ameliavoncat force-pushed the ameliavoncat:argument-types-for-crypto branch 2 times, most recently Mar 13, 2017

doc/api/crypto.md Outdated
@@ -189,15 +186,15 @@ once will result in an error being thrown.
<!-- YAML
added: v1.0.0
-->
- `buffer` {Buffer}
- Returns {this} for method chaining.

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Mar 14, 2017

Member

I think the common format in docs is:

Returns: {Cipher}

@ameliavoncat ameliavoncat force-pushed the ameliavoncat:argument-types-for-crypto branch to 92d6668 Mar 14, 2017

jasnell added a commit that referenced this pull request Mar 15, 2017
doc: argument types for crypto methods
Refs: #9399
PR-URL: #11799
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@jasnell

This comment has been minimized.

Copy link
Member

commented Mar 15, 2017

Landed in 73e2d0b. Thank you!

@jasnell jasnell closed this Mar 15, 2017

@tniessen tniessen referenced this pull request Mar 15, 2017
4 of 4 tasks complete
jungx098 added a commit to jungx098/node that referenced this pull request Mar 21, 2017
doc: argument types for crypto methods
Refs: nodejs#9399
PR-URL: nodejs#11799
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@italoacasas

This comment has been minimized.

Copy link
Member

commented Mar 21, 2017

This PR need backport to v7

@jasnell jasnell referenced this pull request Apr 4, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
@gibfahn

This comment has been minimized.

Copy link
Member

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
Projects
None yet
6 participants
You can’t perform that action at this time.