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

github-middleman

v0.1.2

Published

A middleman between github.com organizations and internal authentication methods

Downloads

2

Readme

middleman

A middleman service provider between any Passport auth strategy and Github Organizations.

Why would I need it?

Does your company use a Github paid tier account (not Enterprise Edition)? If the answer is yes ... carry on. Is your Github organization large and uruly? Do you have users no longer with the company still in Github? If yes, continue. Do you need a way to communicate effectively with everyone in your organization, but half of their public profiles are lacking?

Get the picture? Middleman is meant to solve one very specific problem that many large organizations face. You need a simple method of stitching your accounts together with Github Organizations. Middleman provides that bridge.

What does it do exactly?

Middleman allows you to configure any Passport auth strategy as your login point. We've defaulted to SAML b/c it's what suited the needs best, but feel free to fork the repo and change it. Once a user has authenticated via your preferred authentication strategy, the user will be asked to autorize the app to their Github account. Upon completing the OAuth flow, your users will be presented with a list of available Organizations to join, upon joining they'll be emailed an invite to accept. Once they do that ... the magic is done. Your internally authenticated users are now authorized members of your Github Organization.

Prerequisites

  1. brew install mongodb
  2. nvm install 5.0
  3. nvm use 5.0
  4. Install NVM
  5. 'mongod' (run this in a new terminal tab)

Usage

First, clone the repository to get started, then from the root of the project run the following.

  1. npm install
  2. npm start

Configuration

Environment Variables

The following environment variables are required for middleman to run.

GITHUB_ADMIN_TOKEN=Admin User Token for the Organization you want to manage
GITHUB_CLIENT_ID=OAuth Application Token
GITHUB_CLIENT_SECRET=OAuth Application Secret
GITHUB_CALLBACK_URL=/auth/github/callback

In addition you will need to add any additional variables for your Passport Auth Strategies, an example of the values required for SAML authentication are below.

SAML_ENTRY_POINT=https://login.com/sso
SAML_LOGOUT_URL=https://logout.com/slo
SAML_CERT=./path/to/cert.pem
SAML_PRIVATE_CERT=./path/to/cert.key
SAML_ISSUER=issuer-string
SAML_CALLBACK_URL=/auth/saml/callback

App Configuration

Configuration is setup in config/default.json, check it out to get running. Below are some of the more important configuration options.

Github

Github configuration consists of an oranizations object that controls which organizations you'll be managing, as well as how.

"github": {
    "organizations": [
        {
            "name": "MyOrganization",
            "enforce2FA": true
        }
    ]
}