open-index/open-npm huggingface dataset:
npm package: @passport-next/chai-connect-middleware
Description: Helpers for testing Connect middleware with the Chai assertion library.
Author: Passport Next Developers
Latest version: 1.0.1

# Passport-Next/chai-connect-middleware 

Status:
[![NPM version](https://img.shields.io/npm/v/@passport-next/chai-connect-middleware.svg)](https://www.npmjs.com/package/@passport-next/chai-connect-middleware)
[![Build Status](https://travis-ci.org/passport-next/chai-connect-middleware.svg?branch=master)](https://travis-ci.org/passport-next/chai-connect-middleware)
[![Coverage Status](https://coveralls.io/repos/github/passport-next/chai-connect-middleware/badge.svg?branch=master)](https://coveralls.io/github/passport-next/chai-connect-middleware?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/5144b93fb618689b9486/maintainability)](https://codeclimate.com/github/passport-next/chai-connect-middleware/maintainability)
[![Dependencies](https://david-dm.org/passport-next/chai-connect-middleware.png)](https://david-dm.org/passport-next/chai-connect-middleware)
[![SAST](https://gitlab.com/passport-next/chai-connect-middleware/badges/master/pipeline.svg)](https://gitlab.com/passport-next/chai-connect-middleware)

## About

Helpers for testing [Connect](https://github.com/senchalabs/connect#readme) middleware
with the [Chai](https://www.chaijs.com/) assertion library.

## Install

```
$ npm install @passport-next/chai-connect-middleware
```

## Docs

[Please see the wiki](https://github.com/passport-next/chai-connect-middleware/wiki)

## Need help?

Please raise an [issue](https://github.com/passport-next/chai-connect-middleware/issues) and/or ask a question on [Stackoverflow](https://stackoverflow.com) with the `passport.js` tag.

## Support policy

We support all [node versions](https://github.com/nodejs/Release) supported by the Node Foundation



## Contributing

Please see [CONTRIBUTING.md](https://github.com/passport-next/chai-connect-middleware/blob/master/CONTRIBUTING.md)
npm package: @passport-next/connect-ensure-login
Description: Login session ensuring middleware for Connect
Author: Passport Next Developers
Latest version: 1.0.1

# Passport-Next/connect-ensure-login 

Status:
[![NPM version](https://img.shields.io/npm/v/@passport-next/connect-ensure-login.svg)](https://www.npmjs.com/package/@passport-next/connect-ensure-login)
[![Build Status](https://travis-ci.org/passport-next/connect-ensure-login.svg?branch=master)](https://travis-ci.org/passport-next/connect-ensure-login)
[![Coverage Status](https://coveralls.io/repos/github/passport-next/connect-ensure-login/badge.svg?branch=master)](https://coveralls.io/github/passport-next/connect-ensure-login?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/cd841c0f5037adb4d874/maintainability)](https://codeclimate.com/github/passport-next/connect-ensure-login/maintainability)
[![Dependencies](https://david-dm.org/passport-next/connect-ensure-login.png)](https://david-dm.org/passport-next/connect-ensure-login)
[![SAST](https://gitlab.com/passport-next/connect-ensure-login/badges/master/pipeline.svg)](https://gitlab.com/passport-next/connect-ensure-login)

## About

This middleware ensures that a user is logged in.  If a request is received that
is unauthenticated, the request will be redirected to a login page.  The URL
will be saved in the session, so the user can be conveniently returned to the
page that was originally requested.

## Install

```
$ npm install @passport-next/connect-ensure-login
```

## Docs

[Please see the wiki](https://github.com/passport-next/connect-ensure-login/wiki)

## Need help?

Please raise an [issue](https://github.com/passport-next/connect-ensure-login/issues) and/or ask a question on [Stackoverflow](https://stackoverflow.com) with the `passport.js` tag.

## Support policy

We support all [node versions](https://github.com/nodejs/Release) supported by the Node Foundation



## Contributing

Please see [CONTRIBUTING.md](https://github.com/passport-next/connect-ensure-login/blob/master/CONTRIBUTING.md)
npm package: @passport-next/oauth2orize-openid
Description: Extensions to support OpenID Connect with OAuth2orize.
Author: Adam Hathcock
Latest version: 2.0.0

# oauth2orize-openid

[OAuth2orize](https://github.com/passport-next/oauth2orize) extensions providing
support for [OpenID Connect](https://openid.net/connect/).

## Examples

This [example](https://github.com/gerges-beshay/oauth2orize-openid-examples) demonstrates
basic usage of the api.
npm package: @passport-next/oauth2orize-pkce
Description: Extensions to support Proof Key for Code Exchange with OAuth2orize.
Author: Adam Hathcock
Latest version: 1.0.0

# oauth2orize-pkce

[OAuth2orize](https://github.com/passport-next/oauth2orize) extension providing
support for [Proof Key for Code Exchange](https://tools.ietf.org/html/rfc7636).


## Install

```bash
$ npm install @passport-next/oauth2orize-pkce
```

## Usage

#### Parse Request Extensions

In order to parse the additional parameters used to establish a proof key for
code exchange, register support for this extension with a `Server` instance:

```js
server.grant(require('@passport-next/oauth2orize-pkce').extensions());
```
npm package: @passport-next/passport
Description: Simple, unobtrusive authentication for Node.js.
Author: Passport Next Developers
Latest version: 3.1.0

# Passport-Next/Passport 

Status:
[![NPM version](https://img.shields.io/npm/v/@passport-next/passport.svg)](https://www.npmjs.com/package/@passport-next/passport)
[![Build Status](https://travis-ci.org/passport-next/passport.svg?branch=master)](https://travis-ci.org/passport-next/passport)
[![Coverage Status](https://coveralls.io/repos/github/passport-next/passport/badge.svg?branch=master)](https://coveralls.io/github/passport-next/passport?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/deaf381bf0cff6bf26a5/maintainability)](https://codeclimate.com/github/passport-next/passport/maintainability)
[![Dependencies](https://david-dm.org/passport-next/passport.png)](https://david-dm.org/passport-next/passport)
[![SAST](https://gitlab.com/passport-next/passport/badges/master/pipeline.svg)](https://gitlab.com/passport-next/passport)

## About

Passport-Next/Passport is [Express](http://expressjs.com/)-compatible authentication
middleware for [Node.js](http://nodejs.org/).

Passport's sole purpose is to authenticate requests, which it does through an
extensible set of plugins known as _strategies_.  Passport does not mount
routes or assume any particular database schema, which maximizes flexibility and
allows application-level decisions to be made by the developer.  The API is
simple: you provide Passport a request to authenticate, and Passport provides
hooks for controlling what occurs when authentication succeeds or fails.


## Install

```
$ npm install @passport-next/passport
```

## Docs

[Please see the wiki](https://github.com/passport-next/passport/wiki)

## Need help?

Please raise an [issue](https://github.com/passport-next/passport/issues) and/or ask a question on [Stackoverflow](https://stackoverflow.com) with the `passport.js` tag.

## Support policy

We support all [node versions](https://github.com/nodejs/Release) supported by the Node Foundation



## Contributing

Please see [CONTRIBUTING.md](https://github.com/passport-next/passport/blob/master/CONTRIBUTING.md)
npm package: @passport-next/passport-local
Description: Local username and password authentication strategy for Passport.
Author: Passport Next Developers
Latest version: 1.2.1

# Passport-Next/Passport-Local 

Status:
[![NPM version](https://img.shields.io/npm/v/@passport-next/passport-local.svg)](https://www.npmjs.com/package/@passport-next/passport-local)
[![Build Status](https://travis-ci.org/passport-next/passport-local.svg?branch=master)](https://travis-ci.org/passport-next/passport-local)
[![Coverage Status](https://coveralls.io/repos/github/passport-next/passport-local/badge.svg?branch=master)](https://coveralls.io/github/passport-next/passport-local?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/b7ff64d57f9f816260a3/maintainability)](https://codeclimate.com/github/passport-next/passport-local/maintainability)
[![Dependencies](https://david-dm.org/passport-next/passport-local.png)](https://david-dm.org/passport-next/passport-local)
[![SAST](https://gitlab.com/passport-next/passport-local/badges/master/pipeline.svg)](https://gitlab.com/passport-next/passport-local)

## About

This module lets you authenticate using a username and password in your Node.js
applications.  By plugging into Passport, local authentication can be easily and
unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Install

```
$ npm install @passport-next/passport-local
```

## Docs

[Please see the wiki](https://github.com/passport-next/passport-local/wiki)

## Need help?

Please raise an [issue](https://github.com/passport-next/passport-local/issues) and/or ask a question on [Stackoverflow](https://stackoverflow.com) with the `passport.js` tag.

## Support policy

We support all [node versions](https://github.com/nodejs/Release) supported by the Node Foundation



## Contributing

Please see [CONTRIBUTING.md](https://github.com/passport-next/passport-local/blob/master/CONTRIBUTING.md)
npm package: @passport-next/passport-mocked
Description: Mock Passport Strategy
Latest version: 1.3.0

# Passport-mock

[![NPM version](https://img.shields.io/npm/v/@passport-next/passport-mocked.svg)](https://www.npmjs.com/package/@passport-next/passport-mocked)
[![Build Status](https://travis-ci.org/passport-next/passport-mocked.svg?branch=master)](https://travis-ci.org/passport-next/passport-mocked)
[![Coverage Status](https://coveralls.io/repos/github/passport-next/passport-mocked/badge.svg?branch=master)](https://coveralls.io/github/passport-next/passport-mocked?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/ad14c75df09e29752eee/maintainability)](https://codeclimate.com/github/passport-next/passport-mocked/maintainability)
[![Dependencies](https://david-dm.org/passport-next/passport-mocked.png)](https://david-dm.org/passport-next/passport-mocked)
<!--[![SAST](https://gitlab.com/passport-next/passport-mocked/badges/master/build.svg)](https://gitlab.com/passport-next/passport-mocked/badges/master/build.svg)-->

Designed as a drop in replacement for any passport auth strategy for integration tests.

#### How to use in your code

```javascript
var express = require('express');
var app = express();
var Strategy;

if (process.env.NODE_ENV == 'test' ) {
  Strategy = require('@passport-next/passport-mocked').Strategy;
} else {
  Strategy = require('@passport-next/passport-facebook').Strategy;
}

passport.use(new Strategy({
    name: 'facebook',
    clientID: process.env.FACEBOOK_APP_ID,
    clientSecret: process.env.FACEBOOK_APP_SECRET,
    callbackURL: "http://localhost:3000/auth/facebook/callback"
  },
  function (accessToken, refreshToken, profile, done) {
    User.findOrCreate({ facebookId: profile.id }, function (err, user) {
      return done(err, user);
    });
  });
);
```

#### How to use in your test

```javascript
// app is loaded and running in the same process
// using the testing framework of your choice
// probably something like selenium, since you'll most likely need a browser

var passport = require('@passport-next/passport');

this.When(^/I log in to (.+) as:$/, function (provider, table, next) {
  var strategy = passport._strategies[provider];

  strategy._token_response = {
    access_token: 'at-1234',
    expires_in: 3600
  };

  strategy._profile = {
    id: 1234,
    provider: provider,
    displayName: 'Jon Smith',
    emails: [ { value: 'jon.smith@example.com' } ]
  };

  browser.get('/auth/facebook', next);
});

this.Then(^/I should see Jon Smith on the page:$/, function (next) {
  driver.findElement(webdriver.By.css("body")).catch(next).then(function(element){
    element.getText().catch(next).then(function(text){
      console.assert(!!~text.indexOf("Jon Smith"), text + ' should have contained "Jon Smith"');
      next();
    });
  });
});

```
npm package: @passport-next/passport-oauth2-client-public
Description: OAuth 2.0 public client authentication strategy for Passport.
Author: Adam Hathcock
Latest version: 1.0.0

# passport-oauth2-client-public

This is a Strategy that allows only a `client_id` in the body of the request for verification.  This is intended just for the [OAuth2 PKCE Extension](https://github.com/passport-next/oauth2orize-pkce) protecting the `Token` endpoint.
npm package: @passport-next/passport-openidconnect
Description: OpenID Connect authentication strategy for Passport-Next.
Author: Adam Hathcock
Latest version: 1.0.0

# Passport-OpenID Connect

[Passport](https://github.com/passport-next/passport) strategy for authenticating
with [OpenID Connect](http://openid.net/connect/).

This module lets you authenticate using OpenID Connect in your Node.js
applications.  By plugging into Passport, OpenID Connect authentication can be
easily and unobtrusively integrated into any application or framework that
supports [Connect](http://www.senchalabs.org/connect/)-style middleware,
including [Express](http://expressjs.com/).

## Credits

- [Jared Hanson](http://github.com/jaredhanson)
npm package: @passport-next/passport-tumblr
Description: Tumblr authentication strategy for Passport.
Author: Rowan Wookey
Latest version: 0.4.0

# Passport-Tumblr

[![Build Status](https://travis-ci.org/passport-next/passport-tumblr.svg?branch=master)](https://travis-ci.org/passport-next/passport-tumblr)
[![Coverage Status](https://coveralls.io/repos/github/passport-next/passport-tumblr/badge.svg?branch=master)](https://coveralls.io/github/passport-next/passport-tumblr?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/cfd3cf93fcbb9b44231e/maintainability)](https://codeclimate.com/github/passport-next/passport-tumblr/maintainability)
[![Dependencies](https://david-dm.org/passport-next/passport-tumblr.png)](https://david-dm.org/passport-next/passport-tumblr)
<!--[![SAST](https://gitlab.com/passport-next/passport-tumblr/badges/master/build.svg)](https://gitlab.com/passport-next/passport-tumblr/badges/master/build.svg)-->

[Passport](http://passportjs.org/) strategy for authenticating with [Tumblr](https://www.tumblr.com/)
using the OAuth 1.0a API.

This module lets you authenticate using Tumblr in your Node.js applications.
By plugging into Passport, Tumblr authentication can be easily and
unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Install

    $ npm install @passport-next/passport-tumblr

## Usage

#### Configure Strategy

The Tumblr authentication strategy authenticates users using a Tumblr account
and OAuth tokens.  The strategy requires a `verify` callback, which accepts
these credentials and calls `done` providing a user, as well as `options`
specifying a consumer key, consumer secret, and callback URL.

    passport.use(new TumblrStrategy({
        consumerKey: TUMBLR_CONSUMER_KEY,
        consumerSecret: TUMBLR_SECRET_KEY,
        callbackURL: "http://127.0.0.1:3000/auth/tumblr/callback"
      },
      function(token, tokenSecret, profile, done) {
        User.findOrCreate({ tumblrId: profile.id }, function (err, user) {
          return done(err, user);
        });
      }
    ));

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'tumblr'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

    app.get('/auth/tumblr',
      passport.authenticate('tumblr'));
    
    app.get('/auth/tumblr/callback', 
      passport.authenticate('tumblr', { failureRedirect: '/login' }),
      function(req, res) {
        // Successful authentication, redirect home.
        res.redirect('/');
      });

## Examples

For a complete, working example, refer to the [login example](https://github.com/jaredhanson/passport-tumblr/tree/master/examples/login).

## Tests

    $ npm install --dev
    $ make test
npm package: @passport-next/skel
Description: Passport next project skeleton
Author: Passport Next Developers
Latest version: 2.0.1

# Passport-Next/Passport-Skel 

Status:
[![NPM version](https://img.shields.io/npm/v/@passport-next/skel.svg)](https://www.npmjs.com/package/@passport-next/skel)
[![Build Status](https://travis-ci.org/passport-next/skel.svg?branch=master)](https://travis-ci.org/passport-next/skel)
[![Coverage Status](https://coveralls.io/repos/github/passport-next/skel/badge.svg?branch=master)](https://coveralls.io/github/passport-next/skel?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/d0ee7f0771ecb61ff0de/maintainability)](https://codeclimate.com/github/passport-next/skel/maintainability)
[![Dependencies](https://david-dm.org/passport-next/skel.png)](https://david-dm.org/passport-next/skel)
[![SAST](https://gitlab.com/passport-next/skel/badges/master/pipeline.svg)](https://gitlab.com/passport-next/skel)

## About

This project contains a skeleton for all passport-next projects and a script to generate docs etc from templates

## Install

```
$ npm install @passport-next/skel
```

## Docs

[Please see the wiki](https://github.com/passport-next/skel/wiki)

## Need help?

Please raise an [issue](https://github.com/passport-next/skel/issues) and/or ask a question on [Stackoverflow](https://stackoverflow.com) with the `passport.js` tag.

## Support policy

We support all [node versions](https://github.com/nodejs/Release) supported by the Node Foundation



## Contributing

Please see [CONTRIBUTING.md](https://github.com/passport-next/skel/blob/master/CONTRIBUTING.md)
npm package: @passport90/memory-stream
Description: Implementation of Node.js Readable and Writable stream API where the data are stored in memory.
Author: Marhadiasha Kusumawardhana
Latest version: 1.0.4

# memory-stream
Simple and lightweight implementation of Node.js Readable and Writable stream API where the data are stored in memory.

## Installation
```
npm install @passport90/memory-stream
```

## Usage Example
### Read stream
This snippet would print 'This is a content.' to the screen.
```
import { MemoryReadStream } from '@passport90/memory-stream'

const content = 'This is a content.'

const stream = new MemoryReadStream(Buffer.from(content, 'utf8'))

let readString = ''
stream.on('error', console.error)
stream.on('end', () => console.log(readString)) 
stream.on('readable', () => {
  let chunk
  while (null !== (chunk = stream.read())) {
    readString += chunk.toString()
  }
})

```

### Write stream
This snippet would print 'This is a content.' to the screen.
```
import { MemoryWriteStream } from '@passport90/memory-stream'

const content = 'This is a content.'
const buffer = Buffer.alloc(content.length)

const stream = new MemoryWriteStream(buffer)

stream.on('error', console.error)
stream.on('finish', () => console.log(buffer.toString()))
stream.end(content, 'utf8')

```