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

@teamfabric/authorizer-commmerce

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teamfabric/authorizer-commmerce

Authorizer for protected routes on applications that use commerce identity

  • 2.1.2-0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

README

Global Authorizer function to authorize protected routes

How do I get set up?

  • Summary of set up ** npm install @teamfabric/authorizer ** Add a route under a /app/routes/auth/authorizer.js Copy and paste below
const { authorize } = require('@teamfabric/authorizer')
exports.handler = async event => {
  return authorize(event)
}

In your serverless.yml add the handeer to the route above

functions:
  authorizerFunc:
    handler: app/routes/auth/authorize.handler

For routes you want to protect add

authorizer:
    name: authorizerFunc # execute this before function call!
    resultTtlInSeconds: 0

For example

user-get:
    name: ${self:provider.apiName}-user-get
    memorySize: 512
    handler: app/routes/user/core/get.handler
    events:
      - http:
          method: get
          path: /user/{userId}
          private: true
          authorizer:
            name: authorizerFunc # execute this before function call!
            resultTtlInSeconds: 0

TO DO

  • move the jwt public and private key to files

FAQs

Package last updated on 11 Oct 2022

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