Skip to content

Auth@Edge#176

Merged
troyready merged 5 commits into
rackspace:masterfrom
voodooGQ:feature/private-static-site
Mar 10, 2020
Merged

Auth@Edge#176
troyready merged 5 commits into
rackspace:masterfrom
voodooGQ:feature/private-static-site

Conversation

@voodooGQ
Copy link
Copy Markdown
Contributor

@voodooGQ voodooGQ commented Feb 21, 2020

Summary

Creates the ability to generate a private static site using Auth@Edge as described here: https://aws.amazon.com/blogs/networking-and-content-delivery/authorizationedge-how-to-use-lambdaedge-and-json-web-tokens-to-enhance-web-application-security/

Why This Is Needed

This has been a frequent request of our development teams to be able to create a single page application behind an authentication interface.

What Changed

Added

  • Auth@Edge Blueprint which inherits from the standard StaticSite Blueprint
  • Template files for the Lambda@Edge functions that will be generated by Runway
  • Custom CFNgin prehook to update the domain name of the Cognito authentication interface
  • Custom CFNgin prehook to generate a dynamic code package for each of the Lambda@Edge functions. This is necessary since Lambda@Edge does not allow environment variables at this time.
  • Custom CFNGin posthook to update the callback urls for the Cognito User Pool Client.
  • Documentation outlining the new features and their capabilities.

Changed

  • Converted the StaticSite Blueprint from using CFN Conditional logic to using pure Python conditional logic. This gives us finer-grained control over how we create our CFN templates while losing the template output consistency. This isn't a problem in and of itself but does require dependency of Runway to generate the templates.

Screenshots

image
image
image
image

@voodooGQ voodooGQ marked this pull request as ready for review February 24, 2020 14:35
@voodooGQ

This comment has been minimized.

Comment thread Pipfile Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Copy link
Copy Markdown
Contributor

@ITProKyle ITProKyle left a comment

Choose a reason for hiding this comment

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

I would prefer to stop using runway.hooks and instead have all hooks in runway.cfngin.hooks so they are all grouped together. we can't move anything that already exists there till the next major release since it could be breaking but, i don't think that means we need to continue putting new things in runway.hooks.

Comment thread runway/blueprints/staticsite/dependencies.py Outdated
Comment thread runway/blueprints/staticsite/staticsite.py Outdated
Comment thread runway/blueprints/staticsite/staticsite.py
Comment thread runway/blueprints/staticsite/staticsite.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/check_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/check_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/check_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/check_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/check_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/http_headers/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/parse_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/parse_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/parse_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/refresh_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/refresh_auth/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/sign_out/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/sign_out/__init__.py Outdated
Comment thread runway/hooks/staticsite/upload_staticsite.py
Comment thread runway/module/staticsite.py Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread runway/blueprints/staticsite/templates/cf_directory_index_rewrite.template.js Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread docs/source/module_configuration/staticsite.rst
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread runway/module/staticsite.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread docs/source/module_configuration/staticsite.rst Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/sign_out/__init__.py Outdated
Comment thread runway/module/staticsite.py Outdated
Comment thread runway/module/staticsite.py Outdated
Comment thread runway/module/staticsite.py Outdated
Comment thread runway/module/staticsite.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/auth_at_edge.py Outdated
Comment thread runway/blueprints/staticsite/dependencies.py
Comment thread runway/blueprints/staticsite/staticsite.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/domain_updater.py
Comment thread runway/hooks/staticsite/auth_at_edge/templates/check_auth/jwks_rsa/client.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/http_headers/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/http_headers/__init__.py Outdated
object is generated with hard coded values via Runway.
"""
# pylint: disable=undefined-variable
config = {{{DynamicConfig}}} # noqa
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it'd be fine to just wrap a substitution regex around the whole line (or nearly the whole line).

Comment thread runway/blueprints/staticsite/staticsite.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/shared.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/shared.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/http_headers/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/http_headers/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/sign_out/__init__.py Outdated
Comment thread runway/hooks/staticsite/auth_at_edge/templates/shared.py Outdated
@troyready troyready merged commit 2525b62 into rackspace:master Mar 10, 2020
@ITProKyle ITProKyle added the feature Request or pull request for a new feature label Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Request or pull request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants