Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .changes/1691b2fe-15ba-4bf8-8f27-382b59c792c8.json

This file was deleted.

9 changes: 0 additions & 9 deletions .changes/703da74b-6f77-4555-b129-295486571361.json

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/8665c18c-d742-4212-b920-6fea43f70c2c.json

This file was deleted.

5 changes: 0 additions & 5 deletions .changes/e965338d-28c5-41e2-b585-121d9d56393f.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/codebuild-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codegen-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
body: '${{ needs.generate-codegen-diff.outputs.bot-message }}\n\n'
})
})
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
pwd
./gradlew publishToMavenLocal
./gradlew apiCheck
./gradlew test allTests
./gradlew test jvmTest
./gradlew testAllProtocols
- name: Save Test Reports
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Checks
on:
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ main ]
branches: [ main, release ]

# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed
concurrency:
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [0.33.0-beta] - 10/26/2023

### Features
* **BREAKING**: Update codegen to improve nullability of generated types.
* [#605](https://github.com/awslabs/aws-sdk-kotlin/issues/605), [#805](https://github.com/awslabs/aws-sdk-kotlin/issues/805) Publish a BOM and a Version Catalog
* Detect and automatically correct clock skew to prevent signing errors

### Fixes
* Ignore empty environment variable and system property strings when evaluating AWS credentials

### Miscellaneous
* Upgrade Kotlin to 1.9.10
* Sync AWS models and upgrade smithy-kotlin
* Upgrade Dokka to 1.9.0
* **Breaking** Removed `enableAccelerate` & `forcePathStyle` from S3 config. As well as `use_accelerate_endpoint` & `addressing_style` from AWS profile configuration
* **BREAKING**: Remove `smithy.client.request.size`, `smithy.client.response.size`, `smithy.client.retries` metrics. Rename all `smithy.client.*` metrics to `smithy.client.call.*`.
* Remove GameSparks service
* Add skeleton implementation of a second KMP target
* Added `s3_use_arn_region` & `s3_disable_multiregion_access_points` to AWS profile configuration

## [0.32.5-beta] - 10/12/2023

### Features
Expand Down
15 changes: 8 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ Merges to this repository must include one or more changelog entries which descr
Entries are placed in the top-level `.changes/` directory. An entry is a file containing a JSON object with the
following fields:

| Field name | Type | Required | Enum | Description |
|---------------|------------|----------|----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | `string` | yes | | A unique identifier for this entry. We recommend you generate a UUID for this field. |
| `type` | `string` | yes | `bugfix`, `feature`, `documentation`, `misc` | The type of change being made. |
| `description` | `string` | yes | | A description of the change being made.<ul><li>Prefix with `**Breaking**:` if the change is breaking</li><li>Use the imperative present tense (e.g., "change" not "changed" nor "changes")</li><li>Capitalize first letter</li><li>No dot (.) at the end unless there are multiple sentences</li></ul> |
| `issues` | `string[]` | no | | A list of references to any related issues in the relevant repositories. A reference can be specified in several ways:<ul><li>The issue number, if local to this repository (eg. `#12345`)</li><li>A fully-qualified issue ID (eg.`awslabs/smithy-kotlin#12345`)</li><li>A fully-qualified URL (eg. `https://issuetracker.com/12345`)</li></ul> |
| `module` | `string` | no | | The area of the code affected by your changes. If unsure, leave this value unset. |
| Field name | Type | Required | Enum | Description |
|----------------------------|------------|----------|----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id` | `string` | yes | | A unique identifier for this entry. We recommend you generate a UUID for this field. |
| `type` | `string` | yes | `bugfix`, `feature`, `documentation`, `misc` | The type of change being made. |
| `description` | `string` | yes | | A description of the change being made.<ul><li>Prefix with `**Breaking**:` if the change is breaking</li><li>Use the imperative present tense (e.g., "change" not "changed" nor "changes")</li><li>Capitalize first letter</li><li>No dot (.) at the end unless there are multiple sentences</li></ul> |
| `issues` | `string[]` | no | | A list of references to any related issues in the relevant repositories. A reference can be specified in several ways:<ul><li>The issue number, if local to this repository (eg. `#12345`)</li><li>A fully-qualified issue ID (eg.`awslabs/smithy-kotlin#12345`)</li><li>A fully-qualified URL (eg. `https://issuetracker.com/12345`)</li></ul> |
| `module` | `string` | no | | The area of the code affected by your changes. If unsure, leave this value unset. |
| `requiresMinorVersionBump` | `boolean` | no | | Indicates the change will require a new minor version. This is usually the case after a breaking change. Defaults to false if flag is not included. |

The filename of an entry is arbitrary. We recommend `<id>.json`, where `<id>` corresponds to the `id` field of the entry
itself.
Expand Down
1 change: 1 addition & 0 deletions aws-runtime/aws-config/api/aws-config.api
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public final class aws/sdk/kotlin/runtime/config/imds/EndpointMode : java/lang/E
public static final field Companion Laws/sdk/kotlin/runtime/config/imds/EndpointMode$Companion;
public static final field IPv4 Laws/sdk/kotlin/runtime/config/imds/EndpointMode;
public static final field IPv6 Laws/sdk/kotlin/runtime/config/imds/EndpointMode;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/runtime/config/imds/EndpointMode;
public static fun values ()[Laws/sdk/kotlin/runtime/config/imds/EndpointMode;
}
Expand Down
12 changes: 10 additions & 2 deletions aws-runtime/aws-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ kotlin {

// additional dependencies required by generated sts provider
implementation(libs.smithy.kotlin.serde.xml)
implementation(libs.smithy.kotlin.serde.formurl)
implementation(libs.smithy.kotlin.serde.form.url)
implementation(libs.smithy.kotlin.aws.xml.protocols)

// additional dependencies required by generated sso provider(s)
Expand All @@ -53,11 +53,11 @@ kotlin {
implementation(libs.kotlinx.coroutines.test)
implementation(libs.smithy.kotlin.http.test)
implementation(libs.kotlinx.serialization.json)
implementation(libs.mockk)
}
}
jvmTest {
dependencies {
implementation(libs.mockk)
implementation(libs.kotest.runner.junit5)
}
}
Expand Down Expand Up @@ -192,6 +192,9 @@ NOTE: We need the following tasks to depend on codegen for gradle caching/up-to-
* `compileKotlinJvm` (Type=KotlinCompile)
* `compileKotlinMetadata` (Type=KotlinCompileCommon)
* `sourcesJar` and `jvmSourcesJar` (Type=org.gradle.jvm.tasks.Jar)
*
* For Kotlin/Native, an additional dependency is introduced:
* `compileKotlin<Platform>` (Type=KotlinNativeCompile) (e.g. compileKotlinLinuxX64)
*/
val codegenTask = tasks.named("generateSmithyProjections")
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
Expand All @@ -201,6 +204,11 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.allWarningsAsErrors = false
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile> {
dependsOn(codegenTask)
kotlinOptions.allWarningsAsErrors = false
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon> {
dependsOn(codegenTask)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProviderExceptio
import aws.smithy.kotlin.runtime.auth.awscredentials.DEFAULT_CREDENTIALS_REFRESH_SECONDS
import aws.smithy.kotlin.runtime.config.resolve
import aws.smithy.kotlin.runtime.http.HttpStatusCode
import aws.smithy.kotlin.runtime.io.IOException
import aws.smithy.kotlin.runtime.serde.json.JsonDeserializer
import aws.smithy.kotlin.runtime.telemetry.logging.info
import aws.smithy.kotlin.runtime.telemetry.logging.warn
Expand All @@ -33,8 +34,6 @@ private const val CREDENTIALS_BASE_PATH: String = "/latest/meta-data/iam/securit
private const val CODE_ASSUME_ROLE_UNAUTHORIZED_ACCESS: String = "AssumeRoleUnauthorizedAccess"
private const val PROVIDER_NAME = "IMDSv2"

internal expect class SdkIOException : Exception // FIXME move this to the proper place when we do the larger KMP Exception refactor

/**
* [CredentialsProvider] that uses EC2 instance metadata service (IMDS) to provide credentials information.
* This provider requires that the EC2 instance has an [instance profile](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#ec2-instance-profile)
Expand Down Expand Up @@ -145,7 +144,7 @@ public class ImdsCredentialsProvider(
}

private suspend fun useCachedCredentials(ex: Exception): Credentials? = when {
ex is SdkIOException || ex is EC2MetadataError && ex.statusCode == HttpStatusCode.InternalServerError.value -> {
ex is IOException || ex is EC2MetadataError && ex.statusCode == HttpStatusCode.InternalServerError.value -> {
mu.withLock {
previousCredentials?.apply { nextRefresh = clock.now() + DEFAULT_CREDENTIALS_REFRESH_SECONDS.seconds }
}
Expand Down
Loading