Giter VIP home page Giter VIP logo

amazon-auth-proxy's Introduction

Authentication Proxy Server of Amazon Product Advertising API.
(Amazon Product Advertising APIの認証を代替するPROXYサーバ)

■amazon-auth-proxy.cgi, amazon-auth-proxy.fcgi

amazon-auth-proxy.cgiは、RubyのCGIとして書かれています。従来の
Amazon ECS APIとして動作し、指定した言語のAmazon PAAPIに対して
有効な認証済みリクエストを作成して呼び出し元に返します。または
実際にAPIをコールしたのち、結果をそのまま返します。

amazon-auth-proxy.fcgiはFastCGI対応版です。内部的に.cgiを呼び出
しているので、.cgiも必要です。

amazon-auth-proxy.cgiは、同じディレクトリにあるamazon-auth-proxy.yaml
というファイルを読み、そこに記述されている各種APIキーとAPIのエ
ントリポイント、アソシエイトIDなどを使ってAPI呼び出しを構築しま
す(amazon-auth-proxy.sample.yamlを参照)。amazon-auth-proxy.yaml
には公開してはいけない情報が含まれるので、.htaccessなどによって
アクセスを禁止しなくてはいけません(dot.htaccess参照)。

amazon-auth-proxy.yamlで指定するentry_pointには、以下のような各
国向けAmazonのAPIエントリポイントURLを指定します:

   http://webservices.amazon.com/onca/xml
   http://webservices.amazon.co.jp/onca/xml
   http://webservices.amazon.fr/onca/xml
   http://webservices.amazon.co.uk/onca/xml
   http://webservices.amazon.de/onca/xml
   http://webservices.amazon.ca/onca/xml

また、Styleパラメタを使用したクエリのため、xslt_entry_pointとし
て以下のURLも指定してください:

   http://xml-us.amznxslt.com/onca/xml
   http://xml-jp.amznxslt.com/onca/xml
   http://xml-fr.amznxslt.com/onca/xml
   http://xml-uk.amznxslt.com/onca/xml
   http://xml-de.amznxslt.com/onca/xml
   http://xml-ca.amznxslt.com/onca/xml

use_redirectは、通常trueにして運用してください。これは構築した
AmazonへのリクエストURLを、302リダイレクトとして呼び出し元に返
すという意味です。これにより、proxyサーバの負荷を低減します。


■amazon-auth-proxy.rb
amazon-auth-proxy.cgiのSinatra版です。内部で.cgiを読み込んでい
るため、.cgiも必要です。

Sinatra版は、一つのインスタンスで各国サイトに対応します。このた
め、.cgiとは設定ファイルの形式が異なります。amazon-auth-proxy.sinatra.yaml
をamazon-auth-proxy.yamlに変え、access_keyとsecret_key、必要に応
じてdefault_aidを書き換えて利用して下さい。


■権利関係
Copyright (C) 2011 TADA Tadashi <[email protected]>
You can redistribute it and/or modify it under GPL2.

なお、module HMACは、えろぺおさんのコードを流用しています。
<http://elpeo.jp/diary/20090512.html#p01>

amazon-auth-proxy's People

Contributors

tach avatar tdtds avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.