Sha256: b97ea1fbd8ce595eebf34525838d7c4a1ec1d756f055d0953390ad89dc2aa89e

Contents?: true

Size: 483 Bytes

Versions: 5

Compression:

Stored size: 483 Bytes

Contents

module ProxyAuth
  # management methods used for server maintenance
  class RegisterServicesController < ApplicationController
    before_action :authenticate

    def create
      ProxyAuth::Token.instance.register_service
      head :ok
    end

    private

    def authenticate
      authenticate_with_http_basic do |user, password|
        secrets = Rails.application.secrets
        secrets.admin_login == user && secrets.admin_password == password
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
proxy_auth-0.0.6 app/controllers/proxy_auth/register_services_controller.rb
proxy_auth-0.0.5 app/controllers/proxy_auth/register_services_controller.rb
proxy_auth-0.0.4 app/controllers/proxy_auth/register_services_controller.rb
proxy_auth-0.0.3 app/controllers/proxy_auth/register_services_controller.rb
proxy_auth-0.0.2 app/controllers/proxy_auth/register_services_controller.rb