Signed-off-by: Mend Renovate <bot@renovateapp.com>
| ... | ... |
@@ -17,7 +17,7 @@ require ( |
| 17 | 17 |
github.com/aws/aws-sdk-go-v2/credentials v1.19.13 |
| 18 | 18 |
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 |
| 19 | 19 |
github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.66.0 |
| 20 |
- github.com/aws/smithy-go v1.24.2 |
|
| 20 |
+ github.com/aws/smithy-go v1.25.0 |
|
| 21 | 21 |
github.com/cloudflare/cfssl v1.6.5 |
| 22 | 22 |
github.com/containerd/cgroups/v3 v3.1.3 |
| 23 | 23 |
github.com/containerd/containerd/api v1.10.0 |
| ... | ... |
@@ -113,8 +113,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18 h1:mP49nTpfKtpXLt5SLn8Uv8z |
| 113 | 113 |
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.18/go.mod h1:YO8TrYtFdl5w/4vmjL8zaBSsiNp3w0L1FfKVKenZT7w= |
| 114 | 114 |
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 h1:p8ogvvLugcR/zLBXTXrTkj0RYBUdErbMnAFFp12Lm/U= |
| 115 | 115 |
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10/go.mod h1:60dv0eZJfeVXfbT1tFJinbHrDfSJ2GZl4Q//OSSNAVw= |
| 116 |
-github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng= |
|
| 117 |
-github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= |
|
| 116 |
+github.com/aws/smithy-go v1.25.0 h1:Sz/XJ64rwuiKtB6j98nDIPyYrV1nVNJ4YU74gttcl5U= |
|
| 117 |
+github.com/aws/smithy-go v1.25.0/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= |
|
| 118 | 118 |
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= |
| 119 | 119 |
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= |
| 120 | 120 |
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= |
| 121 | 121 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,172 @@ |
| 0 |
+# AGENTS.md |
|
| 1 |
+ |
|
| 2 |
+## Project overview |
|
| 3 |
+ |
|
| 4 |
+smithy-go is the Go code generator and runtime for [Smithy](https://smithy.io/). |
|
| 5 |
+It has two major components: |
|
| 6 |
+ |
|
| 7 |
+1. **Codegen** (`codegen/`) — A Smithy build plugin written in Java that |
|
| 8 |
+ generates Go client/server/shape code from Smithy models. |
|
| 9 |
+2. **Runtime** (`./`, top-level Go module) — The Go packages that generated |
|
| 10 |
+ code depends on at runtime. |
|
| 11 |
+ |
|
| 12 |
+The primary downstream consumer is |
|
| 13 |
+[aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). |
|
| 14 |
+ |
|
| 15 |
+## Repository layout |
|
| 16 |
+ |
|
| 17 |
+``` |
|
| 18 |
+. # Root Go module (github.com/aws/smithy-go) |
|
| 19 |
+├── auth/ # Auth identity + scheme interfaces |
|
| 20 |
+│ └── bearer/ # Bearer token auth |
|
| 21 |
+├── aws-http-auth/ # Separate module: AWS SigV4/SigV4A HTTP signing |
|
| 22 |
+├── codegen/ # Java/Gradle: Smithy code generator |
|
| 23 |
+│ ├── smithy-go-codegen/ # Main codegen source (Java) |
|
| 24 |
+│ └── smithy-go-codegen-test/ # Codegen integration tests |
|
| 25 |
+├── container/ # Generic container types |
|
| 26 |
+├── context/ # Context helpers |
|
| 27 |
+├── document/ # Smithy document type abstraction |
|
| 28 |
+│ └── json/ # JSON document codec |
|
| 29 |
+├── encoding/ # Wire format encoders/decoders |
|
| 30 |
+│ ├── cbor/ # CBOR (used by rpcv2Cbor) |
|
| 31 |
+│ ├── httpbinding/ # HTTP binding serde helpers |
|
| 32 |
+│ ├── json/ # JSON encoder/decoder |
|
| 33 |
+│ └── xml/ # XML encoder/decoder |
|
| 34 |
+├── endpoints/ # Endpoint resolution types |
|
| 35 |
+├── internal/ # Internal utilities (singleflight, etc.) |
|
| 36 |
+├── io/ # I/O helpers |
|
| 37 |
+├── logging/ # Logging interfaces |
|
| 38 |
+├── metrics/ # Metrics interfaces |
|
| 39 |
+│ └── smithyotelmetrics/ # Separate module: OpenTelemetry metrics adapter |
|
| 40 |
+├── middleware/ # Middleware stack (the core of the operation pipeline) |
|
| 41 |
+├── ptr/ # Pointer-to/from-value helpers |
|
| 42 |
+├── testing/ # Test assertion helpers for generated protocol tests |
|
| 43 |
+│ └── xml/ # XML comparison utilities |
|
| 44 |
+├── time/ # Smithy timestamp format helpers |
|
| 45 |
+├── tracing/ # Tracing interfaces |
|
| 46 |
+│ └── smithyoteltracing/ # Separate module: OpenTelemetry tracing adapter |
|
| 47 |
+└── transport/ |
|
| 48 |
+ └── http/ # HTTP request/response types and middleware |
|
| 49 |
+``` |
|
| 50 |
+ |
|
| 51 |
+## Building and testing |
|
| 52 |
+ |
|
| 53 |
+### Runtime (Go) |
|
| 54 |
+ |
|
| 55 |
+```bash |
|
| 56 |
+# Run unit tests |
|
| 57 |
+make unit |
|
| 58 |
+``` |
|
| 59 |
+ |
|
| 60 |
+### Codegen (Java) |
|
| 61 |
+ |
|
| 62 |
+```bash |
|
| 63 |
+# Build and test codegen |
|
| 64 |
+cd codegen && ./gradlew build |
|
| 65 |
+ |
|
| 66 |
+# Publish to local Maven for downstream use |
|
| 67 |
+cd codegen && ./gradlew publishToMavenLocal |
|
| 68 |
+``` |
|
| 69 |
+ |
|
| 70 |
+The codegen artifact version is fixed at `0.1.0` and is not published to |
|
| 71 |
+Maven Central — you **MUST** `publishToMavenLocal`. |
|
| 72 |
+ |
|
| 73 |
+## Runtime architecture |
|
| 74 |
+ |
|
| 75 |
+### Middleware stack |
|
| 76 |
+ |
|
| 77 |
+The operation pipeline is built on a middleware stack defined in `middleware/`. |
|
| 78 |
+Steps execute in order: Initialize → Serialize → Build → Finalize → |
|
| 79 |
+Deserialize. Each step is a `middleware.Step` that holds an ordered list of |
|
| 80 |
+middleware. The codegen generates middleware registrations for each operation. |
|
| 81 |
+ |
|
| 82 |
+### Encoding packages |
|
| 83 |
+ |
|
| 84 |
+Each wire format has its own encoder/decoder under `encoding/`. These are |
|
| 85 |
+low-level — they produce/consume raw tokens or values, not full Smithy shapes. |
|
| 86 |
+Generated serde code calls into these packages. |
|
| 87 |
+ |
|
| 88 |
+## Codegen: GoWriter and template system |
|
| 89 |
+ |
|
| 90 |
+GoWriter extends Smithy's `SymbolWriter` and is the primary mechanism for |
|
| 91 |
+generating Go source. It has **two distinct writing styles** that must not be |
|
| 92 |
+confused. |
|
| 93 |
+ |
|
| 94 |
+### Style 1: Positional args (`writer.write` / `writer.openBlock`) |
|
| 95 |
+ |
|
| 96 |
+Inherited from `SymbolWriter`. Arguments are positional and referenced with |
|
| 97 |
+`$`-prefixed format characters. Each `$X` consumes the next argument in order. |
|
| 98 |
+ |
|
| 99 |
+Format characters: |
|
| 100 |
+- `$L` — Literal (toString). Strings, names, anything that should be inserted |
|
| 101 |
+ verbatim. |
|
| 102 |
+- `$S` — String, quoted. Wraps the value in Go double-quotes. |
|
| 103 |
+- `$T` — Type (Symbol). Inserts the symbol name and auto-adds its import. |
|
| 104 |
+- `$P` — Pointable type (Symbol). Like `$T` but prepends `*` if the symbol is |
|
| 105 |
+ marked pointable. |
|
| 106 |
+- `$W` — Writable. Evaluates a `Writable` (lambda/closure) inline. |
|
| 107 |
+- `$D` — Dependency. Adds a `GoDependency` import, expands to empty string. |
|
| 108 |
+ |
|
| 109 |
+Numbered variants (`$1L`, `$2T`, etc.) allow reusing the same argument |
|
| 110 |
+multiple times. The number is 1-indexed and refers to the position in the |
|
| 111 |
+argument list: |
|
| 112 |
+ |
|
| 113 |
+```java |
|
| 114 |
+// $1L is used twice, $2L once — only 2 args needed |
|
| 115 |
+writer.write("type $1L struct{}\nvar _ $2L = (*$1L)(nil)",
|
|
| 116 |
+ DEFAULT_NAME, INTERFACE_NAME); |
|
| 117 |
+``` |
|
| 118 |
+ |
|
| 119 |
+`openBlock`/`closeBlock` manage indentation for braced blocks. Arguments are |
|
| 120 |
+positional: |
|
| 121 |
+ |
|
| 122 |
+```java |
|
| 123 |
+writer.openBlock("func (c $P) $T(ctx $T) ($P, error) {", "}",
|
|
| 124 |
+ serviceSymbol, operationSymbol, contextSymbol, outputSymbol, |
|
| 125 |
+ () -> {
|
|
| 126 |
+ writer.write("return nil, nil");
|
|
| 127 |
+ }); |
|
| 128 |
+``` |
|
| 129 |
+ |
|
| 130 |
+### Style 2: Named template args (`goTemplate` / `writeGoTemplate`) |
|
| 131 |
+ |
|
| 132 |
+Uses `$name:X` syntax where `name` is a key in a `Map<String, Object>` and `X` |
|
| 133 |
+is the format character. Arguments are passed as one or more maps. This is the |
|
| 134 |
+**preferred style for new code** — it is more readable and less error-prone |
|
| 135 |
+than positional args. |
|
| 136 |
+ |
|
| 137 |
+```java |
|
| 138 |
+return goTemplate("""
|
|
| 139 |
+ func $name:L(v $cborValue:T) ($type:T, error) {
|
|
| 140 |
+ return $coercer:T(v) |
|
| 141 |
+ } |
|
| 142 |
+ """, |
|
| 143 |
+ Map.of( |
|
| 144 |
+ "name", getDeserializerName(shape), |
|
| 145 |
+ "cborValue", SmithyGoTypes.Encoding.Cbor.Value, |
|
| 146 |
+ "type", symbolProvider.toSymbol(shape), |
|
| 147 |
+ "coercer", coercer |
|
| 148 |
+ )); |
|
| 149 |
+``` |
|
| 150 |
+ |
|
| 151 |
+Rules: |
|
| 152 |
+- `goTemplate(String, Map...)` is a **static** method that returns a |
|
| 153 |
+ `Writable` (a `Consumer<GoWriter>` lambda). It does NOT write immediately. |
|
| 154 |
+- `writeGoTemplate(String, Map...)` is an **instance** method that writes |
|
| 155 |
+ immediately to the writer. |
|
| 156 |
+- Maps are merged into the writer's context scope for the duration of the |
|
| 157 |
+ template. Multiple maps can be passed and are applied in order. |
|
| 158 |
+- The writer pre-populates common symbols in context: `fmt.Sprintf`, |
|
| 159 |
+ `fmt.Errorf`, `errors.As`, `context.Context`, `time.Now`. |
|
| 160 |
+ |
|
| 161 |
+### Composing writables |
|
| 162 |
+ |
|
| 163 |
+- `ChainWritable` — Collects multiple `Writable`s and composes them with |
|
| 164 |
+ newlines between each. Use `.compose()` (with newlines) or |
|
| 165 |
+ `.compose(false)` (without). |
|
| 166 |
+ |
|
| 167 |
+### Symbol constants |
|
| 168 |
+ |
|
| 169 |
+For symbols, use `SmithyGoDependency.*.valueSymbol("Name")` or
|
|
| 170 |
+`SmithyGoDependency.*.pointableSymbol("Name")`.
|
|
| 171 |
+ |
| ... | ... |
@@ -1,8 +1,28 @@ |
| 1 |
-# Release (2026-02-27) |
|
| 1 |
+# Release (2026-04-15) |
|
| 2 |
+ |
|
| 3 |
+## General Highlights |
|
| 4 |
+* **Dependency Update**: Updated to the latest SDK module versions |
|
| 5 |
+ |
|
| 6 |
+## Module Highlights |
|
| 7 |
+* `github.com/aws/smithy-go`: v1.25.0 |
|
| 8 |
+ * **Feature**: Add support for endpointBdd trait |
|
| 9 |
+ |
|
| 10 |
+# Release (2026-04-02) |
|
| 2 | 11 |
|
| 3 | 12 |
## General Highlights |
| 4 | 13 |
* **Dependency Update**: Updated to the latest SDK module versions |
| 5 | 14 |
|
| 15 |
+## Module Highlights |
|
| 16 |
+* `github.com/aws/smithy-go`: v1.24.3 |
|
| 17 |
+ * **Bug Fix**: Add additional sigv4 configuration. |
|
| 18 |
+* `github.com/aws/smithy-go/aws-http-auth`: [v1.1.3](aws-http-auth/CHANGELOG.md#v113-2026-04-02) |
|
| 19 |
+ * **Bug Fix**: Add additional sigv4 configuration. |
|
| 20 |
+ |
|
| 21 |
+# Release (2026-02-27) |
|
| 22 |
+ |
|
| 23 |
+## General Highlights |
|
| 24 |
+* **Dependency Update**: Bump minimum go version to 1.24. |
|
| 25 |
+ |
|
| 6 | 26 |
# Release (2026-02-20) |
| 7 | 27 |
|
| 8 | 28 |
## General Highlights |
| 9 | 29 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,16 @@ |
| 0 |
+package rulesfn |
|
| 1 |
+ |
|
| 2 |
+import "strings" |
|
| 3 |
+ |
|
| 4 |
+// Split splits the input string by the delimiter and returns the resulting |
|
| 5 |
+// parts. If limit is > 0, at most limit substrings are returned. |
|
| 6 |
+// Returns a slice with a single empty string if the input is empty. |
|
| 7 |
+func Split(input, delimiter string, limit int) []string {
|
|
| 8 |
+ if len(input) == 0 {
|
|
| 9 |
+ return []string{""}
|
|
| 10 |
+ } |
|
| 11 |
+ if limit > 0 {
|
|
| 12 |
+ return strings.SplitN(input, delimiter, limit) |
|
| 13 |
+ } |
|
| 14 |
+ return strings.Split(input, delimiter) |
|
| 15 |
+} |
| ... | ... |
@@ -273,7 +273,7 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc/types |
| 273 | 273 |
github.com/aws/aws-sdk-go-v2/service/sts |
| 274 | 274 |
github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints |
| 275 | 275 |
github.com/aws/aws-sdk-go-v2/service/sts/types |
| 276 |
-# github.com/aws/smithy-go v1.24.2 |
|
| 276 |
+# github.com/aws/smithy-go v1.25.0 |
|
| 277 | 277 |
## explicit; go 1.24 |
| 278 | 278 |
github.com/aws/smithy-go |
| 279 | 279 |
github.com/aws/smithy-go/auth |