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

brightspace-auth-token

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brightspace-auth-token

Helper for interacting with an incoming Brightspace JWT

  • 3.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
703
increased by19.56%
Maintainers
1
Weekly downloads
 
Created
Source

brightspace-auth-token

Build Status

Example

const AuthToken = require('brightspace-auth-token');

function *authMiddleware (next) {
	const jwtSignature = this.headers.authorization; // or cookies
	const validatedJwtPayload = yield things(jwtSignature);

	const token = new AuthToken(vanillaPayload, jwtSignature);

	this.auth = token;

	yield* next;
};

// ...

function *handleReq () {
	if (this.auth.hasScope('valence', 'apps', 'manage')) {
		// things so hard
	}

	if (this.auth.isUserContext()) {
		// this token is for a user
	}
}

Testing

npm test

Contributing

  1. Fork the repository. Committing directly against this repository is highly discouraged.

  2. Make your modifications in a branch, updating and writing new unit tests as necessary in the spec directory.

  3. Ensure that all tests pass with npm test

  4. rebase your changes against master. Do not merge.

  5. Submit a pull request to this repository. Wait for tests to run and someone to chime in.

Code Style

This repository is configured with EditorConfig, jscs and JSHint rules. See the docs.dev code style article for information on installing editor extensions.

FAQs

Package last updated on 06 Jan 2016

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