Amazon Webservices HMAC-style API example #53

Merged
merged 4 commits into from Jul 28, 2011

2 participants

@hypernumbers

I have added another example.

It is a reference implementation of an AWS-style HMAC public/private keypair API for use with mochiweb.

It contains:

  • a client-side implementation in Erlang
  • server-side implementation in Erlang

It has a full test suite which is designed to be ported in other languages so that API clients can be built with native unit tests and not debugged against a production system.

It also have full implementation documentation and references.

hypernumbers added some commits Jul 22, 2011
@hypernumbers hypernumbers An example of an Amazon Web Services style HMAC api for mochiweb.
This is designed to make it easy to build API authentication without re-inventing the crypto/schema wheel.

It should enable a common set of client libraries to be built.

Includes:
* complete documentation of:
  - the schema
  - the reference implementation
  - how to create and deploy a custom implementation
* unit tests against the Amazon API documentation
2d3e7ea
@hypernumbers hypernumbers tweak to doco 6664d2a
@etrepum
Mochi Media, Inc. member

Wow, I only took a very brief look at this but it seems like really great stuff. I'll try and give it a full look this weekend and merge it in!

@etrepum
Mochi Media, Inc. member

I would probably define this as a string and use "?headerprefix ++ L" rather than [?headerprefix | L]". Easier to read and should be about the same in modern erlang since it's a constant.

@etrepum
Mochi Media, Inc. member

I think there's a typo here, "x-mochiwapi-" does not match "x-mochiapi-date". Not that it matters, since this code is commented out.

Well spotted!

@etrepum
Mochi Media, Inc. member

I think there is a syntax error here, the RFC2116_HT define doesn't end and there's probably no reason to put export_all in anyway

Dunno how that define losts it end bit. Must have been an emacs fart somehow.

Yeah, and the export_all should have been taken out, its a debugging artifact.

Erlang bugs pointed out that the preprocesser thinks this is the define:

-defineRFC2116_HT, "\t" -compile(export_all).

As I was neither using the define or export_all I never got a runtime error (Duh!).

Anyhoo removed 'em both on the grounds of redundancy.

@etrepum
Mochi Media, Inc. member

In general we use %% comments everywhere because erlang-mode indents them correctly, so after merging this I'm probably going to do some reformatting.

hypernumbers added some commits Jul 26, 2011
@hypernumbers hypernumbers Fix up of README
Proper spell-checking and re-read for sense. A couple of minor additions but mostly spelling/grammer
c135144
@hypernumbers hypernumbers Fixed up the code
Removed the misformed define (and reported it to erlang-bugs as it shouldn't have ever compiled)
Rewritten the headers stuff
Removed export all
e6e40d7
@etrepum etrepum merged commit e6e40d7 into mochi:master Jul 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment