1.2.2 • Published 1 year ago

simple-security v1.2.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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
1.2.2

1 year ago

1.2.0

1 year ago

1.2.1

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago