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

webaccess-strapi

v1.7.0

Published

WebAccess Strapi Plugin.

Downloads

20

Readme

WebAccess Strapi Plugin

Strapi access management based on JWT.

Motivation

Strapi does not offer access management nor does it have to offer because the needs can be very different from case to case. Moreover, we can have multiple Strapi applications installed which would mean that each application manages its access separately. That is why there was a need to be able to control the access centrally.

Installation

WebAccess Strapi is a plugin of the broader project WebAccess. Install webaccess first, then inside of it install this plugin:

npm run action install webaccess-proxy -- -p strapi

Note: optionally an older version can be installed by adding parameter -v 1.2.3

npm run action uninstall webaccess-proxy -- -p strapi

How it works

By default on login Strapi responds with a json web token in the response body. WebAccess is filtering the token and save it in the database, and replaces that token with own token based on the payload of the Strapi's token. From this point on WebAccess takes the access management responsability. The Strapi token is valid one month, but accessing Strapi through WebAccess will allow us to adjust the validity interval along with other JWT options according our needs. Moreover, WebAccess can manage the token validation separately for each host. For example, if the host is configured to expire the token in 30 minutes (default) and the user uses the token within this interval the token validity is automatically extended for the next 30 minutes (this is the sliding expiration used by default). If the token expires user has to re-login into Strapi app. If is desired to let token to be valid the entire browser session the frontend framework must use the token to ping WebAccess within it's validity interval. In conjunction with Strapi's token many other WebAccess modules can be used to achieve granullar access control to servers, routes, services or proxies not just to the token providing Strapi app. Please read WebAccess docs for the full list of options.

login sequence

Some usage ideas

Basic usage (my current case)

  • use Strapi as authentication provider and as a keeper for secure user data
  • add a new TEXT field in Strapi User Content Type named audience to hold the domain names that user has access to
  • use WebAccess to manage the access to that Strapi db

Separate the admin channel from the regular user channel

  • You may block admin routes in downstream server and stil have centralized access on localhost or local network through this proxy.

Multiple Strapi apps, and another Strapi app for central user management

  • configure the first basic scenario
  • configure your other Strapi apps with public data only. This way those apps can perform faster, can be placed on other server, can use load balancer, and so on. Take advantage from the fact that less than 10% of requests goes to secure user data.

External api connections

  • Use this proxy to perform external api requests in the backend instead of frontend, it increases the security.

License

MIT