Skip to content

Commit 3318d09

Browse files
authored
Merge branch 'main' into fix/bobbor/14653
2 parents f78e64b + adcef05 commit 3318d09

File tree

459 files changed

+4141
-3581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+4141
-3581
lines changed

.gitallowed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# The following regexes are exceptions for git-secrets - https://github.com/awslabs/git-secrets
2+
3+
# The only AWS account number allowed to be used in tests
4+
ACCOUNT_ID = '123456789012';
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Git Secrets Check
2+
on: workflow_call
3+
4+
jobs:
5+
git_secrets_check:
6+
name: Scan for secrets
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
11+
with:
12+
path: amplify-js
13+
14+
- name: Install git-secrets
15+
run: |
16+
git clone https://github.com/awslabs/git-secrets.git
17+
cd git-secrets
18+
sudo make install
19+
20+
- name: Register AWS patterns and scan
21+
working-directory: ./amplify-js
22+
run: |
23+
git secrets --register-aws
24+
# Scan only the files in the current checkout (PR merge commit)
25+
git secrets --scan

.github/workflows/pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
dependency-review:
4444
needs: prebuild
4545
uses: ./.github/workflows/callable-dependency-review.yml
46+
git-secrets-check:
47+
uses: ./.github/workflows/callable-git-secrets-check.yml
4648
all-unit-tests-pass:
4749
name: Unit and Bundle tests have passed
4850
needs:
@@ -52,6 +54,7 @@ jobs:
5254
- github-actions-test
5355
- tsc-compliance-test
5456
- dependency-review
57+
- git-secrets-check
5558
runs-on: ubuntu-latest
5659
if: success() # only run when all checks have passed
5760
# store success output flag for ci job

