Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for local custom authorizers #467

Merged
merged 1 commit into from
Sep 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't appear to be testing this function

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