blobby-auth-header

0.2.0 • Public • Published

blobby-auth-header

An HTTP Authorization client for Blobby to enable secure API operations.

Options

# config/local.js
module.exports = {
  auth: {
    apiKey: {
      driver: 'blobby-auth-header',
      options: {
        apiKey: 'mySecretAPIKey that really belongs in a secure configuration file',
        test: /ApiKey\s(.*)/ // my custom Authorization header parser
      }
    }
  },
  storage: {
    myStorage: {
      driver: 'blobby-s3',
      auth: 'apiKey',
      options: {...} // see https://github.com/asilvas/blobby-s3 for S3 options
    }
  }
};
Option Type Default Desc
apiKey string (required) Secret to access secure routes in Blobby REST API
test RegExp /apikey\s(.*)/i Expression used to parse HTTP Authorization header

Secrets

Recommended to store your apiKey in blobby's Secure Configuration.

Example Usage

Start my server:

blobby server

Upload a file:

curl -XPUT -H "Authorization: ApiKey mySecretAPIKey that really belongs in a secure configuration file" --data-binary "@./some-file.jpg" http://localhost/myStorage/some/file.jpg

Readme

Keywords

none

Package Sidebar

Install

npm i blobby-auth-header

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

3.44 kB

Total Files

4

Last publish

Collaborators

  • asilvas