Coder Social home page Coder Social logo

zaikio-webhooks's People

Contributors

cweyer avatar dependabot-preview[bot] avatar dependabot[bot] avatar jalyna avatar nickcampbell18 avatar sweidlich avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zaikio-webhooks's Issues

Authentication using `ApplicationController#before_filter` affects Webhook engine

Problem

In Mission Control, the ApplicationController enables authentication using a before_filter. Zaikio::Webhooks::WebhooksController, which inherits from MC's ApplicationController, inherits this filter, effectively preventing webhooks from being delivered.

Cause

The webhook engine's Zaikio::Webhooks::WebhooksController inherits from ApplicationController, but doesn't define it's own ApplicationController.

Ideas

I've worked around the issue by creating a custom controller + route:

# app/controllers/webhooks_controller.rb
class WebhooksController < Zaikio::Webhooks::WebhooksController
  skip_before_filter :ensure_authentication, only: %i[receive_event]
end

# config/routes.rb
post "/zaikio/webhook/:client_name", to: "webhooks#receive_event"

I was wondering whether this is the most appropriate solution, or whether it makes sense to include a plain ApplicationController in the Webhook engine, or to include some other mechanism of un-requiring authentication for the webhooks engine.

Other repos (e.g. zai-procurement) don't run into this issue because they have a different controller structure:
ApplicationController (not authed)
Consumers::ApplicationController < ApplicationController (authed)
Suppliers::ApplicationController < ApplicationController (authed)

Thoughts?

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.