Skip to content

Commit 020ba71

Browse files
authored
Merge pull request #347 from april/master
Update documentation, create CI for production
2 parents 40c9e5b + 42c43bd commit 020ba71

File tree

6 files changed

+80
-33
lines changed

6 files changed

+80
-33
lines changed

.github/workflows/production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
NODE_ENV: 'production'
77
nodeVersion: '14.x'
88
pythonVersion: '3.x'
9-
AUTH0_DOMAIN: 'auth-dev.mozilla.auth0.com'
9+
AUTH0_DOMAIN: 'auth.mozilla.auth0.com'
1010
AUTH0_CLIENT_ID: ${{ secrets.PRODUCTION_AUTH0_CLIENT_ID }}
1111
AUTH0_CLIENT_SECRET: ${{ secrets.PRODUCTION_AUTH0_CLIENT_SECRET }}
1212
AWS_CDN_BUCKET_NAME: ${{ secrets.PRODUCTION_AWS_CDN_BUCKET_NAME }}

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
| description | status |
44
|------------ | ----------- |
55
| latest commit | ![](https://github.com/mozilla-iam/auth0-custom-lock/workflows/auth0-custom-lock-push/badge.svg)
6-
| latest pull request | ![](https://github.com/mozilla-iam/auth0-custom-lock/workflows/auth0-custom-lock-pull/badge.svg)
76
| development release | ![](https://github.com/mozilla-iam/auth0-custom-lock/workflows/auth0-custom-lock-pre/badge.svg)
87
| production release | ![](https://github.com/mozilla-iam/auth0-custom-lock/workflows/auth0-custom-lock-prod/badge.svg)
98

@@ -54,30 +53,28 @@ to rebuild.
5453

5554
If you do need to deploy manually (as is currently required for production), you can install
5655
[act](https://github.com/nektos/act) on a local machine, and run:
57-
`act --secret-file config/secrets.dev -j dev-build-and-deploy` or
58-
`act --secret-file config/secrets.prod -j prod-build-and-deploy`.
56+
`act --secret-file config/secrets -j dev-build-and-deploy` or
57+
`act --secret-file config/secrets -j prod-build-and-deploy`.
5958

6059
You'll also need to set your secrets file to contain the following environmental variables:
6160

6261
```
62+
# these are needed to invoke `act --secret-file config/secrets -j dev-build-and-deploy`
6363
DEVELOPMENT_AWS_ACCESS_KEY_ID=...
6464
DEVELOPMENT_AWS_SECRET_ACCESS_KEY=...
6565
DEVELOPMENT_AWS_CDN_BUCKET_NAME=...
6666
DEVELOPMENT_AUTH0_CLIENT_ID=...
6767
DEVELOPMENT_AUTH0_CLIENT_SECRET=...
68-
```
69-
70-
Or:
7168
72-
```
69+
# these are needed to invoke `act --secret-file config/secrets -j prod-build-and-deploy`
7370
PRODUCTION_AWS_ACCESS_KEY_ID=...
7471
PRODUCTION_AWS_SECRET_ACCESS_KEY=...
7572
PRODUCTION_AWS_CDN_BUCKET_NAME=...
7673
PRODUCTION_AUTH0_CLIENT_ID=...
7774
PRODUCTION_AUTH0_CLIENT_SECRET=...
7875
```
7976

80-
Contact a member of the Mozilla-IAM team for a copy of these credentials, or push to the repo and request them
77+
Contact a member of the Mozilla-IAM team for a copy of these credentials, or push to the repo and create a release
8178
to deploy.
8279

8380
## Coding standards
@@ -133,3 +130,20 @@ Auto-login Settings screen. Allows user to enable or disable auto-login.
133130
### account_verification=true
134131

135132
This is a specific parameter that is set when the log in screen is used for _account verification_.
133+
134+
## Backend setup
135+
136+
First, run the CloudFormation template in AWS. Currently, this is done in the `infosec-dev` and `infosec-prod` AWS accounts.
137+
This will generate the `environment_AWS_ACCESS_KEY_ID` and `environment_AWS_SECRET_ACCESS_KEY` values needed to run `act` or
138+
invoke the GitHub Action.
139+
140+
Secondly, create an Application in Auth0 with the correct scopes to the Auth0 Management API:
141+
142+
application name: `github.com/mozilla-iam/auth0-custom-lock`
143+
application type: Machine to Machine
144+
description: `Owner: Mozilla-IAM (Your Name)`
145+
apis: Auth0 Management API
146+
scopes: `read:clients`, `update:clients`, `read:client_keys`, `update:client_keys`, `update:tenant_settings`
147+
148+
This will generate the `environment_AUTH0_CLIENT_ID` and `environment_AUTH0_CLIENT_SECRET` needed to run `a0deploy` inside
149+
the GitHub action.

ci/cloudformation/production.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
AWSTemplateFormatVersion: 2010-09-09
2+
Description: auth0-custom-lock GitHub Actions IAM User used to upload the NLX files to S3
3+
Metadata:
4+
Source: https://github.com/mozilla-iam/auth0-custom-lock/tree/master/ci/cloudformation
5+
Resources:
6+
GitHubActionsAuth0CustomLockUser:
7+
Type: AWS::IAM::User
8+
Properties:
9+
Policies:
10+
- PolicyName: AllowPutAuth0CustomLockFilesInS3
11+
PolicyDocument:
12+
Version: 2012-10-17
13+
Statement:
14+
- Effect: Allow
15+
Action:
16+
- s3:ListAllMyBuckets
17+
Resource: '*'
18+
- Effect: Allow
19+
Action:
20+
- s3:ListBucket
21+
Resource:
22+
- arn:aws:s3:::sso-dashboard.configuration-prod
23+
- Effect: Allow
24+
Action:
25+
- s3:ListObjects*
26+
- s3:PutObject
27+
Resource:
28+
- arn:aws:s3:::sso-dashboard.configuration-prod/nlx
29+
- arn:aws:s3:::sso-dashboard.configuration-prod/nlx/*
30+
GitHubActionsAuth0CustomLockUserAccessKey:
31+
Type: AWS::IAM::AccessKey
32+
Properties:
33+
Serial: 20200612
34+
Status: Active
35+
UserName: !Ref GitHubActionsAuth0CustomLockUser
36+
Outputs:
37+
GitHubActionsAuth0CustomLockUserName:
38+
Description: The Username of the GitHubActionsAuth0CustomLockUser
39+
Value: !Ref GitHubActionsAuth0CustomLockUser
40+
GitHubActionsAuth0CustomLockUserAccessKeyId:
41+
Description: The AWS API Access Key ID of the GitHubActionsAuth0CustomLockUser
42+
Value: !Ref GitHubActionsAuth0CustomLockUserAccessKey
43+
GitHubActionsAuth0CustomLockUserSecretAccessKey:
44+
Description: The AWS API Access Key Secret Key of the GitHubActionsAuth0CustomLockUser
45+
Value: !GetAtt GitHubActionsAuth0CustomLockUserAccessKey.SecretAccessKey

package-lock.json

Lines changed: 11 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"vinyl-source-stream": "^2.0.0"
3131
},
3232
"dependencies": {
33-
"auth0-js": "^9.13.2",
33+
"auth0-js": "^9.13.3",
3434
"promise-polyfill": "^8.1.3",
3535
"url-search-params-polyfill": "^4.0.1",
3636
"whatwg-fetch": "^2.0.4"

0 commit comments

Comments
 (0)