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

EN translation for passport tutorial #2235

Merged
merged 6 commits into from
Apr 13, 2018

Conversation

cemremengu
Copy link
Contributor

@cemremengu cemremengu commented Mar 19, 2018

Added passport tutorial English documentation #363

@request-info
Copy link

request-info bot commented Mar 19, 2018

The maintainers of this repository would appreciate it if you could provide more information.

## Title: Passport

** "Login authentication" ** is a common business scenario, including "account password login method" and "third-party unified login."
Copy link
Member

Choose a reason for hiding this comment

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

  • 一个 * 且没空格
  • " 要改为 ` 吧?

Copy link
Contributor Author

@cemremengu cemremengu Mar 19, 2018

Choose a reason for hiding this comment

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

一个 * 且没空格 : do you mean Login authentication ?

" 要改为 `` 吧?: I will replace all " with ` in this part

Copy link
Member

Choose a reason for hiding this comment

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

** "Login authentication" ** 的问题是 ** 后面多一个 * 和一个空格,这样是得不到粗体的效果的。如果直接用 ` 的话可以省掉 **

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hopefully it's good now :)

@atian25 atian25 requested a review from thonatos March 19, 2018 09:06
@codecov
Copy link

codecov bot commented Mar 19, 2018

Codecov Report

Merging #2235 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2235   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files          29       29           
  Lines         773      773           
=======================================
  Hits          770      770           
  Misses          3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fad4e1...5419d40. Read the comment docs.

@cemremengu cemremengu changed the title Added passport tutorial english documentation EN translation for passport tutorial Mar 19, 2018
@popomore popomore requested a review from SunShinewyf March 28, 2018 05:17
@cemremengu
Copy link
Contributor Author

@SunShinewyf 最后一个!


**`Login authentication`** is a common business scenario, including "account password login method" and "third-party unified login".

Copy link
Contributor

Choose a reason for hiding this comment

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

感觉那个 method 可以不要~


[Passport](http://www.passportjs.org/) is a highly scalable authentication middleware that supports the `Strategy` of `Github` ,`Twitter`,`Facebook`, and other well-known service vendors. It also supports login and authorization verification via account passwords.

Copy link
Contributor

Choose a reason for hiding this comment

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

login and authorization verification -> login authorization verification(登录授权校验)


Egg provides an [egg-passport](https://github.com/eggjs/egg-passport) plugin on top of it, encapsulating general logic such as callback processing after initialization and authentication success, allowing the developer to use Passport with just a few API calls.

Copy link
Contributor

Choose a reason for hiding this comment

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

  • on top of it,感觉有点不太好,换成 bases on it
  • encapsulating 改为 this plugin encapsulates ,指代明确一点
  • authentication success ->the success of authentication
  • allowing the developer to use Passport with just a few API calls. -> so that the developers can use ...

The execution sequence of [Passport](http://www.passportjs.org/) is as follows:

* User access page
Copy link
Contributor

Choose a reason for hiding this comment

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

User accesses page

* User access page
* Check Session
* Intercept the login authentication login page
Copy link
Contributor

Choose a reason for hiding this comment

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

Intercept and jump to authentication login page

## Using Passport Ecosystem

[Passport](http://www.passportjs.org/) has many middleware and it is impossible to carry out secondary packaging.
Copy link
Contributor

Choose a reason for hiding this comment

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

impossible to carry out secondary packaging -> impossible to have the second encapsulation


  // Render login page, user input account password
  Router.get('/login', controller.home.login);
Copy link
Contributor

Choose a reason for hiding this comment

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

user inputs

## How to develop an egg-passport plugin

In the previous section, we learned how to use a Passport middleware in the framework. We can further package it as a plugin and give back to the community.
Copy link
Contributor

Choose a reason for hiding this comment

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

further package -> further encapsulated

```

Note: [egg-passport](https://github.com/eggjs/egg-passport) standardizes the configuration fields, which are unified as `key` and `secret`, so if the corresponding Passport middleware attribute names are inconsistent, the developer should perform the conversion.
Copy link
Contributor

Choose a reason for hiding this comment

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

perform -> do

[egg-passport]: https://github.com/eggjs/egg-passport
[passport-local]: https://github.com/jaredhanson/passport-local
[eggjs/examples/passport]: https://github.com/eggjs/examples/tree/master/passport
Copy link
Contributor

Choose a reason for hiding this comment

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

有一些代码片段首字母大写了~


Among them, we often use the latter, such as Google, GitHub, QQ unified login, which are based on [OAuth](https://oauth.net/2/) specification.

[Passport](http://www.passportjs.org/) is a highly scalable authentication middleware that supports the `Strategy` of `Github` ,`Twitter`,`Facebook`, and other well-known service vendors. It also supports login and authorization verification via account passwords.
[Passport](http://www.passportjs.org/) is a highly scalable authentication middleware that supports the `Strategy` of `Github` ,`Twitter`,`Facebook`, and other well-known service vendors. It also supports login authorization verification.

Copy link
Contributor

Choose a reason for hiding this comment

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

via account passwords 这个还是要加上的~

@@ -248,7 +248,7 @@ $ egg-init --type=plugin egg-passport-local
```js
// {plugin_root}/config/config.default.js
// https://github.com/jaredhanson/passport-local
exports.passportLocal = {
module.exports.passportLocal = {
};
```

Copy link
Contributor

Choose a reason for hiding this comment

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

该这一个地方就可以提交了~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@atian25
Copy link
Member

atian25 commented Apr 9, 2018

这个继续改改? 然后 rebase 下?

@cemremengu cemremengu force-pushed the docs-passport-tutorial branch from 95a7734 to f792b68 Compare April 9, 2018 07:21
@cemremengu
Copy link
Contributor Author

@SunShinewyf 👀

@popomore popomore merged commit ee2d2b3 into eggjs:master Apr 13, 2018
popomore pushed a commit that referenced this pull request Apr 13, 2018
docs(passport): translation for passport tutorial (#2235)
@cemremengu cemremengu deleted the docs-passport-tutorial branch April 13, 2018 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants