Code Monkey home page Code Monkey logo

oto's Introduction

BeCode: oto

⚙️ Oto, the man in the middle - OAuth2 middleware lambda


About

By design, you cannot use OAuth2 without a server, since you need to store a secret key from the provider.
In a world full of PWA and static websites, it´s a bummer.

oto is a small middleware, a lambda serverless function, which only role is to serve as the server in a OAuth2 transaction.

Read the dev.to article introducing oto & its purpose.

Installation

Firstly, run the classic npm install to install dependencies.

You will also need to create the file env/sls.env.json, following this structure:

{
  "dev": {
    "PROVIDER_ACCESSID": "ACCESSKEY",
    "PROVIDER_ACCESSID": "ACCESSKEY"
  }
}

It can contains as many values as you want (like for different stages of development).

The PROVIDER value is the service to connect, like github ; ACCESSID is the public access id given by the service ; ACCESSKEY is the private access key given by the service.

Example:

{
  "dev": {
    "github_xxxxxx": "xyzxyzxyzxyz"
  }
}

Supported providers

  • github
  • linkedin
  • google

Usage

Run npm run build to build the code, or npm run work to watch the changes and rebuild.

Run npm run dev to create a local host serving the lambda, on port 6060.

Deployment

You need to have setup the appropriate user from AWS and stored it in your ~/.aws/credentials.

Dev deployment

npm run deploy:dev --aws-profile=<your-aws-profile>

Production deployment

npm run deploy:prod --aws-profile=<your-aws-profile>

🤟 You are working on a project for BeCode and want to use oto?
Contact My Becode Team [email protected] via email to inject your app's credentials and use our instances!


My Becode Team

oto's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar graphtylove avatar leny avatar ludovicpatho avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

oto's Issues

🚀 Deploy on AWS

Perform a deploy on AWS (use oto.becode.xyz).

  • leave the env var control to AWS interface
  • update the README
  • add note in the README about the usage of the dev/prod for inside project in BeCode
  • publish the medium article

🧮 Move deploy script onto GitHub Actions

We now have (finally) access to the GitHub Actions beta (had access on my personal account since a few months).

It will be more maintainable to move the deploy process onto it, less error-prone.

Notes

TODO

  • Encrypt env file and store it in the repo (put the passphrase in 1password)
  • Remove deploy-related scripts from package.json file
  • Write GitHub Action workflow with the following steps:
    • Prepare npm env & install dependencies
    • Create env file from secrets
    • Build sources with babel
    • Create release on Sentry
    • Associate commits to release on Sentry
    • Deploy to sls
    • Inform Sentry for the release

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.