packages feed

serverless-haskell 0.7.5 → 0.8.1

raw patch · 5 files changed

+57/−12 lines, 5 files

Files

README.md view
@@ -2,6 +2,7 @@  [![Build status](https://img.shields.io/travis/seek-oss/serverless-haskell.svg)](https://travis-ci.org/seek-oss/serverless-haskell) [![Hackage](https://img.shields.io/hackage/v/serverless-haskell.svg)](https://hackage.haskell.org/package/serverless-haskell)+[![Stackage LTS](https://www.stackage.org/package/serverless-haskell/badge/lts)](https://www.stackage.org/lts/package/serverless-haskell) [![Hackage dependencies](https://img.shields.io/hackage-deps/v/serverless-haskell.svg)](https://packdeps.haskellers.com/feed?needle=serverless-haskell) [![npm](https://img.shields.io/npm/v/serverless-haskell.svg)](https://www.npmjs.com/package/serverless-haskell) @@ -43,7 +44,7 @@    provider:     name: aws-    runtime: nodejs8.10+    runtime: haskell    functions:     myfunc:@@ -104,8 +105,18 @@ [AWSLambda](https://hackage.haskell.org/package/serverless-haskell/docs/AWSLambda.html) for documentation, including additional options to control the deployment. -## Testing+## Development +Currently, apart from the `master` branch, an `v0.6.x` branch is maintained with+no breaking changes since 0.6.0, for inclusion into Stackage LTS 12. For+bugfixes and new features that do not change the existing behavior, please+target `v0.6.x`. For anything else, target `master`.++Changes to the LTS branch will be forward ported to the `master` branch after+releasing.++### Testing+ * Haskell code is tested with Stack: `stack test`. * JavaScript code is linted with `eslint`. @@ -126,12 +137,16 @@ * By default, the integration test is run with LTS 12. To specify a different series, use `RESOLVER_SERIES=lts-9`. -## Releasing+### Releasing +* Ensure you are on a correct branch (`v0.6.x` or `master`).+* Ensure that all the changes are reflected in the changelog. * Run the integration tests.-* Install [bumpversion](https://github.com/peritus/bumpversion): `pip install bumpversion`.-* Run `bumpversion major|minor|patch`.-* Run `git push --tags && git push`.+* Run `./bumpversion major|minor|patch`. This will increment the version number,+  update the changelog, create and push the Git tag and the branch.+* If you have released an LTS version, merge the version branch into `master`,+  taking care of the conflicts around version numbers and changelog, and release+  the latest version as well.  [AWS Lambda]: https://aws.amazon.com/lambda/ [Docker]: https://www.docker.com/
serverless-haskell.cabal view
@@ -1,11 +1,13 @@--- This file has been generated from package.yaml by hpack version 0.28.2.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.0. -- -- see: https://github.com/sol/hpack ----- hash: 5c3c7a3b99a316e0ddf8a52606b1a6025eb4d7fc8fcc6b8825a65d752fe1509b+-- hash: 12dd4b883a4dee57b2aa41145f4b5e23c6626eb731411e7ea87f8939bb5e2830  name:           serverless-haskell-version:        0.7.5+version:        0.8.1 synopsis:       Deploying Haskell code onto AWS Lambda using Serverless description:    Utilities to help process the events from AWS Lambda when deployed with the serverless-haskell plugin. category:       AWS, Cloud, Network@@ -15,7 +17,6 @@ license:        MIT license-file:   LICENSE build-type:     Simple-cabal-version:  >= 1.10 extra-source-files:     README.md 
src/AWSLambda.hs view
@@ -24,7 +24,7 @@     >     > provider:     >   name: aws-    >   runtime: nodejs8.10+    >   runtime: haskell     >     > functions:     >   myfunc:
src/AWSLambda/Events/APIGateway.hs view
@@ -94,6 +94,19 @@       o .:? "user" $(makeLenses ''RequestIdentity) +data Authorizer = Authorizer+  { _aPrincipalId :: !(Maybe Text)+  , _aClaims :: !Object+  , _aContext :: !Object+  } deriving (Eq, Show)+instance FromJSON Authorizer where+  parseJSON = withObject "Authorizer" $ \o ->+    Authorizer+      <$> o .:? "principalId"+      <*> o .:? "claims" .!= mempty+      <*> (pure $ HashMap.delete "principalId" $ HashMap.delete "claims" o)+$(makeLenses ''Authorizer)+ data ProxyRequestContext = ProxyRequestContext   { _prcPath         :: !(Maybe Text)   , _prcAccountId    :: !Text@@ -105,6 +118,7 @@   , _prcHttpMethod   :: !Text   , _prcApiId        :: !Text   , _prcProtocol     :: !Text+  , _prcAuthorizer   :: !(Maybe Authorizer)   } deriving (Eq, Show) $(deriveFromJSON (aesonDrop 4 camelCase) ''ProxyRequestContext) $(makeLenses ''ProxyRequestContext)
test/AWSLambda/Events/APIGatewaySpec.hs view
@@ -72,7 +72,15 @@     },     "resourcePath": "/{proxy+}",     "httpMethod": "GET",-    "apiId": "wt6mne2s9k"+    "apiId": "wt6mne2s9k",+    "authorizer": {+      "principalId": "test-principalId",+      "claims": {+        "email": "test@example.com",+        "email_verified": true+      },+      "custom_context": 10+    }   },   "resource": "/{proxy+}",   "httpMethod": "GET",@@ -143,6 +151,13 @@     , _prcHttpMethod = "GET"     , _prcApiId = "wt6mne2s9k"     , _prcProtocol = "HTTP/1.1"+    , _prcAuthorizer =+      Just Authorizer+      { _aPrincipalId = Just "test-principalId"+      , _aClaims = HashMap.fromList [("email", toJSON ("test@example.com" :: Text)), ("email_verified", toJSON True)]+      , _aContext = HashMap.fromList [("custom_context", toJSON (10 :: Int))]+      }+           }   , _agprqBody = Nothing   }