All Projects → tdtds → amazon-auth-proxy

tdtds / amazon-auth-proxy

Licence: other
【PA-API v4のサポート終了にともない、このリポジトリは2020年3月に閉鎖されました】

Programming Languages

ruby
36898 projects - #4 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to amazon-auth-proxy

selling-partner-api-sdk
Golang toolkit for working with Amazon's Selling Partner API (SP-API)
Stars: ✭ 48 (+37.14%)
Mutual labels:  amazon
aws-ses-sns-dashboard
Dashboard for AWS SES notifications
Stars: ✭ 25 (-28.57%)
Mutual labels:  amazon
django-eb-sqs-worker
Django Background Tasks for Amazon Elastic Beanstalk
Stars: ✭ 27 (-22.86%)
Mutual labels:  amazon
Holly-Quintet
A web app used for searching disks' covers from a series of music websites.
Stars: ✭ 22 (-37.14%)
Mutual labels:  amazon
Selfhosted-Google-Photos-Alternative
A complete guide on exiting Google, Amazon or any proprietary service Photos storage with all the features you would want.
Stars: ✭ 143 (+308.57%)
Mutual labels:  amazon
android device amazon karnak
Android device tree for the Amazon Fire HD8 2018
Stars: ✭ 38 (+8.57%)
Mutual labels:  amazon
google-aws-federator
A small command line tool to help manage AWS Federated Identities authenticated through Google Apps
Stars: ✭ 29 (-17.14%)
Mutual labels:  amazon
aws
Object Pascal implementation for Amazon S3
Stars: ✭ 67 (+91.43%)
Mutual labels:  amazon
affiliate
Add affiliation tags to links automatically in the browser
Stars: ✭ 77 (+120%)
Mutual labels:  amazon
vpc-peering-operator
A Kubernetes Operator to manage the lifecycle of AWS VPC Peering Connections
Stars: ✭ 23 (-34.29%)
Mutual labels:  amazon
amazon wishlist pricewatch
Periodically check your public Amazon wishlist for price reductions.
Stars: ✭ 22 (-37.14%)
Mutual labels:  amazon
Amazon-Price-Alert
Price tracker of Amazon
Stars: ✭ 83 (+137.14%)
Mutual labels:  amazon
aws-codeguru-profiler-demo-application
Example application demonstrating the features of Amazon CodeGuru Profiler
Stars: ✭ 21 (-40%)
Mutual labels:  amazon
sendhereplz
Quick identification of Amazon products with shipping restrictions
Stars: ✭ 30 (-14.29%)
Mutual labels:  amazon
Amazon-Flipkart-Price-Comparison-Engine
Compares price of the product entered by the user from e-commerce sites Amazon and Flipkart 💰 📊
Stars: ✭ 41 (+17.14%)
Mutual labels:  amazon
agw
Route AWS APIGateway to lambda with standard router such as mux
Stars: ✭ 24 (-31.43%)
Mutual labels:  amazon
amazon-ec2-image-builder-samples
Samples for Amazon EC2 Image Builder
Stars: ✭ 103 (+194.29%)
Mutual labels:  amazon
mws-product
A module for retrieving product information via Amazon MWS API
Stars: ✭ 40 (+14.29%)
Mutual labels:  amazon
buildAPKsApps
Android APK app sources that build in Termux on Amazon Fire, Android and Chromebook! https://sdrausty.github.io/buildAPKsApps/
Stars: ✭ 32 (-8.57%)
Mutual labels:  amazon
dailycodingproblem
Solutions to Daily Coding Problem questions
Stars: ✭ 26 (-25.71%)
Mutual labels:  amazon

Authentication Proxy Server of Amazon Product Advertising API.

(Amazon Product Advertising APIの認証を代替するPROXYサーバ)

amazon-auth-proxyの実行環境には以下の3種類があります。この ドキュメントではそれぞれについて順に説明します。

  • CGI, FastCGI
  • Sinatra
  • Docker

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に変えて利用して下さい。

HerokuのようなPaaSでの利用を考慮して、access_keyとsecret_keyは それぞれ以下の環境変数を優先して使うようになっています:

AMAZON_ACCESS_KEY
AMAZON_SECRET_KEY

お使いのPaaSに応じて上記の環境変数を設定して下さい。また、Amazon 側の仕様変更により、AssociateTag(aid)が指定されていない国のAmazon は利用できなくなっています。自分が管理しているAssociateTagをaid に指定して下さい。例:

aid:
  jp: cshs-22
  us: tdiarnet-20

Sinatora版では、リバースプロキシサービス向けのrpaproxy.yamlも自動 生成します。aidで指定した国のみのrpaproxy.yamlを生成します。名前 としてamazon-auth-proxy.yamlのnameを利用するので忘れずに書き換えて 下さい。

Dockerを使った実行

Sinatra版のDockerイメージを提供しています。下記のようにして実行して ください。

access_keyとsecret_keyをamazon-auth-proxy.yamlに記述した場合:

% docker run --name amazon-auth-proxy \
  -v $(pwd)/amazon-auth-proxy.yaml:/app/amazon-auth-proxy.yaml:ro \
  -p 80:80 tdtds/amazon-auth-proxy:latest

access_keyとsecret_keyを環境変数で与える場合:

% docker run --name amazon-auth-proxy \
  -v $(pwd)/amazon-auth-proxy.yaml:/app/amazon-auth-proxy.yaml:ro \
  -e AMAZON_ACCESS_KEY=【YOUR_ACCESS_KEY】 \
  -e AMAZON_SECRET_KEY=【YOUR_SECRET_KEY】 \
  -p 80:80 tdtds/amazon-auth-proxy:latest

権利関係

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].