0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-02-17 23:45:29 -05:00
verdaccio/website/translated_docs/yo-NG/auth.md

3.2 KiB

id title
authentication Ifasẹsi

The authentication is tied to the auth plugin you are using. The package restrictions are also handled by the Package Access.

The client authentication is handled by the npm client itself. Once you log in to the application:

npm adduser --registry http://localhost:4873

Aami kan ma jẹ ṣisẹda ninu npm faili iṣeto ti igbalejo rẹ wa ninu foda ile olumulo rẹ. Fun ẹkunrẹrẹ alaye nipa .npmrc ka iwe alasẹ.

cat .npmrc
registry=http://localhost:5555/
//localhost:5555/:_authToken="secretVerdaccioToken"
//registry.npmjs.org/:_authToken=secretNpmjsToken

Igbejade alainidamọ

verdaccio allows you to enable anonymous publish. To achieve that you will need to correctly set up your packages access.

Fun apẹẹrẹ:

  'my-company-*':
    access: $anonymous
    publish: $anonymous
    proxy: npmjs

Bi apejuwe rẹ ti ṣe jẹ ṣiṣe lori ọrọ #212 titi npm@5.3.0 atipe gbogbo awọn ifilọlẹ kekere koni fayegba ọ lati se atẹjade laisi aami kankan.

Nini oye Awọn ẹgbẹ akojọpọ

Itunmọ $all ati $anonymous

As you know Verdaccio uses htpasswd by default. Ohun elo yẹn ko ṣe amuṣiṣẹ awọn ọna naa allow_access, allow_publish and allow_unpublish. Nitorina, Verdaccio ma mojuto iyẹn ni ọna wọnyi:

  • Ti o ko ba wọle (o jẹ alainidamọ), $all ati $anonymous tumọ si nkankan na.
  • If you are logged in, $anonymous won't be part of your groups and $all will match any logged user. A new group $authenticated will be added to your group list.

Please note: $all will match all users, whether logged in or not.

Ohun elo ifasẹsi atilẹwa nikan ni iwa iṣaaju yẹn bawi. Ti o ba n lo ohun elo akanṣe ati ti iru ohun elo bẹ ba n se imuṣiṣẹ allow_access, allow_publish tabi allow_unpublish, awọn ipinnu ti iwọle naa da lori ohun elo naa funrararẹ. Verdaccio ma ṣeto awọn ẹgbẹ akojọpọ atilẹwa nikan.

Jẹ ki a ṣe atungbeyẹwo ni ṣoki:

  • logged in: $all and $authenticated + groups added by the plugin.
  • logged out (anonymous): $all and $anonymous.

htpasswd atilẹwa

In order to simplify the setup, verdaccio uses a plugin based on htpasswd. Since version v3.0.x the verdaccio-htpasswd plugin is used by default.

auth:
  htpasswd:
    file: ./htpasswd
    # Maximum amount of users allowed to register, defaults to "+inf".
    # You can set this to -1 to disable registration.
    #max_users: 1000
Ohun ini Iru Ti o nilo Apẹẹrẹ Atilẹyin Apejuwe
faili okun Bẹẹni ./htpasswd gbogbo faili to gbalejo awọn iwe ẹri alaroko
max_users nọmba Rara 1000 gbogbo ṣeto gbedeke iye awọn olumulo

In case you decide to prevent users from signing up themselves, you can set max_users: -1.