open-index/open-npm huggingface dataset:
npm package: @rsritika12/my-comp-lib
Description: This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8.
Latest version: 0.0.0

# MyCompLib

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.8.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
npm package: @rss/auth
Description: custom passport strategy and helper function for working with rss token server
Author: Risk & Safety Solutions
Latest version: 0.0.21
Deprecated: This module has been merged into @rss/common-nodejs

# @rss/auth
Helper library for working with token server.  
rss token authenticatoin strategy for passport.
## Installation

```bash
$ npm install @rss/auth
```

# Server Usage (express.js)

## Initialize 

TokenHelper must be initialize before first using any method on it or passing it into the strategy.

```js
const TokenHelper = require('@rss/auth').TokenHelper;

TokenHelper.initialize({
  tokenClientName: config.TOKEN_CLIENT_NAME,
  tokenClientKey: config.TOKEN_CLIENT_KEY,
  tokenServerURL: config.TOKEN_SERVER_URL
});
```

### Available Options

TokenHelper initialize takes an hash value with the following options.

* `tokenClientName` - Required, client name registered with the token server
* `tokenClientKey` - Required, client key for the token server
* `tokenServerURL` - Required, url location of the token server
* `redis` - Optional, configuration options for redis.  if this is not defined then fallback to using memory-cache

## Configure Strategy

The rss authentication strategy authenticates users using a token passed in on the reqeust header.   The strategy requires a `verify` callback, which accepts valid decoded token and calls `done` providing a user.

```js
passport.use(new RssStrategy({ tokenHelper: TokenHelper }, function(decodedToken, done) {
    // load user
    const user = decodedToken;
    return done(null, user);
}));
```

### Available Options

This strategy takes an hash value with the following options

* `tokenHelper` - Required, TokenHelper after its been initialize

## Authenticate Requests

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

```js
app.post('/api/sample', 
  passport.authenticate('rss', { session: false }),
  function(req, res) {
    res.redirect('/');
  });
```

### Available Options

This strategy takes an hash value with the following options

* `session` - Options, save user to session - should be set to false
* `usage` - Optional, what token type is acceptable.  Default to all but can limit to `CLIENT` or  `USER`


## Token Helper API

### TokenHelper.clientToken()

Get a clientToken to use for communicating to other services.

```js
TokenHelper.clientToken().then(clientToken => {
  // clientToken can now be use for request
})
```

# Client Usage (angular)

## Initialize 

Client.checkIfAuthenticated should be call in the app.component 

```js
import { Client } from '@rss/auth/angular/client';

export class AppComponent {
  ngOnInit() {
    Client.checkIfAuthenticated(this.location, 'URL_TO_AUTHENTICATE_USER').then(() => {
      // user is authenticated - load profile
    });
  }
}

```

## Client API

### Client.checkIfAuthenticated(location, 'URL_TO_AUTHENTICATE_USER')

check if user is authenticate.  if not, redirect user to authentication url

### Client.getUserToken()

get user token if available

### Client.redirectToAuthentication('URL_TO_AUTHENTICATE_USER')

redirect user to token server for authentication
npm package: @rss/auth-angular
Description: auth module for angular
Latest version: 0.0.3

# @rss/auth-angular
Helper library for working with token server on angular 
## Installation

```bash
$ npm install @rss/auth-angular
```



# Client Usage (angular)

## Initialize 

Client.checkIfAuthenticated should be call in the app.component 

```js
import { Client } from '@rss/auth/angular-angular';

export class AppComponent {
  ngOnInit() {
    Client.checkIfAuthenticated(this.location, 'URL_TO_AUTHENTICATE_USER').then(() => {
      // user is authenticated - load profile
    });
  }
}

```

## Client API

### Client.checkIfAuthenticated(location, 'URL_TO_AUTHENTICATE_USER')

check if user is authenticate.  if not, redirect user to authentication url

### Client.getUserToken()

get user token if available

### Client.redirectToAuthentication('URL_TO_AUTHENTICATE_USER')

redirect user to token server for authentication
npm package: @rss/auth-react
Description: auth module for react
Latest version: 0.0.5

# @rss/auth-react

Helper library for working with token server on react

## Installation

```bash
$ yarn add @rss/auth-react
```

# Client Usage (react)

## Initialize

Client.checkIfAuthenticated should be call in the app.component

```js
import React from "react";

const Wrapper = () => {
  Client.checkIfAuthenticated("URL_TO_AUTHENTICATE_USER");
  return <App />;
};
```

## Client API

### Client.checkIfAuthenticated('URL_TO_AUTHENTICATE_USER')

check if user is authenticate. if not, redirect user to authentication url

### Client.getUserToken()

get user token if available

### Client.redirectToAuthentication('URL_TO_AUTHENTICATE_USER')

redirect user to token server for authentication