Skip to content
This repository was archived by the owner on Feb 11, 2023. It is now read-only.

Commit 28b853e

Browse files
allow distributions directory to be a symbolic link
1 parent 25fa427 commit 28b853e

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ google-authz.json
88
auth.js
99
/index.js
1010
/.idea
11-
distributions/*
12-
!distributions/.gitkeep
11+
/distributions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Session duration is defined as the number of hours that the JWT is valid for. Af
1616
1. Navigate to your organization's [profile page](https://github.com/settings/profile), then choose OAuth Apps under Developer settings.
1717
1. Select **New OAuth App**
1818
1. For **Authorization callback URL** enter your Cloudfront hostname with your preferred path value for the authorization callback. Example: `https://my-cloudfront-site.example.com/_callback`
19-
1. Execute `npm run-script build` in the downloaded directory. NPM will run to download dependencies and a RSA key will be generated.
19+
1. Execute `./build.sh` in the downloaded directory. NPM will run to download dependencies and a RSA key will be generated.
2020
1. Choose `Github` as the authorization method and enter the values for Client ID, Client Secret, Redirect URI, Session Duration and Organization
2121
- cloudfront-auth will check that users are a member of the entered Organization.
2222
1. Upload the resulting `zip` file found in your distribution folder using the AWS Lambda console and jump to the [configuration step](#configure-lambda-and-cloudfront)
@@ -29,7 +29,7 @@ Session duration is defined as the number of hours that the JWT is valid for. Af
2929
1. Create an **OAuth Client ID** from the **Create credentials** menu
3030
1. Select **Web application** for the Application type
3131
1. Under **Authorized redirect URIs**, enter your Cloudfront hostname with your preferred path value for the authorization callback. Example: `https://my-cloudfront-site.example.com/_callback`
32-
1. Execute `npm run-script build` in the downloaded directory. NPM will run to download dependencies and a RSA key will be generated.
32+
1. Execute `./build.sh` in the downloaded directory. NPM will run to download dependencies and a RSA key will be generated.
3333
1. Choose `Google` as the authorization method and enter the values for Client ID, Client Secret, Redirect URI, Hosted Domain and Session Duration
3434
1. Select the preferred authentication method
3535
1. Hosted Domain (verify email's domain matches that of the given hosted domain)
@@ -46,7 +46,7 @@ Session duration is defined as the number of hours that the JWT is valid for. Af
4646
1. Create a new application registration with an application type of **Web app / api**
4747
1. Once created, go to your application `Settings -> Keys` and make a new key with your desired duration. Click save and copy the value. This will be your `client_secret`
4848
1. Above where you selected `Keys`, go to `Reply URLs` and enter your Cloudfront hostname with your preferred path value for the authorization callback. Example: https://my-cloudfront-site.example.com/_callback
49-
1. Execute `npm run-script build` in the downloaded directory. NPM will run to download dependencies and a RSA key will be generated.
49+
1. Execute `./build.sh` in the downloaded directory. NPM will run to download dependencies and a RSA key will be generated.
5050
1. Choose `Microsoft` as the authorization method and enter the values for [Tenant](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-howto-tenant), Client ID (**Application ID**), Client Secret (**previously created key**), Redirect URI and Session Duration
5151
1. Select the preferred authentication method
5252
1. Azure AD Membership (default)
@@ -104,4 +104,4 @@ All contributions are welcome. Please create an issue in order open up communica
104104
105105
When implementing a new flow or using an already implemented flow, be sure to follow the same style used in `build.js`. The config.json file should have an object for each request made. For example, `openid.index.js` converts config.AUTH_REQUEST and config.TOKEN_REQUEST to querystrings for simplified requests (after adding dynamic variables such as state or nonce). For implementations that are not generic (most), endpoints are hardcoded in to the config (or discovery documents).
106106
107-
Be considerate of our [limitations](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html#limits-lambda-at-edge). The zipped function can be no more than 1MB in size and execution cannot take longer than 5 seconds, so we must pay close attention to the size of our dependencies and complexity of operations.
107+
Be considerate of our [limitations](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html#limits-lambda-at-edge). The zipped function can be no more than 1MB in size and execution cannot take longer than 5 seconds, so we must pay close attention to the size of our dependencies and complexity of operations.

build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
if [ ! -d "distributions" ]; then
5+
if [ ! -L "distributions" ]; then
6+
mkdir distributions
7+
fi
8+
fi
9+
10+
npm run-script build

distributions/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)