Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

verdaccio-htpasswd

Package Overview
Dependencies
Maintainers
3
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verdaccio-htpasswd

htpasswd auth plugin for Verdaccio

  • 12.0.0-next.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
178K
decreased by-5.54%
Maintainers
3
Weekly downloads
 
Created

What is verdaccio-htpasswd?

The verdaccio-htpasswd package is a plugin for Verdaccio, a lightweight private npm proxy registry. This plugin allows you to manage user authentication using htpasswd files, which is a simple way to store usernames and passwords for HTTP authentication.

What are verdaccio-htpasswd's main functionalities?

User Authentication

This feature allows you to authenticate users against an htpasswd file. The code sample demonstrates how to set up the htpasswd plugin and authenticate a user.

const Htpasswd = require('verdaccio-htpasswd');
const config = { file: './htpasswd', max_users: 1000 };
const htpasswd = new Htpasswd(config);

htpasswd.authenticate('username', 'password', (err, user) => {
  if (err) {
    console.error('Authentication failed:', err);
  } else {
    console.log('Authenticated user:', user);
  }
});

User Registration

This feature allows you to register new users by adding them to the htpasswd file. The code sample demonstrates how to add a new user.

const Htpasswd = require('verdaccio-htpasswd');
const config = { file: './htpasswd', max_users: 1000 };
const htpasswd = new Htpasswd(config);

htpasswd.adduser('newuser', 'newpassword', (err, user) => {
  if (err) {
    console.error('User registration failed:', err);
  } else {
    console.log('Registered user:', user);
  }
});

Password Management

This feature allows you to change the password of an existing user. The code sample demonstrates how to change a user's password.

const Htpasswd = require('verdaccio-htpasswd');
const config = { file: './htpasswd', max_users: 1000 };
const htpasswd = new Htpasswd(config);

htpasswd.changePassword('username', 'newpassword', (err) => {
  if (err) {
    console.error('Password change failed:', err);
  } else {
    console.log('Password changed successfully');
  }
});

Other packages similar to verdaccio-htpasswd

Keywords

FAQs

Package last updated on 24 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc