Skip to content

Commit f11b919

Browse files
update
1 parent aa9982c commit f11b919

File tree

1,469 files changed

+254610
-65754
lines changed

Some content is hidden

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

1,469 files changed

+254610
-65754
lines changed

.cargo-deny-config.toml

+14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ name = "ring"
3535
expression = "MIT AND ISC AND OpenSSL"
3636
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
3737

38+
[[licenses.clarify]]
39+
name = "webpki"
40+
expression = "ISC"
41+
license-files = [
42+
{ path = "LICENSE", hash = 0x001c7e6c },
43+
]
44+
45+
[[licenses.clarify]]
46+
name = "rustls-webpki"
47+
expression = "ISC"
48+
license-files = [
49+
{ path = "LICENSE", hash = 0x001c7e6c },
50+
]
51+
3852
# This section is considered when running `cargo deny check bans`.
3953
# More documentation about the 'bans' section can be found here:
4054
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html

.github/scripts/get-or-create-release-branch.sh

+41-32
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ set -eux
1414
# is the beginning of a new release series.
1515

1616
if [ -z "$SEMANTIC_VERSION" ]; then
17-
echo "'SEMANTIC_VERSION' must be populated."
18-
exit 1
17+
echo "'SEMANTIC_VERSION' must be populated."
18+
exit 1
1919
fi
2020

2121
if [ -z "$1" ]; then
22-
echo "You need to specify the path of the file where you want to collect the output"
23-
exit 1
22+
echo "You need to specify the path of the file where you want to collect the output"
23+
exit 1
2424
else
25-
output_file="$1"
25+
output_file="$1"
2626
fi
2727

2828
# Split on the dots
@@ -31,41 +31,50 @@ major=${version_array[0]}
3131
minor=${version_array[1]}
3232
patch=${version_array[2]}
3333
if [[ "${major}" == "" || "${minor}" == "" || "${patch}" == "" ]]; then
34-
echo "'${SEMANTIC_VERSION}' is not a valid semver tag"
35-
exit 1
34+
echo "'${SEMANTIC_VERSION}' is not a valid semver tag"
35+
exit 1
3636
fi
3737
if [[ $major == 0 ]]; then
38-
branch_name="smithy-rs-release-${major}.${minor}.x"
39-
if [[ $patch == 0 ]]; then
40-
echo "new_release_series=true" >"${output_file}"
41-
fi
38+
branch_name="smithy-rs-release-${major}.${minor}.x"
39+
if [[ $patch == 0 ]]; then
40+
echo "new_release_series=true" >"${output_file}"
41+
fi
4242
else
43-
branch_name="smithy-rs-release-${major}.x.y"
44-
if [[ $minor == 0 && $patch == 0 ]]; then
45-
echo "new_release_series=true" >"${output_file}"
46-
fi
43+
branch_name="smithy-rs-release-${major}.x.y"
44+
if [[ $minor == 0 && $patch == 0 ]]; then
45+
echo "new_release_series=true" >"${output_file}"
46+
fi
4747
fi
4848

4949
if [[ "${DRY_RUN}" == "true" ]]; then
50-
branch_name="${branch_name}-preview"
50+
branch_name="${branch_name}-preview"
5151
fi
5252
echo "release_branch=${branch_name}" >"${output_file}"
5353

54-
if [[ "${DRY_RUN}" == "true" ]]; then
55-
git push --force origin "HEAD:refs/heads/${branch_name}"
56-
else
57-
commit_sha=$(git rev-parse --short HEAD)
58-
if ! git ls-remote --exit-code --heads origin "${branch_name}"; then
59-
# The release branch does not exist.
60-
# We need to make sure that the commit SHA that we are releasing is on `main`.
61-
git fetch origin main
62-
if git branch --contains "${commit_sha}" | grep main; then
63-
# We can then create the release branch and set the current commit as its tip
64-
git checkout -b "${branch_name}"
65-
git push origin "${branch_name}"
66-
else
67-
echo "You must choose a commit from main to create a new release branch!"
68-
exit 1
69-
fi
54+
commit_sha=$(git rev-parse --short HEAD)
55+
# the git repo is in a weird state because **main has never been checked out**!
56+
# This prevents the `git branch --contains` from working because there is no _local_ ref for main
57+
git checkout main
58+
git checkout "${commit_sha}"
59+
if ! git ls-remote --exit-code --heads origin "${branch_name}"; then
60+
# The release branch does not exist.
61+
# We need to make sure that the commit SHA that we are releasing is on `main`.
62+
git fetch origin main
63+
echo "Branches: "
64+
git branch --contains "${commit_sha}"
65+
git show origin/main | head -n 1
66+
if git branch --contains "${commit_sha}" | grep main; then
67+
# We can then create the release branch and set the current commit as its tip
68+
if [[ "${DRY_RUN}" == "true" ]]; then
69+
git push --force origin "HEAD:refs/heads/${branch_name}"
70+
else
71+
git checkout -b "${branch_name}"
72+
git push origin "${branch_name}"
7073
fi
74+
else
75+
echo "You must choose a commit from main to create a new release branch!"
76+
exit 1
77+
fi
78+
else
79+
echo "Patch release ${branch_name} already exists"
7180
fi

.github/workflows/ci-main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Checkout
3333
uses: actions/checkout@v3
3434
- name: Acquire credentials
35-
uses: aws-actions/configure-aws-credentials@v1-node16
35+
uses: aws-actions/configure-aws-credentials@v2.2.0
3636
with:
3737
role-to-assume: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
3838
role-session-name: GitHubActions

.github/workflows/ci-merge-queue.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- name: Attempt to load a docker login password
34-
uses: aws-actions/configure-aws-credentials@v1-node16
34+
uses: aws-actions/configure-aws-credentials@v2.2.0
3535
with:
3636
role-to-assume: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
3737
role-session-name: GitHubActions
@@ -67,7 +67,7 @@ jobs:
6767
DOCKER_BUILDKIT: 1
6868
run: ./smithy-rs/.github/scripts/acquire-build-image
6969
- name: Acquire credentials
70-
uses: aws-actions/configure-aws-credentials@v1-node16
70+
uses: aws-actions/configure-aws-credentials@v2.2.0
7171
with:
7272
role-to-assume: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
7373
role-session-name: GitHubActions
@@ -84,7 +84,7 @@ jobs:
8484
needs:
8585
- save-docker-login-token
8686
- acquire-base-image
87-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' || toJSON(github.event.merge_group) != '{}' }}
87+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' || toJSON(github.event.merge_group) != '{}' }}
8888
uses: ./.github/workflows/ci.yml
8989
with:
9090
run_sdk_examples: true

.github/workflows/ci-pr-forks.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# it uploads the image as a build artifact for other jobs to download and use.
1919
acquire-base-image:
2020
name: Acquire Base Image
21-
if: ${{ github.event.pull_request.head.repo.full_name != 'awslabs/smithy-rs' }}
21+
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v3
@@ -39,7 +39,7 @@ jobs:
3939
# Run shared CI after the Docker build image has either been rebuilt or found in ECR
4040
ci:
4141
needs: acquire-base-image
42-
if: ${{ github.event.pull_request.head.repo.full_name != 'awslabs/smithy-rs' }}
42+
if: ${{ github.event.pull_request.head.repo.full_name != 'smithy-lang/smithy-rs' }}
4343
uses: ./.github/workflows/ci.yml
4444
with:
4545
run_sdk_examples: true

.github/workflows/ci-pr.yml

+13-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# The login password is encrypted with the repo secret DOCKER_LOGIN_TOKEN_PASSPHRASE
2222
save-docker-login-token:
2323
name: Save a docker login token
24-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
24+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
2525
outputs:
2626
docker-login-password: ${{ steps.set-token.outputs.docker-login-password }}
2727
permissions:
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- name: Attempt to load a docker login password
34-
uses: aws-actions/configure-aws-credentials@v1-node16
34+
uses: aws-actions/configure-aws-credentials@v2.2.0
3535
with:
3636
role-to-assume: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
3737
role-session-name: GitHubActions
@@ -51,8 +51,8 @@ jobs:
5151
acquire-base-image:
5252
name: Acquire Base Image
5353
needs: save-docker-login-token
54-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
55-
runs-on: ubuntu-latest
54+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
55+
runs-on: smithy_ubuntu-latest_8-core
5656
env:
5757
ENCRYPTED_DOCKER_PASSWORD: ${{ needs.save-docker-login-token.outputs.docker-login-password }}
5858
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
@@ -69,7 +69,7 @@ jobs:
6969
DOCKER_BUILDKIT: 1
7070
run: ./smithy-rs/.github/scripts/acquire-build-image
7171
- name: Acquire credentials
72-
uses: aws-actions/configure-aws-credentials@v1-node16
72+
uses: aws-actions/configure-aws-credentials@v2.2.0
7373
with:
7474
role-to-assume: ${{ secrets.SMITHY_RS_PUBLIC_ECR_PUSH_ROLE_ARN }}
7575
role-session-name: GitHubActions
@@ -86,7 +86,7 @@ jobs:
8686
needs:
8787
- save-docker-login-token
8888
- acquire-base-image
89-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
89+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
9090
uses: ./.github/workflows/ci.yml
9191
with:
9292
run_sdk_examples: true
@@ -97,7 +97,7 @@ jobs:
9797
# The PR bot requires a Docker build image, so make it depend on the `acquire-base-image` job.
9898
pr_bot:
9999
name: PR Bot
100-
if: ${{ github.event.pull_request.head.repo.full_name == 'awslabs/smithy-rs' }}
100+
if: ${{ github.event.pull_request.head.repo.full_name == 'smithy-lang/smithy-rs' }}
101101
needs: acquire-base-image
102102
uses: ./.github/workflows/pull-request-bot.yml
103103
with:
@@ -114,6 +114,12 @@ jobs:
114114
needs:
115115
- save-docker-login-token
116116
- acquire-base-image
117+
# We need `always` here otherwise this job won't run if the previous job has been skipped
118+
# See https://samanpavel.medium.com/github-actions-conditional-job-execution-e6aa363d2867
119+
if: |
120+
always() &&
121+
!contains(needs.*.result, 'failure') &&
122+
!contains(needs.*.result, 'cancelled')
117123
steps:
118124
- uses: actions/checkout@v3
119125
with:

.github/workflows/ci-tls.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# This workflow tests the TLS configuration of the smithy-rs client
5+
# To run on an Ubuntu machine, run each step in this order.
6+
# Each script can be run on your Ubuntu host.
7+
# You will have to install Docker and rustc/cargo manually.
8+
9+
env:
10+
rust_version: 1.68.2
11+
12+
name: Verify client TLS configuration
13+
on:
14+
pull_request:
15+
push:
16+
branches: [main]
17+
18+
jobs:
19+
verify-tls-config:
20+
name: Verify TLS configuration
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Install packages
24+
shell: bash
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get -y install gcc make python3-pip nginx git ruby openjdk-17-jre pkg-config libssl-dev faketime
28+
pip3 install certbuilder crlbuilder
29+
- name: Stop nginx
30+
run: sudo systemctl stop nginx
31+
- name: Checkout smithy-rs
32+
uses: actions/checkout@v3
33+
with:
34+
path: ./smithy-rs
35+
- name: Checkout trytls
36+
uses: actions/checkout@v3
37+
with:
38+
repository: ouspg/trytls
39+
path: ./trytls
40+
- name: Checkout badtls
41+
uses: actions/checkout@v3
42+
with:
43+
repository: wbond/badtls.io
44+
path: ./badtls.io
45+
- name: Checkout badssl
46+
uses: actions/checkout@v3
47+
with:
48+
repository: chromium/badssl.com
49+
path: ./badssl.com
50+
- name: Install Rust
51+
uses: dtolnay/rust-toolchain@master
52+
with:
53+
toolchain: ${{ env.rust_version }}
54+
- name: Build badssl.com
55+
shell: bash
56+
working-directory: badssl.com
57+
env:
58+
DOCKER_BUILDKIT: 1
59+
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-badssl
60+
- name: Build SDK
61+
working-directory: smithy-rs
62+
run: ./gradlew :aws:sdk:assemble -Paws.services=+sts,+sso,+ssooidc
63+
- name: Build trytls
64+
shell: bash
65+
working-directory: trytls
66+
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-trytls
67+
- name: Build badtls.io
68+
working-directory: badtls.io
69+
shell: bash
70+
run: ../smithy-rs/tools/ci-scripts/configure-tls/configure-badtls
71+
- name: Update TLS configuration
72+
shell: bash
73+
run: smithy-rs/tools/ci-scripts/configure-tls/update-certs
74+
- name: Build TLS stub
75+
working-directory: smithy-rs/tools/ci-resources/tls-stub
76+
shell: bash
77+
run: cargo build
78+
- name: Test TLS configuration
79+
working-directory: smithy-rs/tools
80+
shell: bash
81+
run: trytls https target/debug/stub

.github/workflows/ci.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
required: false
3030

3131
env:
32-
rust_version: 1.67.1
32+
rust_version: 1.70.0
3333
rust_toolchain_components: clippy,rustfmt
3434
ENCRYPTED_DOCKER_PASSWORD: ${{ secrets.ENCRYPTED_DOCKER_PASSWORD }}
3535
DOCKER_LOGIN_TOKEN_PASSPHRASE: ${{ secrets.DOCKER_LOGIN_TOKEN_PASSPHRASE }}
@@ -108,6 +108,8 @@ jobs:
108108
runner: ubuntu-latest
109109
- action: check-style-and-lints
110110
runner: ubuntu-latest
111+
- action: check-book
112+
runner: ubuntu-latest
111113
- action: check-tools
112114
runner: smithy_ubuntu-latest_8-core
113115
- action: check-deterministic-codegen
@@ -184,6 +186,9 @@ jobs:
184186
with:
185187
toolchain: ${{ env.rust_version }}
186188
components: ${{ env.rust_toolchain_components }}
189+
# To fix OpenSSL not found on Windows: https://github.com/sfackler/rust-openssl/issues/1542
190+
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
191+
- run: vcpkg install openssl:x64-windows-static-md
187192
- name: Run tests
188193
shell: bash
189194
run: |
@@ -208,8 +213,6 @@ jobs:
208213
matrix:
209214
include:
210215
# We always exclude aws-smithy-http-server-python since the Python framework is experimental.
211-
# We only build the `native-tls` feature here because `rustls` depends on `ring` which in turn
212-
# does not support powerpc as a target platform (see https://github.com/briansmith/ring/issues/389)
213216
- target: i686-unknown-linux-gnu
214217
build_smithy_rs_features: --all-features
215218
build_aws_exclude: ''
@@ -218,17 +221,17 @@ jobs:
218221
test_aws_exclude: ''
219222
test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript
220223
- target: powerpc-unknown-linux-gnu
221-
build_smithy_rs_features: --features native-tls
224+
build_smithy_rs_features: ''
222225
build_aws_exclude: --exclude aws-inlineable
223226
build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript
224-
test_smithy_rs_features: --features native-tls
227+
test_smithy_rs_features: ''
225228
test_aws_exclude: --exclude aws-inlineable
226229
test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript
227230
- target: powerpc64-unknown-linux-gnu
228-
build_smithy_rs_features: --features native-tls
231+
build_smithy_rs_features: ''
229232
build_aws_exclude: --exclude aws-inlineable
230233
build_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript
231-
test_smithy_rs_features: --features native-tls
234+
test_smithy_rs_features: ''
232235
test_aws_exclude: --exclude aws-inlineable
233236
test_smithy_rs_exclude: --exclude aws-smithy-http-server-python --exclude aws-smithy-http-server-typescript
234237
env:

.github/workflows/claim-crate-names.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
env:
13-
rust_version: 1.67.1
13+
rust_version: 1.70.0
1414

1515
name: Claim unpublished crate names on crates.io
1616
run-name: ${{ github.workflow }}

0 commit comments

Comments
 (0)