New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ebay-notification_api-verifier

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebay-notification_api-verifier

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Ebay::NotificationApi::Verifier

The Ruby implementation of eBay Notification API verification.

In future it might be used for different cases, but for now eBay requires third–party applications that store user data to implement eBay Marketplace Account Deletion/Closure Notifications Workflow. When such HTTP request is received, the backend must ensure, that this request is coming from eBay:

class EbayAccountDeletionController < ApplicationController
  def account_deletion_notification
    # eBay wants an immediate response, so we should postpone the deletion
    EbayAccountDeletionWorker.perform_async(params, request.headers["x-ebay-signature"])
    head :ok
  end
end

class EbayAccountDeletionWorker
   include Sidekiq::Worker

  def perform(message, signature)
    return unless Ebay::NotificationApi::Verifier.valid_message?(message, signature)

    # delete data
  end
end

⚠️ Heads up! Currently eBay supports only ECDSA/SHA1 encryption, and so does the gem. If something different is passed to the Verifier, the Ebay::NotificationApi::Verifier::WrongAlgorithm would be raised. ⚠️

Installation

Add this line to your application's Gemfile:

gem 'ebay-notification_api-verifier'

Since we have to perform a request to fetch the public key, the ability to get application token should be provided to the verifier. You can pass any callable object:

Ebay::NotificationApi::Verifier.application_token_proc = proc { "token" }
Ebay::NotificationApi::Verifier.application_token_proc = Ebay::TokenFetcher.fetch

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dmitrytsepelev/ebay-notification_api-verifier.

License

The gem is available as open source under the terms of the MIT License.

Sponsored by Evil Martians

FAQs

Package last updated on 20 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc