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 🙏

© 2026 – Pkg Stats / Ryan Hefner

decentraland-auth-protocol

v0.3.2

Published

Auth protocol Implementation

Readme

auth-ts

Authentication protocol library implementation in TypeScript

Credentials generation

The only supported credential type for the time being, are the 'third-party' credentials.

Third Party credentials

This type of credential require the intervention of a third party (authentication server) in order to authenticate the user against a service provider

 const timeToLive = 10 // In seconds
 const k = SimpleCredential.generateNewKey(timeToLive)

Request credentials generation

const messageToSend = MessageInput.fromMessage(messageContent) // messageContent is a buffer
const timeToLive = 10 // In seconds
const k = SimpleCredential.generateNewKey(timeToLive)
const messageCredentials = k.makeMessageCredentials(messageToSend, accessToken) // Access Token given by the third party. To generate one you will need to send the ecdsa public key generated as part of the credential generation process

// If the message is an http request
const method = 'POST'
const url = 'www.decentraland.org/something'
const body = Buffer.from(
    JSON.stringify({ param1: 'data1', param2: 'data2' }),
    'utf8'
  )
const httpMessage = MessageInput.fromHttpRequest(method, url, body)
const messageCredentials = k.makeMessageCredentials(httpMessage, accessToken) // Access Token given by the third 
messageCredentials.set('Content-Type', 'application/json') //And the rest of your headers
const response = await fetch(path, {
    method: 'post',
    headers: headers,
    body
})
Generated Credentials

| Header | Meaning | | ------------- | ------------- | | x-signature | This is the signed request information (http method + url + body + timestamp) with the generated ephemeral key. This is vital to prevent replay attacks. | | x-timestamp | Request timestamp, in Unix time. | | x-auth-type | Indicates the type of credential, in this case “third-party” | | x-identity | The users ephemeral public key used in the access token creation and the user ID | | x-access-token | Access token. Contains the public ephemeral key and it is signed by the granting authority with its own private key. |

Request validation

The service providers will need to authenticate the users based on the information present in the request headers.

Authentication Strategies

We define three basic Authentication strategies

Third party strategy

The service provider will need to know the entity who signs the access token, otherwise, the request will be rejected.

const timeToLive = 10 // In seconds
const authServicePubKey = ... // Pem encoded public key of the trusted auth service
const authn = AuthenticationFactory.createThirdPartyStrategy(timeToLive, authServicePubKey})

const authProvider = new AuthProvider(authn, new AuthorizeAllStrategy())

const req: AuthRequest = ...

const result: Result = authProvider.validateRequest(req)

Allow All

const authn = new AuthenticateAllStrategy()
const authz = new AuthorizeAllStrategy()

Copyright info

This repository is protected with a standard Apache 2 licence. See the terms and conditions in the LICENSE file.