Sha256: 8b755ff727cb7f8587be2cf5f9fcb123be07dbe60028bd76c0db109124820a42

Contents?: true

Size: 569 Bytes

Versions: 19

Compression:

Stored size: 569 Bytes

Contents

class Maestrano::Rails::WebHookController < ApplicationController
  skip_before_filter :verify_authenticity_token
  before_filter :authenticate_maestrano!
  
  private
    def authenticate_maestrano!
      # Matches the credentials against the ones configured for the tenant preset
      authorized = authenticate_with_http_basic do |app_id, api_token|
        Maestrano[params[:tenant]].authenticate(app_id, api_token)
      end
      unless authorized
        render json: {error: 'Invalid credentials' }, status: :unauthorized
      end
      return true
    end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
maestrano-rails-1.0.4 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.3 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.2 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC8 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC7 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC6 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC5 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC4 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC3 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC2 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-1.0.0.pre.RC1 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-0.15.4 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-0.15.2 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-0.15.1 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-0.15.0 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-0.14.0 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-0.13.0 app/controllers/maestrano/rails/web_hook_controller.rb
maestrano-rails-0.12.0 app/controllers/maestrano/rails/web_hook_controller.rb