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