nkroker / dux

A simple Webhook forwarding app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dux

A simple solution for managing webhooks for Dev-Env

About

Currently dux is in development stage. At present it is an API which provides you global endpoints as forwards


Anatomy of Requests

1. Authentication

For authentication here we have JWT built in for that you need to sign up it is also done by API as well simply make a post request

  • Endpoint: /users
 Params
    ├── `email`
    ├── `username`
    └── `password`
  • Sample:
  curl \
    --location \
    --request \
    POST 'http://localhost:3000/users?username=funkeyUsername&email=sample@example.com&password=pass-word'

Response

  {
      "data": {
          "id": "44ad73d8-87b8-4e47-a3e4-46f72ac70052",
          "type": "user",
          "attributes": {
              "email": "sample@example.com",
              "username": "funkeyUsername",
              "api_key": "eyJhbGciOiJIUzI1NiJ9.BIG FAT API KEY",
              "created_at": "2021-06-09T18:24:21.969Z"
          }
      }
  }


2. Adding Forwards

Forward consists of two things: - global_url this is the dux's own hosted url mixed with identifier on which you can send your webhooks. - local_url this you can set by sending a post request at

  • endpoint: /forwards/add
 Params
    └── `url`
  • Sample:
  curl \
  --location \
  --request \
  POST 'http://localhost:3000/forwards/add?url=https://google.com' \
    --header 'Authorization: eyJhbGciOiJIUzI1NiJ9.PRETTYLONG API KEY' \
    --header 'Cookie: __profilin=p%3Dt'

Response

  {
      "data":{
          "id":"f94fa966-2ad3-47b3-bbb3-47576baf963f",
          "type":"forward",
          "attributes":{
              "global_url":"http://localhost:3000/forwards/5bc2ad83-b0df-41b4-b465-f0ead4110f48/direct",
              "active":true,
              "created_at":"2021-06-09T17:29:38.357Z"
          }
      }
  }


3. To-Do:

  • Add Test Cases WIP 👨‍💻
  • Implement Responsive Web Views
  • Implement 2FA at View
  • Reduce Query timings
  • Implement Better Request Save
  • Implement Logging for forward_hooks
  • Implement Scheduled webhook forwards to local_url

Original Docs

About

A simple Webhook forwarding app


Languages

Language:Ruby 76.9%Language:HTML 9.5%Language:JavaScript 7.5%Language:Shell 4.2%Language:CSS 1.2%Language:Dockerfile 0.7%