.husky/pre-push

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env sh
2+
3+
# Pre-push hook to scan for secrets using git-secrets
4+
# This prevents accidentally pushing AWS credentials or other secrets
5+
6+
# Check if git-secrets is installed
7+
if ! command -v git-secrets >/dev/null 2>&1; then
8+
echo ""
9+
echo "ERROR: git-secrets is not installed."
10+
echo ""
11+
echo "Please install git-secrets to continue:"
12+
echo ""
13+
echo " macOS: brew install git-secrets"
14+
echo " Linux: See https://github.com/awslabs/git-secrets#installing-git-secrets"
15+
echo " Windows: See https://github.com/awslabs/git-secrets#installing-git-secrets"
16+
echo ""
17+
echo "After installation, register AWS patterns:"
18+
echo " git secrets --register-aws"
19+
echo ""
20+
exit 1
21+
fi
22+
23+
# Run git-secrets scan and propagate exit code
24+
git secrets --scan

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Whether it's a bug report, new feature, correction, or additional documentation,
88
- [Our Design](#our-design)
99
- [Development Process](#development-process)
1010
- [Setting up for local development](#setting-up-for-local-development)
11+
- [Setting up git-secrets](#setting-up-git-secrets)
1112
- [Architecture of the codebase](#architecture-of-the-codebase)
1213
- [Steps towards contributions](#steps-towards-contributions)
1314
- [Bug Reports](#bug-reports)
@@ -68,6 +69,74 @@ yarn build
6869

6970
> Note: Make sure to always [sync your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) with main branch of `amplify-js`
7071
72+
## Setting up git-secrets
73+
74+
This repository uses [git-secrets](https://github.com/awslabs/git-secrets) to prevent accidentally pushing AWS credentials or other secrets. A pre-push hook will scan your commits before pushing to the remote repository.
75+
76+
### Installing git-secrets
77+
78+
**macOS (using Homebrew):**
79+
80+
```bash
81+
brew install git-secrets
82+
```
83+
84+
**Linux (Debian/Ubuntu):**
85+
86+
```bash
87+
sudo apt-get install git-secrets
88+
```
89+
90+
**Linux (manual installation):**
91+
92+
```bash
93+
git clone https://github.com/awslabs/git-secrets.git
94+
cd git-secrets
95+
sudo make install
96+
```
97+
98+
**Windows (manual installation):**
99+
100+
1. Clone the repository: `git clone https://github.com/awslabs/git-secrets.git`
101+
2. Add the `git-secrets` directory to your PATH
102+
3. Alternatively, copy `git-secrets` to a directory already in your PATH
103+
104+
### Registering AWS patterns
105+
106+
After installing git-secrets, register the AWS secret patterns in your local repository:
107+
108+
```bash
109+
git secrets --register-aws
110+
```
111+
112+
This registers patterns to detect:
113+
114+
- AWS Access Key IDs (e.g., `AKIAIOSFODNN7EXAMPLE`)
115+
- AWS Secret Access Keys
116+
- AWS Session Tokens
117+
118+
You can verify the registered patterns with:
119+
120+
```bash
121+
git secrets --list
122+
```
123+
124+
### Handling false positives
125+
126+
If git-secrets flags a legitimate string as a potential secret (false positive), you can add an allowed pattern:
127+
128+
```bash
129+
# Allow a specific pattern
130+
git secrets --add --allowed 'AKIAIOSFODNN7EXAMPLE'
131+
132+
# Allow patterns matching a regex
133+
git secrets --add --allowed 'my-test-pattern.*'
134+
```
135+
136+
Allowed patterns are stored in `.git/config` and apply only to your local repository.
137+
138+
> **Note:** The pre-push hook will block pushes if git-secrets is not installed. Please install and configure git-secrets before contributing.
139+
71140
## Architecture of the codebase
72141

73142
Amplify JS is a monorepo built with `Yarn` and `Lerna`. All the categories of Amplify live within the `packages` directory in the root. Each category inside packages has its own `src/` and `package.json`.

docs/api/assets/navigation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/classes/_aws_amplify_adapter_nextjs.index._Reference_Types_.Blob.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://docs.amplify.aws/">Library Documentation</a><a href="https://www.npmjs.com/package/aws-amplify">NPM</a><a href="https://github.com/aws-amplify/amplify-js">GitHub</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Amplify JS API Documentation</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">Amplify JS API Documentation</a></li><li><a href="../modules/_aws_amplify_adapter_nextjs.html">@aws-amplify/adapter-nextjs</a></li><li><a href="../modules/_aws_amplify_adapter_nextjs.index.html">index</a></li><li><a href="../modules/_aws_amplify_adapter_nextjs.index._Reference_Types_.html">&lt;Reference Types&gt;</a></li><li><a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.Blob.html">Blob</a></li></ul><h1>Class Blob</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>A <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob"><code>Blob</code></a> encapsulates immutable, raw data that can be safely shared across
33
multiple worker threads.</p>
44
</div><div class="tsd-comment tsd-typography"><h4>Since</h4><p>v15.7.0, v14.18.0</p>
5-
</div></section><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a class="link" href="../hierarchy.html#@aws-amplify/adapter-nextjs.index.<Reference Types>.Blob">view full</a>)</h4><ul class="tsd-hierarchy"><li><span class="target">Blob</span><ul class="tsd-hierarchy"><li><a href="../modules/_aws_amplify_adapter_nextjs.index._Reference_Types_.__home_runner_work_amplify_js_amplify_js_amplify_js_packages_adapter_nextjs_node_modules_undici_types_index_.html" class="tsd-signature-type tsd-kind-namespace">&quot;/home/runner/work/amplify-js/amplify-js/amplify-js/packages/adapter-nextjs/node_modules/undici-types/index&quot;</a><span class="tsd-signature-symbol">.</span><a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.__home_runner_work_amplify_js_amplify_js_amplify_js_packages_adapter_nextjs_node_modules_undici_types_index_.File.html" class="tsd-signature-type tsd-kind-class">File</a></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.Blob.html#constructor" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-512"></use></svg><span>constructor</span></a>
5+
</div></section><section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a class="link" href="../hierarchy.html#@aws-amplify/adapter-nextjs.index.<Reference Types>.Blob">view full</a>)</h4><ul class="tsd-hierarchy"><li><span class="target">Blob</span><ul class="tsd-hierarchy"><li><a href="../modules/_aws_amplify_adapter_nextjs.index._Reference_Types_.__Volumes_workplace_Amplify_amplify_js_packages_adapter_nextjs_node_modules_undici_types_index_.html" class="tsd-signature-type tsd-kind-namespace">&quot;/Volumes/workplace/Amplify/amplify-js/packages/adapter-nextjs/node_modules/undici-types/index&quot;</a><span class="tsd-signature-symbol">.</span><a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.__Volumes_workplace_Amplify_amplify_js_packages_adapter_nextjs_node_modules_undici_types_index_.File.html" class="tsd-signature-type tsd-kind-class">File</a></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.Blob.html#constructor" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-512"></use></svg><span>constructor</span></a>
66
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.Blob.html#size" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>size</span></a>
77
<a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.Blob.html#type" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>type</span></a>
88
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="_aws_amplify_adapter_nextjs.index._Reference_Types_.Blob.html#arrayBuffer" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>array<wbr/>Buffer</span></a>

0 commit comments

Comments
 (0)