Socket
Socket
Sign inDemoInstall

simple-security

Package Overview
Dependencies
166
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-security

Simple security methods


Version published
Weekly downloads
16
decreased by-86.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

simple-security

Simple security library to work with firebase

Example in firebase

exports.endpoint = onRequest( async (request, response) => {
    if ( await simpleSecurity(request, { allow_jwt:false, allow_s2s:true, allow_basic:false }) ){
        if (request.method === "POST"){
            //....
        }
        return response.sendStatus(405);
    }else{
        return response.sendStatus(403);
    }
}

Required Env variables:

  • AUTHENTICATION_FIREBASE_API_KEY
  • AUTHENTICATION_FIREBASE_AUTH_DOMAIN
  • AUTHENTICATION_FIREBASE_PROJECT_ID
  • AUTHENTICATION_FIREBASE_STORAGE_BUCKET
  • AUTHENTICATION_FIREBASE_MESSAGEING_SENDER_ID
  • AUTHENTICATION_FIREBASE_APP_ID

BOOLEANS: true means that is uuid header is required on S2S auth

  • SECURITY_S2S_UUID_REQUIRED
  • DEFAUT_ALLOW_JWT
  • DEFAULT_ALLOW_BASIC
  • DEFAULT_ALLOW_S2S
  • DEFAULT_JWT_BLOCK_ANONYMUS
  • REQUIRE_UUID_ON_JWT
  • REQUIRE_UUID_ON_BASIC

TOKENS

  • AUTHENTICATION_S2S_TOKEN
  • API_TOKEN_URL_VALIDATOR

Keywords

FAQs

Last updated on 17 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc