/examples/hmac_api/hmac_api.hrl

http://github.com/basho/mochiweb · Erlang · 43 lines · 15 code · 5 blank · 23 comment · 0 complexity · 1d02614921bbcfc74225c7f5a828f968 MD5 · raw file

  1. -author("Hypernumbers Ltd <gordon@hypernumbers.com>").
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. %%% %%%
  4. %%% Reference values for testing against Amazon documents %%%
  5. %%% %%%
  6. %%% These need to be changed in production! %%%
  7. %%% %%%
  8. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. -define(schema, "AWS").
  10. %% defines the prefix for headers to be included in the signature
  11. -define(headerprefix, "x-amz-").
  12. %% defines the date header
  13. -define(dateheader, "x-amz-date").
  14. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  15. %%% %%%
  16. %%% Default values for defining a generic API %%%
  17. %%% %%%
  18. %%% Only change these if you alter the canonicalisation %%%
  19. %%% %%%
  20. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  21. %%-define(schema, "MOCHIAPI").
  22. %%-define(headerprefix, "x-mochiapi-").
  23. %%-define(dateheader, "x-mochiapi-date").
  24. %% a couple of keys for testing
  25. %% these are taken from the document
  26. %% % http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html
  27. %% they are not valid keys!
  28. -define(publickey, "0PN5J17HBGZHT7JJ3X82").
  29. -define(privatekey, "uV3F3YluFJax1cknvbcGwgjvx4QpvB+leU8dUj2o").
  30. -record(hmac_signature,
  31. {
  32. method,
  33. contentmd5,
  34. contenttype,
  35. date,
  36. headers,
  37. resource
  38. }).