npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jscas-server

v1.0.1

Published

An implementation of Apereo's CAS protocol

Downloads

7

Readme

JSCAS

JSCAS provides a Node native implementation of a CAS server. It is extensible via a simple plugin interface, and implements versions 1.0, 2.0, and 3.0 of the protocol. It currently supports the authentication and service validation mechanisms of all three versions; proxy support will be added later.

In general, JSCAS attempts to meet the following goals:

  1. Be more easily customizable than the standard reference implementation.
  2. Be easily extensible through plugins.
  3. "Just work" with a minimal amount of configuration (due the protocol's nature, some configuration is absolutely required).

Protocol compatibility special note: this server will prefer adhering to the latest version of the protocol when supporting all versions would be too cumbersome. For example, the potential redirect on logout. In version 2.0 the service could send a url parameter. In version 3.0, that was deprecated in favor of a service parameter. This server does not recognize the url parameter at all.

Demo

A demonstration deployment of the server, and a sample application, ships with the server. To try it out:

  1. Clone the repository: git clone https://github.com/jscas/jscas-server.git
  2. Navigate to the directory: cd jscas-server
  3. Update hosts file: echo '127.0.0.1 app.example.com cas.example.com' >> /etc/hosts
  4. Run docker-compose: docker-compose up
  5. Navigate to http://app.example.com:3000 in a web browser

Note: the configuration for this demonstration is not recommended for production. It uses lax cookie settings in order to make it work on Chrome since Chrome doesn't work correctly with local test URLs otherwise.

Install

Via Git

$ git clone https://github.com/jscas/jscas-server
$ cd jscas-server
$ npm install --production
$ npx jscas-server -s > jscas.yaml
$ npm install --production abstract-cache-redis
$ nixconfig_config_home=$(pwd) npx jscas-server

As A Dependency

It is possible to add JSCAS as a dependency of a project. This allows one to create a project that is specifically the configuration for the server instance:

$ mkdir my-cas-server && cd my-cas-server
$ echo "{}" > package.json
$ npm install --save jscas-server

At this point a configuration will be needed. So let's use the included example configuration:

$ npx jscas-server -s > jscas.yaml

This configuration relies on an Redis server being present. So, assuming Redis is already running on the local host (otherwise modify the configuration accordingly):

$ npm install --save abstract-cache-redis

And now, the server is ready to start:

$ NODE_PATH=$(pwd)/node_modules nixconfig_config_home=$pwd npx jscas-server

At this point the server is listening on port 9000 with a very basic, non-production, configuration.

License

MIT License