Skip to content

Commit

Permalink
Merge pull request #467 from stealthycoin/local-custom-auth
Browse files Browse the repository at this point in the history
Add support for local custom authorizers
  • Loading branch information
stealthycoin authored Sep 5, 2017
2 parents 07968a6 + 7305052 commit c09ed07
Show file tree
Hide file tree
Showing 8 changed files with 1,099 additions and 169 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Next Release (TBD)
* Fix bug where ``raw_body`` would raise an exception if no HTTP
body was provided
(`#503 <https://github.com/aws/chalice/issues/503>`__)
* Fix bug where exit codes were not properly being propagated during packaging
(`#500 <https://github.com/aws/chalice/issues/500>`__)
* Add support for Builtin Authorizers in local mode
(`#404 <https://github.com/aws/chalice/issues/404>`__)


1.0.1
Expand Down
5 changes: 2 additions & 3 deletions chalice/app.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Dict, List, Any, Callable, Union, Optional
from chalice.local import LambdaContext

__version__ = ... # type: str

Expand Down Expand Up @@ -109,9 +110,7 @@ class Chalice(object):
api = ... # type: APIGateway
routes = ... # type: Dict[str, Dict[str, RouteEntry]]
current_request = ... # type: Request
# TODO: Change lambda_context to a real type once we have one for local
# API Gateway
lambda_context = ... # type: Any
lambda_context = ... # type: LambdaContext
debug = ... # type: bool
authorizers = ... # type: Dict[str, Dict[str, Any]]
builtin_auth_handlers = ... # type: List[BuiltinAuthConfig]
Expand Down
2 changes: 1 addition & 1 deletion chalice/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def run_local_server(factory, port, env):
# The app-specific logger (app.log) will still continue
# to work.
logging.basicConfig(stream=sys.stdout)
server = factory.create_local_server(app_obj, port)
server = factory.create_local_server(app_obj, config, port)
server.serve_forever()


Expand Down
6 changes: 3 additions & 3 deletions chalice/cli/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ def load_project_config(self):
with open(config_file) as f:
return json.loads(f.read())

def create_local_server(self, app_obj, port):
# type: (Chalice, int) -> local.LocalDevServer
return local.create_local_server(app_obj, port)
def create_local_server(self, app_obj, config, port):
# type: (Chalice, Config, int) -> local.LocalDevServer
return local.create_local_server(app_obj, config, port)
Loading

0 comments on commit c09ed07

Please sign in to comment.