Code Monkey home page Code Monkey logo

helix-auth-fastly's Introduction

Helix Auth Fastly

Authenticate Helix actions against Fastly

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript semantic-release

Installation

$ npm install @adobe/helix-auth-fastly

Usage

As a wrapper

helix-auth-fastly is a wrapper around OpenWhisk actions to that ensures that invocations of the action are only successful if valid Fastly credentials, in the forms of a service ID and token, are provided.

helix-auth-fastly can also be used as a simple single-purpose function to validate a pair of Fastly credentials.

To use the helix-auth-fastly wrapper set up your OpenWhisk action like this:

const { wrap } = require('@adobe/openwhisk-action-utils'};
const { fastlyAuthWrapper } = require('@adobe/helix-auth-fastly'); 

const main = () = {
  // your action code goes here
};

module.exports.main = = wrap(action)
  .with(fastlyAuthWrapper, {token: 'tokenName', service: 'serviceName'});

Invocations of your action that do not provide valid credentials will fail with an HTTP status code of 401 (Unauthorized) and your main function will never be called.

Standalone

To use helix-auth-fastly conditionally; you can also execute:

const { authFastly } = require('@adobe/helix-auth-fastly');

if(await authFastly(token, service)){
    //authentication has succeeded
} else {
    //authentication has failed
}

See the API documentation.

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint

helix-auth-fastly's People

Contributors

dependabot[bot] avatar marquiserosier avatar renovate-bot avatar renovate[bot] avatar rofe avatar semantic-release-bot avatar trieloff avatar tripodsan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helix-auth-fastly's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency @semantic-release/git to v9.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.