diff --git a/.gitignore b/.gitignore index 149e3151c212..af0c6674c88f 100644 --- a/.gitignore +++ b/.gitignore @@ -111,6 +111,7 @@ seed/**/.pytest_cache/ seed/**/.mypy_cache/ seed/**/.ruff_cache/ seed/**/*.egg-info/ +seed/**/.golangci.yml # Seed remote-local test outputs, except for seed.yml files seed-remote-local/* @@ -119,5 +120,9 @@ seed-remote-local/* # Test logs from test-remote-local.sh test-remote-local-logs-*/ +# macOS system dirs leaked by local Poetry/Python execution +seed/**/Library/Application Support/ +seed/**/Library/Caches/ + # Devbox gradle properties /gradle.properties diff --git a/devbox.json b/devbox.json index e0d0c492df4d..44b62ef2ee88 100644 --- a/devbox.json +++ b/devbox.json @@ -8,10 +8,9 @@ "poetry@1.8", "jdk@17", "gradle@8.5", - "ruby@3.3", + "ruby@3.4", "rubocop@latest", "php@8.4", - "php84Packages.composer@2.7", "rustup@latest", "ruff@0.15", "buf@1.50.0", @@ -28,10 +27,17 @@ "printf '\\033]0;%s\\007' 'fern (devbox)'", "unset GOROOT # Unset GOROOT from parent shell to avoid conflicts with devbox's Go", "export PATH=\"$(go env GOPATH)/bin:$PATH\"", + "command -v golangci-lint &>/dev/null || { echo 'Installing golangci-lint...'; go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1 2>/dev/null || true; }", + "mkdir -p \"$HOME/.local/bin\"", + "if [ ! -f \"$HOME/.local/bin/composer\" ]; then echo 'Installing composer...'; curl -sSL https://getcomposer.org/download/latest-2.x/composer.phar -o \"$HOME/.local/bin/composer\" && chmod +x \"$HOME/.local/bin/composer\"; fi", + "if [ ! -f \"$HOME/.local/bin/php-cs-fixer\" ]; then echo 'Installing php-cs-fixer...'; curl -sSL https://cs.symfony.com/download/php-cs-fixer-v3.phar -o \"$HOME/.local/bin/php-cs-fixer\" && chmod +x \"$HOME/.local/bin/php-cs-fixer\"; fi", + "export PATH=\"$HOME/.local/bin:$PATH\"", + "if [ -f /usr/bin/xcrun ]; then mkdir -p \"$HOME/.local/bin\" && ln -sf /usr/bin/xcrun \"$HOME/.local/bin/xcrun\"; fi # Use system xcrun instead of nix xcbuild", "rustup default stable 2>/dev/null || true", "rustup component add rustfmt 2>/dev/null || true", "bash scripts/setup-dotnet.sh 2>/dev/null || true", - "export PATH=\"$HOME/.dotnet:$PATH\"", + "export DOTNET_ROOT=\"$HOME/.dotnet\"", + "export PATH=\"$HOME/.dotnet:$HOME/.dotnet/tools:$PATH\"", "echo 'Node.js:' $(node --version)", "echo 'pnpm:' $(pnpm --version 2>/dev/null || echo 'not available')", "echo 'Go:' $(go version)", diff --git a/devbox.lock b/devbox.lock index fdc113a3d3ce..0afcf075080b 100644 --- a/devbox.lock +++ b/devbox.lock @@ -483,54 +483,6 @@ } } }, - "php84Packages.composer@2.7": { - "last_modified": "2024-10-02T21:32:52Z", - "resolved": "github:NixOS/nixpkgs/fd698a4ab779fb7fb95425f1b56974ba9c2fa16c#php84Packages.composer", - "source": "devbox-search", - "version": "2.7.9", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/nh3pqv4bsgivzvmc919sqvv8km265c77-composer-2.7.9", - "default": true - } - ], - "store_path": "/nix/store/nh3pqv4bsgivzvmc919sqvv8km265c77-composer-2.7.9" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/iardqmy3i0cy4l9r045p7g5qb9dca8p9-composer-2.7.9", - "default": true - } - ], - "store_path": "/nix/store/iardqmy3i0cy4l9r045p7g5qb9dca8p9-composer-2.7.9" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/x6z4hy24dn5l9inqcs4a5wm5layiil67-composer-2.7.9", - "default": true - } - ], - "store_path": "/nix/store/x6z4hy24dn5l9inqcs4a5wm5layiil67-composer-2.7.9" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/9ajnzd7i6ywxv7mav92032iryrc4jm0g-composer-2.7.9", - "default": true - } - ], - "store_path": "/nix/store/9ajnzd7i6ywxv7mav92032iryrc4jm0g-composer-2.7.9" - } - } - }, "php@8.4": { "last_modified": "2026-03-21T07:29:51Z", "plugin_version": "0.0.3", @@ -750,68 +702,68 @@ } } }, - "ruby@3.3": { - "last_modified": "2026-01-23T17:20:52Z", + "ruby@3.4": { + "last_modified": "2026-03-21T07:29:51Z", "plugin_version": "0.0.2", - "resolved": "github:NixOS/nixpkgs/a1bab9e494f5f4939442a57a58d0449a109593fe#ruby", + "resolved": "github:NixOS/nixpkgs/09061f748ee21f68a089cd5d91ec1859cd93d0be#ruby", "source": "devbox-search", - "version": "3.3.10", + "version": "3.4.8", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/d9wal8y7w1zpvyas3x1q4ykz880mmklk-ruby-3.3.10", + "path": "/nix/store/88sazm3fj9kabg4pxmnjc53cx0syp8fk-ruby-3.4.8", "default": true }, { "name": "devdoc", - "path": "/nix/store/1rfqp0848j3gnm222ls3bipk1azcrrq3-ruby-3.3.10-devdoc" + "path": "/nix/store/mk7a50jsk138apqrnlzc077cik8cr47m-ruby-3.4.8-devdoc" } ], - "store_path": "/nix/store/d9wal8y7w1zpvyas3x1q4ykz880mmklk-ruby-3.3.10" + "store_path": "/nix/store/88sazm3fj9kabg4pxmnjc53cx0syp8fk-ruby-3.4.8" }, "aarch64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/1hlahw0ijkxx1aqy3x41k3gxpgv34g7d-ruby-3.3.10", + "path": "/nix/store/rpcpk0lxd8iliza4nl9apsgrpsb2yk4d-ruby-3.4.8", "default": true }, { "name": "devdoc", - "path": "/nix/store/arvi0gqvw07ngbi2ci20dn5ka2jz5irv-ruby-3.3.10-devdoc" + "path": "/nix/store/9wnq7dd2yw2lbjs69y19lm08ranqa930-ruby-3.4.8-devdoc" } ], - "store_path": "/nix/store/1hlahw0ijkxx1aqy3x41k3gxpgv34g7d-ruby-3.3.10" + "store_path": "/nix/store/rpcpk0lxd8iliza4nl9apsgrpsb2yk4d-ruby-3.4.8" }, "x86_64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/as6xdshxpansvkag8zqr602ajkn9079z-ruby-3.3.10", + "path": "/nix/store/gq0vdqfz16vf64ip8p749rmygxd7n3x1-ruby-3.4.8", "default": true }, { "name": "devdoc", - "path": "/nix/store/wix1487x3br4gxa0il4q6llz5xyqxspl-ruby-3.3.10-devdoc" + "path": "/nix/store/k3yn26wvgk4mfrd5nw4a23wnijd9hz6c-ruby-3.4.8-devdoc" } ], - "store_path": "/nix/store/as6xdshxpansvkag8zqr602ajkn9079z-ruby-3.3.10" + "store_path": "/nix/store/gq0vdqfz16vf64ip8p749rmygxd7n3x1-ruby-3.4.8" }, "x86_64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/6jz2pgmsh06z9a83qi33f6lp9w2q6mzm-ruby-3.3.10", + "path": "/nix/store/s57rf37r1i38kpm3nlv4h8f8z2w2n80d-ruby-3.4.8", "default": true }, { "name": "devdoc", - "path": "/nix/store/kah8xsbcd10iakxqmlw558iarhsrd5vi-ruby-3.3.10-devdoc" + "path": "/nix/store/4k6c15chplw6cicc6f3lgzmi7i4792j6-ruby-3.4.8-devdoc" } ], - "store_path": "/nix/store/6jz2pgmsh06z9a83qi33f6lp9w2q6mzm-ruby-3.3.10" + "store_path": "/nix/store/s57rf37r1i38kpm3nlv4h8f8z2w2n80d-ruby-3.4.8" } } }, diff --git a/generators/base/src/AbstractGeneratorAgent.ts b/generators/base/src/AbstractGeneratorAgent.ts index 1d6c9712308b..4125dba6f02f 100644 --- a/generators/base/src/AbstractGeneratorAgent.ts +++ b/generators/base/src/AbstractGeneratorAgent.ts @@ -10,6 +10,7 @@ import { ReferenceConfigBuilder } from "./reference/index.js"; import { RawGithubConfig, resolveGitHubConfig } from "./utils/index.js"; const FEATURES_CONFIG_PATHS = [ + ...(process.env.FERN_FEATURES_YML_PATH != null ? [process.env.FERN_FEATURES_YML_PATH] : []), "/assets/features.yml", path.join(__dirname, "./features.yml"), path.join(__dirname, "./assets/features.yml"), diff --git a/generators/go-v2/sdk/src/endpoint/request/WrappedEndpointRequest.ts b/generators/go-v2/sdk/src/endpoint/request/WrappedEndpointRequest.ts index b3d2a9c3e316..832fd6ba712d 100644 --- a/generators/go-v2/sdk/src/endpoint/request/WrappedEndpointRequest.ts +++ b/generators/go-v2/sdk/src/endpoint/request/WrappedEndpointRequest.ts @@ -117,17 +117,29 @@ export class WrappedEndpointRequest extends EndpointRequest { fileProperty: FernIr.FileProperty; }): void { switch (fileProperty.type) { - case "file": + case "file": { + const fileRef = this.getRequestPropertyReference({ + fieldName: fileProperty.key.name, + isFile: true + }); + if (fileProperty.isOptional) { + writer.writeNewLineIfLastLineNot(); + writer.writeLine(`if ${fileRef} != nil {`); + writer.indent(); + } this.writeFileUploadField({ writer, key: fileProperty.key.wireValue, - value: go.codeblock( - this.getRequestPropertyReference({ fieldName: fileProperty.key.name, isFile: true }) - ), + value: go.codeblock(fileRef), contentType: fileProperty.contentType, format: "file" }); + if (fileProperty.isOptional) { + writer.dedent(); + writer.writeLine("}"); + } break; + } case "fileArray": writer.writeLine( `for _, f := range ${this.getRequestPropertyReference({ fieldName: fileProperty.key.name, isFile: true })} {` diff --git a/generators/go/sdk/versions.yml b/generators/go/sdk/versions.yml index 00974711e759..296bd56f9a5b 100644 --- a/generators/go/sdk/versions.yml +++ b/generators/go/sdk/versions.yml @@ -1,4 +1,16 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 1.33.3 + changelogEntry: + - summary: | + Fix nil pointer dereference panic when optional file fields are not + provided in multipart form-data requests. The generated code now wraps + `WriteFile` calls for optional binary fields in a nil guard, matching + the existing behavior for optional non-file body properties. Required + file fields remain unconditional. + type: fix + createdAt: "2026-04-07" + irVersion: 61 + - version: 1.33.2 changelogEntry: - summary: | diff --git a/generators/php/dynamic-snippets/src/EndpointSnippetGenerator.ts b/generators/php/dynamic-snippets/src/EndpointSnippetGenerator.ts index b713a66f6c9a..1a51101d7153 100644 --- a/generators/php/dynamic-snippets/src/EndpointSnippetGenerator.ts +++ b/generators/php/dynamic-snippets/src/EndpointSnippetGenerator.ts @@ -321,16 +321,24 @@ export class EndpointSnippetGenerator { auth: FernIr.dynamic.BasicAuth; values: FernIr.dynamic.BasicAuthValues; }): NamedArgument[] { - return [ - { + // usernameOmit/passwordOmit may exist in newer IR versions + const authRecord = auth as unknown as Record; + const usernameOmitted = !!authRecord.usernameOmit; + const passwordOmitted = !!authRecord.passwordOmit; + const args: NamedArgument[] = []; + if (!usernameOmitted) { + args.push({ name: this.context.getPropertyName(auth.username), assignment: php.TypeLiteral.string(values.username) - }, - { + }); + } + if (!passwordOmitted) { + args.push({ name: this.context.getPropertyName(auth.password), assignment: php.TypeLiteral.string(values.password) - } - ]; + }); + } + return args; } private getConstructorEnvironmentArg({ diff --git a/generators/php/sdk/src/root-client/RootClientGenerator.ts b/generators/php/sdk/src/root-client/RootClientGenerator.ts index a35d9b8075b8..b1f82e648fd9 100644 --- a/generators/php/sdk/src/root-client/RootClientGenerator.ts +++ b/generators/php/sdk/src/root-client/RootClientGenerator.ts @@ -355,26 +355,25 @@ export class RootClientGenerator extends FileGenerator s.type === "basic" ); - if (basicAuthSchemes.length > 0) { + const resolvedBasicAuthSchemes = basicAuthSchemes + .map((scheme) => this.resolveBasicAuthScheme(scheme)) + .filter((resolved) => resolved != null); + if (resolvedBasicAuthSchemes.length > 0) { const isAuthOptional = !this.context.ir.sdkConfig.isAuthMandatory; - for (let i = 0; i < basicAuthSchemes.length; i++) { - const basicAuthScheme = basicAuthSchemes[i]; - if (basicAuthScheme == null) { + const needsControlFlow = isAuthOptional || resolvedBasicAuthSchemes.length > 1; + for (let i = 0; i < resolvedBasicAuthSchemes.length; i++) { + const resolved = resolvedBasicAuthSchemes[i]; + if (resolved == null) { continue; } - const usernameName = this.context.getParameterName(basicAuthScheme.username); - const passwordName = this.context.getParameterName(basicAuthScheme.password); - if (isAuthOptional || basicAuthSchemes.length > 1) { - const controlFlowKeyword = i === 0 ? "if" : "else if"; - writer.controlFlow( - controlFlowKeyword, - php.codeblock(`$${usernameName} !== null && $${passwordName} !== null`) - ); + const { condition, credentialExpr } = resolved; + if (needsControlFlow) { + writer.controlFlow(i === 0 ? "if" : "else if", php.codeblock(condition)); } writer.writeLine( - `$defaultHeaders['Authorization'] = "Basic " . base64_encode($${usernameName} . ":" . $${passwordName});` + `$defaultHeaders['Authorization'] = "Basic " . base64_encode(${credentialExpr});` ); - if (isAuthOptional || basicAuthSchemes.length > 1) { + if (needsControlFlow) { writer.endControlFlow(); } } @@ -605,8 +604,12 @@ export class RootClientGenerator extends FileGenerator { diff --git a/generators/php/sdk/src/wire-tests/WireTestGenerator.ts b/generators/php/sdk/src/wire-tests/WireTestGenerator.ts index 0beadd9f0892..52ad85c39df5 100644 --- a/generators/php/sdk/src/wire-tests/WireTestGenerator.ts +++ b/generators/php/sdk/src/wire-tests/WireTestGenerator.ts @@ -489,9 +489,13 @@ export class WireTestGenerator { bearer: () => { authParams.push("token: 'test-token'"); }, - basic: () => { - authParams.push("username: 'test-user'"); - authParams.push("password: 'test-password'"); + basic: (basicScheme) => { + if (!basicScheme.usernameOmit) { + authParams.push("username: 'test-username'"); + } + if (!basicScheme.passwordOmit) { + authParams.push("password: 'test-password'"); + } }, header: (header) => { const paramName = this.case.camelSafe(header.name); diff --git a/generators/php/sdk/versions.yml b/generators/php/sdk/versions.yml index b24a50dc1cb3..b54d3ce2a567 100644 --- a/generators/php/sdk/versions.yml +++ b/generators/php/sdk/versions.yml @@ -1,4 +1,16 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 2.4.0 + changelogEntry: + - summary: | + Support omitting username or password from basic auth when configured via + `usernameOmit` or `passwordOmit` in the IR. Omitted fields are removed from + the SDK's public API and treated as empty strings internally (e.g., omitting + password encodes `username:`, omitting username encodes `:password`). When + both are omitted, the Authorization header is skipped entirely. + type: feat + createdAt: "2026-04-02" + irVersion: 66 + - version: 2.3.2-rc.0 changelogEntry: - summary: | diff --git a/generators/python/setup-python.sh b/generators/python/setup-python.sh index 166cb1e5c51e..7471d36cc3b6 100755 --- a/generators/python/setup-python.sh +++ b/generators/python/setup-python.sh @@ -1,8 +1,8 @@ -# Use 3.9 because some of our internal SDKs are on extremely old generator +# Use 3.10 because some of our internal SDKs are on extremely old generator # versions that don't support 3.8 export PYENV_ROOT="$HOME/.pyenv" [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" -pyenv shell 3.9 +pyenv shell 3.10 pip install poetry -poetry env use 3.9 +poetry env use 3.10 diff --git a/generators/python/src/fern_python/generators/sdk/as_is_copier.py b/generators/python/src/fern_python/generators/sdk/as_is_copier.py index 50cf095d4bea..44bcf26f040a 100644 --- a/generators/python/src/fern_python/generators/sdk/as_is_copier.py +++ b/generators/python/src/fern_python/generators/sdk/as_is_copier.py @@ -102,8 +102,11 @@ def _copy_directory_to_project( path_in_project: str, replacements: Optional[Dict[str, str]] = None, ) -> None: - source = ( - os.path.join(os.path.dirname(__file__), "../../../../../") if "PYTEST_CURRENT_TEST" in os.environ else "/assets" + source = os.environ.get( + "FERN_ASSETS_PATH", + os.path.join(os.path.dirname(__file__), "../../../../../") + if "PYTEST_CURRENT_TEST" in os.environ + else "/assets", ) for _, _, files in os.walk(os.path.join(source, relative_path_on_disk)): @@ -130,8 +133,11 @@ def _copy_file_to_project( replacements: Optional[Dict[str, str]] = None, ) -> None: # Project root source, so all from_ requests should be relative to that - source = ( - os.path.join(os.path.dirname(__file__), "../../../../../") if "PYTEST_CURRENT_TEST" in os.environ else "/assets" + source = os.environ.get( + "FERN_ASSETS_PATH", + os.path.join(os.path.dirname(__file__), "../../../../../") + if "PYTEST_CURRENT_TEST" in os.environ + else "/assets", ) SourceFileFactory.add_source_file_from_disk( project=project, diff --git a/generators/python/src/fern_python/generators/sdk/core_utilities/core_utilities.py b/generators/python/src/fern_python/generators/sdk/core_utilities/core_utilities.py index 637ac54a05f1..0957b022ba9a 100644 --- a/generators/python/src/fern_python/generators/sdk/core_utilities/core_utilities.py +++ b/generators/python/src/fern_python/generators/sdk/core_utilities/core_utilities.py @@ -328,6 +328,23 @@ def copy_to_project(self, *, project: Project) -> None: else: project.add_dependency(PYDANTIC_DEPENDENCY) + @staticmethod + def _resolve_core_utilities_path(relative_filepath: str) -> str: + """Resolve the core utilities source directory. + + Supports FERN_CORE_UTILITIES_PATH env var with colon-separated paths + for local execution where sdk/ and shared/ are separate directories. + """ + env_paths = os.environ.get("FERN_CORE_UTILITIES_PATH") + if env_paths is not None: + for source in env_paths.split(":"): + if os.path.exists(os.path.join(source, relative_filepath)): + return source + return env_paths.split(":")[0] + if "PYTEST_CURRENT_TEST" in os.environ: + return os.path.join(os.path.dirname(__file__), "../../../../../core_utilities/sdk") + return "/assets/core_utilities" + def _copy_file_to_project( self, *, @@ -337,11 +354,7 @@ def _copy_file_to_project( exports: Set[str], string_replacements: Optional[dict[str, str]] = None, ) -> None: - source = ( - os.path.join(os.path.dirname(__file__), "../../../../../core_utilities/sdk") - if "PYTEST_CURRENT_TEST" in os.environ - else "/assets/core_utilities" - ) + source = self._resolve_core_utilities_path(relative_filepath_on_disk) SourceFileFactory.add_source_file_from_disk( project=project, path_on_disk=os.path.join(source, relative_filepath_on_disk), @@ -352,11 +365,7 @@ def _copy_file_to_project( def _copy_http_sse_folder_to_project(self, *, project: Project) -> None: """Copy the http_sse folder using the same approach as individual file copying""" - source = ( - os.path.join(os.path.dirname(__file__), "../../../../../core_utilities/sdk") - if "PYTEST_CURRENT_TEST" in os.environ - else "/assets/core_utilities" - ) + source = self._resolve_core_utilities_path("http_sse") folder_path_on_disk = os.path.join(source, "http_sse") # Define exports for each file diff --git a/generators/python/src/fern_python/generators/sdk/v2/generator.py b/generators/python/src/fern_python/generators/sdk/v2/generator.py index aee0f9eae20b..97f97d24a808 100644 --- a/generators/python/src/fern_python/generators/sdk/v2/generator.py +++ b/generators/python/src/fern_python/generators/sdk/v2/generator.py @@ -1,3 +1,4 @@ +import os import subprocess import sys from pathlib import Path @@ -7,8 +8,8 @@ import fern.generator_exec as generator_exec # v2BinPath is the path to the python-v2 binary included in the SDK -# generator docker image. -V2_BIN_PATH = "/bin/python-v2" +# generator docker image. Can be overridden via PYTHON_V2_PATH for local execution. +V2_BIN_PATH = os.environ.get("PYTHON_V2_PATH", "/bin/python-v2") class PythonV2Generator: diff --git a/generators/ruby-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts b/generators/ruby-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts index 9da7f1332655..c588817e6f33 100644 --- a/generators/ruby-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts +++ b/generators/ruby-v2/dynamic-snippets/src/EndpointSnippetGenerator.ts @@ -213,16 +213,28 @@ export class EndpointSnippetGenerator { auth: FernIr.dynamic.BasicAuth; values: FernIr.dynamic.BasicAuthValues; }): ruby.KeywordArgument[] { - return [ - ruby.keywordArgument({ - name: auth.username.snakeCase.safeName, - value: ruby.TypeLiteral.string(values.username) - }), - ruby.keywordArgument({ - name: auth.password.snakeCase.safeName, - value: ruby.TypeLiteral.string(values.password) - }) - ]; + // usernameOmit/passwordOmit may exist in newer IR versions + const authRecord = auth as unknown as Record; + const usernameOmitted = !!authRecord.usernameOmit; + const passwordOmitted = !!authRecord.passwordOmit; + const args: ruby.KeywordArgument[] = []; + if (!usernameOmitted) { + args.push( + ruby.keywordArgument({ + name: auth.username.snakeCase.safeName, + value: ruby.TypeLiteral.string(values.username) + }) + ); + } + if (!passwordOmitted) { + args.push( + ruby.keywordArgument({ + name: auth.password.snakeCase.safeName, + value: ruby.TypeLiteral.string(values.password) + }) + ); + } + return args; } private getRootClientBearerAuthArgs({ diff --git a/generators/ruby-v2/sdk/src/root-client/RootClientGenerator.ts b/generators/ruby-v2/sdk/src/root-client/RootClientGenerator.ts index cd5e5f233399..688ff3160855 100644 --- a/generators/ruby-v2/sdk/src/root-client/RootClientGenerator.ts +++ b/generators/ruby-v2/sdk/src/root-client/RootClientGenerator.ts @@ -116,6 +116,8 @@ export class RootClientGenerator extends FileGenerator 1) { - if (i === 0) { - writer.writeLine(`if !${usernameName}.nil? && !${passwordName}.nil?`); + if (isFirstBlock) { + writer.writeLine(`if ${condition}`); } else { - writer.writeLine(`elsif !${usernameName}.nil? && !${passwordName}.nil?`); + writer.writeLine(`elsif ${condition}`); } + isFirstBlock = false; + emittedAnyBlock = true; writer.writeLine( - ` headers["Authorization"] = "Basic #{Base64.strict_encode64("#{${usernameName}}:#{${passwordName}}")}"` + ` headers["Authorization"] = "Basic #{Base64.strict_encode64(${credentialStr})}"` ); - if (i === basicAuthSchemes.length - 1) { - writer.writeLine(`end`); - } } else { writer.writeLine( - `headers["Authorization"] = "Basic #{Base64.strict_encode64("#{${usernameName}}:#{${passwordName}}")}"` + `headers["Authorization"] = "Basic #{Base64.strict_encode64(${credentialStr})}"` ); } } + if (emittedAnyBlock && (isAuthOptional || basicAuthSchemes.length > 1)) { + writer.writeLine(`end`); + } } writer.write(`@raw_client = `); writer.writeNode(this.context.getRawClientClassReference()); @@ -344,30 +372,37 @@ export class RootClientGenerator extends FileGenerator { - writer.write(`ENV.fetch("${scheme.usernameEnvVar}", nil)`); - }) - : undefined, - docs: undefined - }); - parameters.push(usernameParam); - const passwordParam = ruby.parameters.keyword({ - name: this.case.snakeSafe(scheme.password), - type: ruby.Type.string(), - initializer: - scheme.passwordEnvVar != null - ? ruby.codeblock((writer) => { - writer.write(`ENV.fetch("${scheme.passwordEnvVar}", nil)`); - }) - : undefined, - docs: undefined - }); - parameters.push(passwordParam); + // When omit is true, the field is completely removed from the end-user API. + const usernameOmitted = !!scheme.usernameOmit; + const passwordOmitted = !!scheme.passwordOmit; + if (!usernameOmitted) { + const usernameParam = ruby.parameters.keyword({ + name: this.case.snakeSafe(scheme.username), + type: ruby.Type.string(), + initializer: + scheme.usernameEnvVar != null + ? ruby.codeblock((writer) => { + writer.write(`ENV.fetch("${scheme.usernameEnvVar}", nil)`); + }) + : undefined, + docs: undefined + }); + parameters.push(usernameParam); + } + if (!passwordOmitted) { + const passwordParam = ruby.parameters.keyword({ + name: this.case.snakeSafe(scheme.password), + type: ruby.Type.string(), + initializer: + scheme.passwordEnvVar != null + ? ruby.codeblock((writer) => { + writer.write(`ENV.fetch("${scheme.passwordEnvVar}", nil)`); + }) + : undefined, + docs: undefined + }); + parameters.push(passwordParam); + } break; } case "inferred": { diff --git a/generators/ruby-v2/sdk/src/wire-tests/WireTestGenerator.ts b/generators/ruby-v2/sdk/src/wire-tests/WireTestGenerator.ts index fdf1cdea876e..32ca2850429d 100644 --- a/generators/ruby-v2/sdk/src/wire-tests/WireTestGenerator.ts +++ b/generators/ruby-v2/sdk/src/wire-tests/WireTestGenerator.ts @@ -210,8 +210,12 @@ export class WireTestGenerator { authParams.push(`${this.case.snakeSafe(scheme.name)}: "test-api-key"`); break; case "basic": - authParams.push(`${this.case.snakeSafe(scheme.username)}: "test-username"`); - authParams.push(`${this.case.snakeSafe(scheme.password)}: "test-password"`); + if (!scheme.usernameOmit) { + authParams.push(`${this.case.snakeSafe(scheme.username)}: "test-username"`); + } + if (!scheme.passwordOmit) { + authParams.push(`${this.case.snakeSafe(scheme.password)}: "test-password"`); + } break; case "oauth": authParams.push('client_id: "test-client-id"'); @@ -348,6 +352,19 @@ export class WireTestGenerator { lines.push(` query_params: ${queryParamsCode},`); lines.push(` expected: 1`); lines.push(` )`); + + // Verify Authorization header when basic auth is configured + const expectedAuthHeader = this.buildExpectedAuthorizationHeader(); + if (expectedAuthHeader != null) { + lines.push(``); + lines.push(` verify_authorization_header(`); + lines.push(` test_id: test_id,`); + lines.push(` method: "${endpoint.method}",`); + lines.push(` url_path: "${basePath}",`); + lines.push(` expected_value: "${expectedAuthHeader}"`); + lines.push(` )`); + } + lines.push(" end"); return lines; @@ -532,6 +549,26 @@ export class WireTestGenerator { return out; } + /** + * Builds the expected Authorization header value for basic auth. + * Returns the full header value (e.g., "Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk") + * or null if no basic auth scheme is configured. + */ + private buildExpectedAuthorizationHeader(): string | null { + for (const scheme of this.context.ir.auth.schemes) { + if (scheme.type === "basic") { + if (scheme.usernameOmit && scheme.passwordOmit) { + continue; + } + const username = scheme.usernameOmit ? "" : "test-username"; + const password = scheme.passwordOmit ? "" : "test-password"; + const encoded = Buffer.from(`${username}:${password}`).toString("base64"); + return `Basic ${encoded}`; + } + } + return null; + } + private toPascalCase(str: string): string { return str .split("_") diff --git a/generators/ruby-v2/sdk/src/wire-tests/WireTestSetupGenerator.ts b/generators/ruby-v2/sdk/src/wire-tests/WireTestSetupGenerator.ts index 7e7a539c193f..ec684039508f 100644 --- a/generators/ruby-v2/sdk/src/wire-tests/WireTestSetupGenerator.ts +++ b/generators/ruby-v2/sdk/src/wire-tests/WireTestSetupGenerator.ts @@ -298,6 +298,31 @@ class WireMockTestCase < Minitest::Test assert_equal expected, requests.length, "Expected #{expected} requests, found #{requests.length}" end + + # Verifies that the Authorization header on captured requests matches the expected value. + # + # @param test_id [String] The test ID used to filter requests + # @param method [String] The HTTP method (GET, POST, etc.) + # @param url_path [String] The URL path to match + # @param expected_value [String] The expected Authorization header value + def verify_authorization_header(test_id:, method:, url_path:, expected_value:) + admin_url = ENV['WIREMOCK_URL'] ? "#{ENV['WIREMOCK_URL']}/__admin" : WIREMOCK_ADMIN_URL + uri = URI("#{admin_url}/requests/find") + http = Net::HTTP.new(uri.host, uri.port) + post_request = Net::HTTP::Post.new(uri.path, { "Content-Type" => "application/json" }) + + request_body = { "method" => method, "urlPath" => url_path } + request_body["headers"] = { "X-Test-Id" => { "equalTo" => test_id } } + + post_request.body = request_body.to_json + response = http.request(post_request) + result = JSON.parse(response.body) + requests = result["requests"] || [] + + refute_empty requests, "No requests found for test_id #{test_id}" + actual_header = requests.first.dig("request", "headers", "Authorization") + assert_equal expected_value, actual_header, "Expected Authorization header '#{expected_value}', got '#{actual_header}'" + end end `; } diff --git a/generators/ruby-v2/sdk/versions.yml b/generators/ruby-v2/sdk/versions.yml index 67a00470c335..9f71110757dc 100644 --- a/generators/ruby-v2/sdk/versions.yml +++ b/generators/ruby-v2/sdk/versions.yml @@ -1,5 +1,17 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 1.4.0 + changelogEntry: + - summary: | + Support omitting username or password from basic auth when configured via + `usernameOmit` or `passwordOmit` in the IR. Omitted fields are removed from + the SDK's public API and treated as empty strings internally (e.g., omitting + password encodes `username:`, omitting username encodes `:password`). When + both are omitted, the Authorization header is skipped entirely. + type: feat + createdAt: "2026-04-02" + irVersion: 66 + - version: 1.3.0-rc.1 changelogEntry: - summary: | diff --git a/package.json b/package.json index 3e7ddebf2366..71e0cd61848c 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "java:build": "turbo run dockerTagLatest --filter @fern-api/java-sdk", "php:build": "turbo run dockerTagLatest --filter @fern-api/php-sdk", "python:build": "turbo run dist:cli --filter @fern-api/python-sdk && docker build . -f ./generators/python/sdk/Dockerfile -t fernapi/fern-python-sdk:latest", + "python:check:fix": "cd generators/python && bash setup-python.sh && poetry run pre-commit run --all-files", "ruby:build": "turbo run dockerTagLatest --filter @fern-api/ruby-sdk", "rust:build": "turbo run dockerTagLatest --filter @fern-api/rust-sdk", "swift:build": "turbo run dockerTagLatest --filter @fern-api/swift-sdk", diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index 2802ee7e571d..0c352bc9c823 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,5 +1,30 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 4.63.0 + changelogEntry: + - summary: | + Speed up `fern docs dev` bundle refresh by renaming the old bundle + and deleting it asynchronously instead of blocking on removal. + type: feat + createdAt: "2026-04-07" + irVersion: 66 + +- version: 4.62.6 + changelogEntry: + - summary: | + Clean up Fern Docs cache on `fern docs dev` startup and shutdown. + type: fix + createdAt: "2026-04-07" + irVersion: 66 + +- version: 4.62.5 + changelogEntry: + - summary: | + Fix replay init to create .gitattributes with linguist-generated markers and sync .fernignore entries with fern-replay. + type: fix + createdAt: "2026-04-07" + irVersion: 66 + - version: 4.62.4 changelogEntry: - summary: | diff --git a/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts b/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts index 394299535907..cbcca4b0b874 100644 --- a/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts +++ b/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts @@ -4,7 +4,7 @@ import { loggingExeca } from "@fern-api/logging-execa"; import chalk from "chalk"; import cliProgress from "cli-progress"; import decompress from "decompress"; -import { mkdir, readFile, rm, writeFile } from "fs/promises"; +import { mkdir, readFile, rename, rm, writeFile } from "fs/promises"; import { homedir } from "os"; import tmp from "tmp-promise"; import xml2js from "xml2js"; @@ -225,8 +225,14 @@ export async function downloadBundle({ const absolutePathToPreviewFolder = getPathToPreviewFolder({ app }); if (await doesPathExist(absolutePathToPreviewFolder)) { - logger.debug(`Removing previously cached bundle at: ${absolutePathToPreviewFolder}`); - await rm(absolutePathToPreviewFolder, { recursive: true }); + const oldBundlePath = AbsoluteFilePath.of(`${absolutePathToPreviewFolder}-old-${Date.now()}`); + logger.debug(`Moving previously cached bundle to: ${oldBundlePath}`); + await rename(absolutePathToPreviewFolder, oldBundlePath); + + // Delete the old bundle asynchronously so it doesn't block the rest of the setup + rm(oldBundlePath, { recursive: true }).catch((error) => { + logger.debug(`Failed to remove old bundle at ${oldBundlePath}: ${error}`); + }); } await mkdir(absolutePathToPreviewFolder, { recursive: true }); diff --git a/packages/cli/docs-preview/src/runAppPreviewServer.ts b/packages/cli/docs-preview/src/runAppPreviewServer.ts index 7e66ccff9a12..c1068c7fb6cc 100644 --- a/packages/cli/docs-preview/src/runAppPreviewServer.ts +++ b/packages/cli/docs-preview/src/runAppPreviewServer.ts @@ -8,6 +8,7 @@ import { TaskContext } from "@fern-api/task-context"; import chalk from "chalk"; import cors from "cors"; import express from "express"; +import fs from "fs"; import { readFile, rm } from "fs/promises"; import http, { type IncomingMessage } from "http"; import path from "path"; @@ -362,6 +363,51 @@ class SnippetDependencyTracker { } } +/** + * Resolves the path to the Fern Docs cache directory within the standalone server bundle. + * The standalone server runs from `/standalone/packages/fern-docs/bundle/server.js`, + * so its runtime cache is written to `/standalone/packages/fern-docs/bundle/.next/cache/`. + */ +function getFernDocsCachePath(bundleRoot: string): string { + return path.join(bundleRoot, "standalone/packages/fern-docs/bundle/.next/cache"); +} + +/** + * Removes the Fern Docs cache directory. + */ +async function cleanFernDocsCache(bundleRoot: string, context: TaskContext): Promise { + const cachePath = getFernDocsCachePath(bundleRoot); + try { + const cacheExists = await doesPathExist(AbsoluteFilePath.of(cachePath)); + if (cacheExists) { + context.logger.debug(`Cleaning Fern Docs cache at ${cachePath}`); + await rm(cachePath, { recursive: true }); + context.logger.debug("Fern Docs cache cleaned successfully"); + } else { + context.logger.debug("No Fern Docs cache to clean"); + } + } catch (err) { + context.logger.debug(`Failed to clean Fern Docs cache: ${err}`); + } +} + +/** + * Synchronous version of cleanFernDocsCache for use in signal handlers + * where async operations cannot be awaited. + */ +function cleanFernDocsCacheSync(bundleRoot: string, context: TaskContext): void { + const cachePath = getFernDocsCachePath(bundleRoot); + try { + if (fs.existsSync(cachePath)) { + context.logger.debug(`Cleaning Fern Docs cache at ${cachePath}`); + fs.rmSync(cachePath, { recursive: true, maxRetries: 5, retryDelay: 500 }); + context.logger.debug("Fern Docs cache cleaned successfully"); + } + } catch (err) { + context.logger.debug(`Failed to clean Fern Docs cache: ${err}`); + } +} + export async function runAppPreviewServer({ initialProject, reloadProject, @@ -681,7 +727,7 @@ export async function runAppPreviewServer({ const additionalFilepaths = project.apiWorkspaces.flatMap((workspace) => workspace.getAbsoluteFilePaths()); - // Create watcher but don't attach the event handler yet - we'll do that after restartNextJsServer is defined + // Create watcher but don't attach the event handler yet - we'll do that after the Next.js server starts const watcher = new Watcher([absoluteFilePathToFern, ...additionalFilepaths], { recursive: true, ignoreInitial: true, @@ -735,6 +781,9 @@ export async function runAppPreviewServer({ }); } + // Clean Fern Docs cache from previous runs before starting the server + await cleanFernDocsCache(bundleRoot, context); + // Now start Next.js after backend is ready const env = { ...process.env, @@ -800,46 +849,10 @@ export async function runAppPreviewServer({ }); }; - // Function to stop the current Next.js server - const stopNextJsServer = (): Promise => { - return new Promise((resolve) => { - if (serverProcess == null || serverProcess.killed) { - resolve(); - return; - } - - context.logger.debug(`Killing server process with PID: ${serverProcess.pid}`); - try { - serverProcess.kill(); - // Give it a moment to clean up - setTimeout(() => { - if (serverProcess != null && !serverProcess.killed) { - context.logger.debug(`Force killing server process with PID: ${serverProcess.pid}`); - try { - serverProcess.kill("SIGKILL"); - } catch (err) { - context.logger.error(`Failed to force kill server process: ${err}`); - } - } - resolve(); - }, 1000); - } catch (err) { - context.logger.error(`Failed to kill server process: ${err}`); - resolve(); - } - }); - }; - - // Function to restart the Next.js server - const restartNextJsServer = async (): Promise => { - await stopNextJsServer(); - await startNextJsServer(); - }; - // Start the initial server await startNextJsServer(); - // Now that restartNextJsServer is defined, attach the watcher event handler + // Attach the watcher event handler // eslint-disable-next-line @typescript-eslint/no-misused-promises watcher.on("all", async (event: string, targetPath: string, _targetPathNext: string) => { // Ignore changes to .fern/logs/ directory (contains debug logs) @@ -882,20 +895,12 @@ export async function runAppPreviewServer({ editedAbsoluteFilepaths.length = 0; - // Restart the docs server - context.logger.info("Restarting docs server..."); - await restartNextJsServer(); - - // Wait 1 second for the server to be ready - await new Promise((resolve) => setTimeout(resolve, 1000)); - - context.logger.info("Refreshing page. Please refresh manually if you don't see changes."); + isReloading = false; sendData({ version: 1, type: "finishReload" }); - isReloading = false; if (reloadedDocsDefinition != null) { // Detect slug changes before updating the docs definition @@ -921,7 +926,13 @@ export async function runAppPreviewServer({ }, RELOAD_DEBOUNCE_MS); }); + let cleanedUp = false; const cleanup = () => { + if (cleanedUp) { + return; + } + cleanedUp = true; + if (serverProcess != null && !serverProcess.killed) { context.logger.debug(`Killing server process with PID: ${serverProcess.pid}`); try { @@ -941,6 +952,10 @@ export async function runAppPreviewServer({ } } + // Clean Fern Docs cache on shutdown (sync since cleanup runs in signal handlers) + // Uses maxRetries to handle ENOTEMPTY if the server process is still writing + cleanFernDocsCacheSync(bundleRoot, context); + context.logger.debug("Cleaning up WebSocket connections..."); for (const [ws, metadata] of connections) { clearInterval(metadata.pingInterval); diff --git a/packages/commons/mock-utils/index.ts b/packages/commons/mock-utils/index.ts index 102ff53efe86..7c88bd036a03 100644 --- a/packages/commons/mock-utils/index.ts +++ b/packages/commons/mock-utils/index.ts @@ -15,7 +15,7 @@ export interface WireMockMapping { request: { urlPathTemplate: string; method: string; - headers?: Record; + headers?: Record; pathParameters?: Record; queryParameters?: Record; formParameters?: Record; @@ -267,16 +267,27 @@ export class WireMock { const shouldAddBodyPattern = needsBodyPattern && isSseResponse; // Build auth header matchers for endpoints that require authentication. - // Skip auth header matching when endpoint has per-endpoint security because - // the client configures all auth schemes globally and header overwriting - // (e.g., multiple schemes writing to "Authorization") makes the exact value unpredictable. - const authHeaders: Record = {}; - if (endpoint.auth && !(endpoint.security != null && endpoint.security.length > 0)) { + const authHeaders: Record = {}; + if (endpoint.auth) { for (const scheme of ir.auth.schemes) { switch (scheme.type) { - case "basic": - authHeaders["Authorization"] = { matches: "Basic .+" }; + case "basic": { + // Compute exact Authorization header using test credentials. + // Access usernameOmit/passwordOmit via runtime property check + // (available in IR v63+ but @fern-fern/ir-sdk types may lag). + const schemeRecord = scheme as unknown as Record; + const usernameOmit = schemeRecord.usernameOmit === true; + const passwordOmit = schemeRecord.passwordOmit === true; + if (usernameOmit && passwordOmit) { + // Both omitted — SDK skips the Authorization header entirely. + break; + } + const username = usernameOmit ? "" : "test-username"; + const password = passwordOmit ? "" : "test-password"; + const encoded = Buffer.from(`${username}:${password}`).toString("base64"); + authHeaders["Authorization"] = { equalTo: `Basic ${encoded}` }; break; + } case "bearer": authHeaders["Authorization"] = { matches: "Bearer .+" }; break; diff --git a/packages/generator-cli/src/__test__/replay-pure.test.ts b/packages/generator-cli/src/__test__/replay-pure.test.ts index d94afb0554b4..84fc0c2c6df4 100644 --- a/packages/generator-cli/src/__test__/replay-pure.test.ts +++ b/packages/generator-cli/src/__test__/replay-pure.test.ts @@ -396,7 +396,9 @@ describe("parseCommitMessageForPR", () => { describe("fernignore", () => { it("REPLAY_FERNIGNORE_ENTRIES contains expected values", () => { expect(REPLAY_FERNIGNORE_ENTRIES).toContain(".fern/replay.lock"); - expect(REPLAY_FERNIGNORE_ENTRIES.length).toBeGreaterThanOrEqual(1); + expect(REPLAY_FERNIGNORE_ENTRIES).toContain(".fern/replay.yml"); + expect(REPLAY_FERNIGNORE_ENTRIES).toContain(".gitattributes"); + expect(REPLAY_FERNIGNORE_ENTRIES.length).toBeGreaterThanOrEqual(3); }); it("creates .fernignore with entries when no file exists, returns true", async () => { diff --git a/packages/generator-cli/src/replay/fernignore.ts b/packages/generator-cli/src/replay/fernignore.ts index e623ea661241..8f1bef2f525a 100644 --- a/packages/generator-cli/src/replay/fernignore.ts +++ b/packages/generator-cli/src/replay/fernignore.ts @@ -2,7 +2,9 @@ import { existsSync, readFileSync, writeFileSync } from "fs"; import { readFile, writeFile } from "fs/promises"; import { join } from "path"; -export const REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock"]; +export const REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock", ".fern/replay.yml", ".gitattributes"]; + +const GITATTRIBUTES_ENTRIES = [".fern/replay.lock linguist-generated=true"]; export async function ensureReplayFernignoreEntries(outputDir: string): Promise { const fernignorePath = join(outputDir, ".fernignore"); @@ -22,6 +24,22 @@ export async function ensureReplayFernignoreEntries(outputDir: string): Promise< return false; } +export async function ensureGitattributesEntries(outputDir: string): Promise { + const gitattributesPath = join(outputDir, ".gitattributes"); + let content = ""; + try { + content = await readFile(gitattributesPath, "utf-8"); + } catch { + // .gitattributes doesn't exist yet + } + const lines = content.split("\n"); + const toAdd = GITATTRIBUTES_ENTRIES.filter((entry) => !lines.some((line) => line.trim() === entry)); + if (toAdd.length > 0) { + const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : ""; + await writeFile(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8"); + } +} + export function ensureReplayFernignoreEntriesSync(outputDir: string): void { const fernignorePath = join(outputDir, ".fernignore"); let content = ""; @@ -35,3 +53,17 @@ export function ensureReplayFernignoreEntriesSync(outputDir: string): void { writeFileSync(fernignorePath, content + suffix + toAdd.join("\n") + "\n", "utf-8"); } } + +export function ensureGitattributesEntriesSync(outputDir: string): void { + const gitattributesPath = join(outputDir, ".gitattributes"); + let content = ""; + if (existsSync(gitattributesPath)) { + content = readFileSync(gitattributesPath, "utf-8"); + } + const lines = content.split("\n"); + const toAdd = GITATTRIBUTES_ENTRIES.filter((entry) => !lines.some((line) => line.trim() === entry)); + if (toAdd.length > 0) { + const suffix = content.length > 0 && !content.endsWith("\n") ? "\n" : ""; + writeFileSync(gitattributesPath, content + suffix + toAdd.join("\n") + "\n", "utf-8"); + } +} diff --git a/packages/generator-cli/src/replay/replay-init.ts b/packages/generator-cli/src/replay/replay-init.ts index 87e101c8b142..3d77aa25f93f 100644 --- a/packages/generator-cli/src/replay/replay-init.ts +++ b/packages/generator-cli/src/replay/replay-init.ts @@ -3,7 +3,11 @@ import { type BootstrapResult, bootstrap } from "@fern-api/replay"; import { existsSync, readFileSync } from "fs"; import { join } from "path"; import tmp from "tmp-promise"; -import { ensureReplayFernignoreEntriesSync, REPLAY_FERNIGNORE_ENTRIES } from "./fernignore"; +import { + ensureGitattributesEntriesSync, + ensureReplayFernignoreEntriesSync, + REPLAY_FERNIGNORE_ENTRIES +} from "./fernignore"; export interface ReplayInitParams { /** GitHub repo URI (e.g., "fern-demo/fern-replay-testbed-java-sdk") */ @@ -74,8 +78,9 @@ export async function replayInit(params: ReplayInitParams): Promise /dev/null; then + echo -e "${YELLOW}Installing CSharpier...${NC}" + if dotnet tool install -g csharpier; then + echo -e "${GREEN}✓${NC} CSharpier installed successfully" + else + echo -e "${RED}✗${NC} Failed to install CSharpier" + fi + else + echo -e "${GREEN}✓${NC} CSharpier is already installed" + fi + echo "" - echo -e "${YELLOW}Make sure \$HOME/.dotnet is in your PATH.${NC}" + echo -e "${YELLOW}Make sure \$HOME/.dotnet and \$HOME/.dotnet/tools are in your PATH.${NC}" echo "Add to your shell profile (~/.zshrc, ~/.bashrc, etc):" - echo " export PATH=\"\$HOME/.dotnet:\$PATH\"" + echo " export PATH=\"\$HOME/.dotnet:\$HOME/.dotnet/tools:\$PATH\"" echo "" echo "Alternatively, follow the official Microsoft installation guide:" echo " https://learn.microsoft.com/en-us/dotnet/core/install/" diff --git a/seed/go-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json b/seed/go-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json index 4dcf40f64bf6..23c1ea7bfdf2 100644 --- a/seed/go-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json +++ b/seed/go-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -322,7 +382,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -349,6 +414,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -380,6 +450,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -411,6 +486,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -441,7 +521,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -467,7 +552,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -493,7 +583,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -519,7 +614,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -546,6 +646,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -576,7 +681,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -602,7 +712,12 @@ "name": "getAndReturnWithUnknownField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -628,7 +743,12 @@ "name": "getAndReturnWithDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-with-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -654,7 +774,12 @@ "name": "getAndReturnMapOfDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -680,7 +805,12 @@ "name": "getAndReturnWithDatetimeLikeString - default", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -707,6 +837,11 @@ "request": { "urlPathTemplate": "/pagination", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "cursor": { "equalTo": "cursor" @@ -742,6 +877,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -773,6 +913,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -804,6 +949,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -839,6 +989,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -874,6 +1029,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -910,6 +1070,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -946,6 +1111,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -977,6 +1147,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1008,6 +1183,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1038,7 +1218,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1064,7 +1249,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1090,7 +1280,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1116,7 +1311,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1142,7 +1342,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1168,7 +1373,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1194,7 +1404,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1220,7 +1435,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1246,7 +1466,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1273,6 +1498,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1303,7 +1533,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1329,7 +1564,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1356,7 +1596,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1383,7 +1628,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1410,7 +1660,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1489,7 +1744,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1516,7 +1776,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1542,7 +1807,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/wiremock/wiremock-mappings.json b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/wiremock/wiremock-mappings.json index 4dcf40f64bf6..23c1ea7bfdf2 100644 --- a/seed/go-sdk/exhaustive/omit-empty-request-wrappers/wiremock/wiremock-mappings.json +++ b/seed/go-sdk/exhaustive/omit-empty-request-wrappers/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -322,7 +382,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -349,6 +414,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -380,6 +450,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -411,6 +486,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -441,7 +521,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -467,7 +552,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -493,7 +583,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -519,7 +614,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -546,6 +646,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -576,7 +681,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -602,7 +712,12 @@ "name": "getAndReturnWithUnknownField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -628,7 +743,12 @@ "name": "getAndReturnWithDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-with-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -654,7 +774,12 @@ "name": "getAndReturnMapOfDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -680,7 +805,12 @@ "name": "getAndReturnWithDatetimeLikeString - default", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -707,6 +837,11 @@ "request": { "urlPathTemplate": "/pagination", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "cursor": { "equalTo": "cursor" @@ -742,6 +877,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -773,6 +913,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -804,6 +949,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -839,6 +989,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -874,6 +1029,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -910,6 +1070,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -946,6 +1111,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -977,6 +1147,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1008,6 +1183,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1038,7 +1218,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1064,7 +1249,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1090,7 +1280,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1116,7 +1311,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1142,7 +1342,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1168,7 +1373,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1194,7 +1404,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1220,7 +1435,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1246,7 +1466,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1273,6 +1498,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1303,7 +1533,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1329,7 +1564,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1356,7 +1596,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1383,7 +1628,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1410,7 +1660,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1489,7 +1744,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1516,7 +1776,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1542,7 +1807,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/go-sdk/file-upload-openapi/fileuploadexample/raw_client.go b/seed/go-sdk/file-upload-openapi/fileuploadexample/raw_client.go index dc8f51c0884e..45321d22796e 100644 --- a/seed/go-sdk/file-upload-openapi/fileuploadexample/raw_client.go +++ b/seed/go-sdk/file-upload-openapi/fileuploadexample/raw_client.go @@ -51,8 +51,10 @@ func (r *RawClient) UploadFile( if err := writer.WriteField("name", request.Name); err != nil { return nil, err } - if err := writer.WriteFile("file", request.File); err != nil { - return nil, err + if request.File != nil { + if err := writer.WriteFile("file", request.File); err != nil { + return nil, err + } } if err := writer.Close(); err != nil { return nil, err diff --git a/seed/go-sdk/file-upload/no-custom-config/service/raw_client.go b/seed/go-sdk/file-upload/no-custom-config/service/raw_client.go index 0f6518a2db3c..b2acf4164314 100644 --- a/seed/go-sdk/file-upload/no-custom-config/service/raw_client.go +++ b/seed/go-sdk/file-upload/no-custom-config/service/raw_client.go @@ -65,8 +65,10 @@ func (r *RawClient) Post( return nil, err } } - if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { - return nil, err + if request.MaybeFile != nil { + if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { + return nil, err + } } for _, f := range request.MaybeFileList { if err := writer.WriteFile("maybe_file_list", f); err != nil { @@ -448,8 +450,10 @@ func (r *RawClient) WithFormEncodedContainers( return nil, err } } - if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { - return nil, err + if request.MaybeFile != nil { + if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { + return nil, err + } } for _, f := range request.MaybeFileList { if err := writer.WriteFile("maybe_file_list", f); err != nil { @@ -549,8 +553,10 @@ func (r *RawClient) OptionalArgs( options.ToHeader(), ) writer := internal.NewMultipartWriter() - if err := writer.WriteFile("image_file", request.ImageFile, internal.WithDefaultContentType("image/jpeg")); err != nil { - return nil, err + if request.ImageFile != nil { + if err := writer.WriteFile("image_file", request.ImageFile, internal.WithDefaultContentType("image/jpeg")); err != nil { + return nil, err + } } if request.Request != nil { if err := writer.WriteJSON("request", request.Request, internal.WithDefaultContentType("application/json; charset=utf-8")); err != nil { diff --git a/seed/go-sdk/file-upload/package-name/service/raw_client.go b/seed/go-sdk/file-upload/package-name/service/raw_client.go index f4f25dcaaf24..5f63e3ad5b21 100644 --- a/seed/go-sdk/file-upload/package-name/service/raw_client.go +++ b/seed/go-sdk/file-upload/package-name/service/raw_client.go @@ -65,8 +65,10 @@ func (r *RawClient) Post( return nil, err } } - if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { - return nil, err + if request.MaybeFile != nil { + if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { + return nil, err + } } for _, f := range request.MaybeFileList { if err := writer.WriteFile("maybe_file_list", f); err != nil { @@ -448,8 +450,10 @@ func (r *RawClient) WithFormEncodedContainers( return nil, err } } - if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { - return nil, err + if request.MaybeFile != nil { + if err := writer.WriteFile("maybe_file", request.MaybeFile); err != nil { + return nil, err + } } for _, f := range request.MaybeFileList { if err := writer.WriteFile("maybe_file_list", f); err != nil { @@ -549,8 +553,10 @@ func (r *RawClient) OptionalArgs( options.ToHeader(), ) writer := internal.NewMultipartWriter() - if err := writer.WriteFile("image_file", request.ImageFile, internal.WithDefaultContentType("image/jpeg")); err != nil { - return nil, err + if request.ImageFile != nil { + if err := writer.WriteFile("image_file", request.ImageFile, internal.WithDefaultContentType("image/jpeg")); err != nil { + return nil, err + } } if request.Request != nil { if err := writer.WriteJSON("request", request.Request, internal.WithDefaultContentType("application/json; charset=utf-8")); err != nil { diff --git a/seed/go-sdk/file-upload/v0/service/raw_client.go b/seed/go-sdk/file-upload/v0/service/raw_client.go index a7e1c96c43f5..d0fcf01bc37e 100644 --- a/seed/go-sdk/file-upload/v0/service/raw_client.go +++ b/seed/go-sdk/file-upload/v0/service/raw_client.go @@ -70,8 +70,10 @@ func (r *RawClient) Post( return nil, err } } - if err := writer.WriteFile("maybe_file", maybeFile); err != nil { - return nil, err + if maybeFile != nil { + if err := writer.WriteFile("maybe_file", maybeFile); err != nil { + return nil, err + } } for _, f := range maybeFileList { if err := writer.WriteFile("maybe_file_list", f); err != nil { @@ -460,8 +462,10 @@ func (r *RawClient) WithFormEncodedContainers( return nil, err } } - if err := writer.WriteFile("maybe_file", maybeFile); err != nil { - return nil, err + if maybeFile != nil { + if err := writer.WriteFile("maybe_file", maybeFile); err != nil { + return nil, err + } } for _, f := range maybeFileList { if err := writer.WriteFile("maybe_file_list", f); err != nil { @@ -562,8 +566,10 @@ func (r *RawClient) OptionalArgs( options.ToHeader(), ) writer := internal.NewMultipartWriter() - if err := writer.WriteFile("image_file", imageFile, internal.WithDefaultContentType("image/jpeg")); err != nil { - return nil, err + if imageFile != nil { + if err := writer.WriteFile("image_file", imageFile, internal.WithDefaultContentType("image/jpeg")); err != nil { + return nil, err + } } if request.Request != nil { if err := writer.WriteJSON("request", request.Request, internal.WithDefaultContentType("application/json; charset=utf-8")); err != nil { diff --git a/seed/go-sdk/go-deterministic-ordering/wiremock/wiremock-mappings.json b/seed/go-sdk/go-deterministic-ordering/wiremock/wiremock-mappings.json index f61360dced79..cdf2a1b63a6e 100644 --- a/seed/go-sdk/go-deterministic-ordering/wiremock/wiremock-mappings.json +++ b/seed/go-sdk/go-deterministic-ordering/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "create - default", "request": { "urlPathTemplate": "/duplicate-names-a", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/duplicate-names-a/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -328,6 +388,11 @@ "request": { "urlPathTemplate": "/duplicate-names-a", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "page": { "equalTo": "1" @@ -362,7 +427,12 @@ "name": "create - default", "request": { "urlPathTemplate": "/duplicate-names-b", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -389,6 +459,11 @@ "request": { "urlPathTemplate": "/duplicate-names-b/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -425,6 +500,11 @@ "request": { "urlPathTemplate": "/duplicate-names-b", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "cursor": { "equalTo": "cursor" @@ -459,7 +539,12 @@ "name": "create - default", "request": { "urlPathTemplate": "/duplicate-names-c", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -486,6 +571,11 @@ "request": { "urlPathTemplate": "/duplicate-names-c/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -522,6 +612,11 @@ "request": { "urlPathTemplate": "/duplicate-names-c", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "offset": { "equalTo": "1" @@ -556,7 +651,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -583,6 +683,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -613,7 +718,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -640,6 +750,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -671,6 +786,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -702,6 +822,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -732,7 +857,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -758,7 +888,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -784,7 +919,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -810,7 +950,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -837,6 +982,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -867,7 +1017,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -893,7 +1048,12 @@ "name": "getAndReturnWithUnknownField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -919,7 +1079,12 @@ "name": "getAndReturnWithDatetimeLikeString - default", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -946,6 +1111,11 @@ "request": { "urlPathTemplate": "/pagination", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "cursor": { "equalTo": "cursor" @@ -981,6 +1151,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1012,6 +1187,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1043,6 +1223,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -1078,6 +1263,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -1113,6 +1303,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1149,6 +1344,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1185,6 +1385,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1216,6 +1421,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1246,7 +1456,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1272,7 +1487,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1298,7 +1518,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1324,7 +1549,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1350,7 +1580,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1376,7 +1611,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1402,7 +1642,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1428,7 +1673,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1454,7 +1704,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1481,6 +1736,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1511,7 +1771,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1537,7 +1802,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1564,7 +1834,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1591,7 +1866,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1618,7 +1898,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1697,7 +1982,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1724,7 +2014,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1750,7 +2045,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/java-sdk/seed.yml b/seed/java-sdk/seed.yml index 0e967696e71c..fa28deb9bf78 100644 --- a/seed/java-sdk/seed.yml +++ b/seed/java-sdk/seed.yml @@ -361,9 +361,14 @@ fixtures: outputFolder: source-root skipScripts: true scripts: - - image: fernapi/java-seed - commands: - - source ~/.bash_profile && jenv shell 1.8 && source ~/.bash_profile && ./gradlew compileJava spotlessCheck + docker: + - image: fernapi/java-seed + commands: + - source ~/.bash_profile && jenv shell 1.8 && source ~/.bash_profile && ./gradlew compileJava spotlessCheck + local: + - commands: + - ./gradlew compileJava spotlessCheck + allowedFailures: - alias-extends - enum:forward-compatible-enums diff --git a/seed/php-sdk/any-auth/src/SeedClient.php b/seed/php-sdk/any-auth/src/SeedClient.php index 65cb903b9940..71d3ec922ad5 100644 --- a/seed/php-sdk/any-auth/src/SeedClient.php +++ b/seed/php-sdk/any-auth/src/SeedClient.php @@ -46,7 +46,7 @@ class SeedClient * @param ?string $token The token to use for authentication. * @param ?string $apiKey The apiKey to use for authentication. * @param ?string $username The username to use for authentication. - * @param ?string $password The username to use for authentication. + * @param ?string $password The password to use for authentication. * @param ?string $clientId * @param ?string $clientSecret * @param ?array{ diff --git a/seed/php-sdk/basic-auth-environment-variables/src/SeedClient.php b/seed/php-sdk/basic-auth-environment-variables/src/SeedClient.php index 6bf8aeb41ddb..32983b02e4b0 100644 --- a/seed/php-sdk/basic-auth-environment-variables/src/SeedClient.php +++ b/seed/php-sdk/basic-auth-environment-variables/src/SeedClient.php @@ -32,7 +32,7 @@ class SeedClient /** * @param ?string $username The username to use for authentication. - * @param ?string $accessToken The username to use for authentication. + * @param ?string $accessToken The accessToken to use for authentication. * @param ?array{ * baseUrl?: string, * client?: ClientInterface, diff --git a/seed/php-sdk/basic-auth-pw-omitted/.fern/metadata.json b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/.fern/metadata.json similarity index 72% rename from seed/php-sdk/basic-auth-pw-omitted/.fern/metadata.json rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/.fern/metadata.json index 143d7b896167..8478683b9c41 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/.fern/metadata.json +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/.fern/metadata.json @@ -2,6 +2,9 @@ "cliVersion": "DUMMY", "generatorName": "fernapi/fern-php-sdk", "generatorVersion": "local", + "generatorConfig": { + "enable-wire-tests": true + }, "originGitCommit": "DUMMY", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/php-sdk/basic-auth-pw-omitted/.github/workflows/ci.yml b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/.github/workflows/ci.yml similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/.github/workflows/ci.yml rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/.github/workflows/ci.yml diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/.gitignore b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/.gitignore new file mode 100644 index 000000000000..31a1aeb14f35 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/.gitignore @@ -0,0 +1,5 @@ +.idea +.php-cs-fixer.cache +.phpunit.result.cache +composer.lock +vendor/ \ No newline at end of file diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/README.md b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/README.md new file mode 100644 index 000000000000..269cd0bb42b1 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/README.md @@ -0,0 +1,145 @@ +# Seed PHP Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Seed%2FPHP) +[![php shield](https://img.shields.io/badge/php-packagist-pink)](https://packagist.org/packages/seed/seed) + +The Seed PHP library provides convenient access to the Seed APIs from PHP. + +## Table of Contents + +- [Requirements](#requirements) +- [Installation](#installation) +- [Usage](#usage) +- [Exception Handling](#exception-handling) +- [Advanced](#advanced) + - [Custom Client](#custom-client) + - [Retries](#retries) + - [Timeouts](#timeouts) +- [Contributing](#contributing) + +## Requirements + +This SDK requires PHP ^8.1. + +## Installation + +```sh +composer require seed/seed +``` + +## Usage + +Instantiate and use the client with the following: + +```php +', + password: '', +); +$client->basicAuth->postWithBasicAuth( + [ + 'key' => "value", + ], +); + +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), an exception will be thrown. + +```php +use Seed\Exceptions\SeedApiException; +use Seed\Exceptions\SeedException; + +try { + $response = $client->basicAuth->postWithBasicAuth(...); +} catch (SeedApiException $e) { + echo 'API Exception occurred: ' . $e->getMessage() . "\n"; + echo 'Status Code: ' . $e->getCode() . "\n"; + echo 'Response Body: ' . $e->getBody() . "\n"; + // Optionally, rethrow the exception or handle accordingly. +} +``` + +## Advanced + +### Custom Client + +This SDK is built to work with any HTTP client that implements the [PSR-18](https://www.php-fig.org/psr/psr-18/) `ClientInterface`. +By default, if no client is provided, the SDK will use `php-http/discovery` to find an installed HTTP client. +However, you can pass your own client that adheres to `ClientInterface`: + +```php +use Seed\SeedClient; + +// Pass any PSR-18 compatible HTTP client implementation. +// For example, using Guzzle: +$customClient = new \GuzzleHttp\Client([ + 'timeout' => 5.0, +]); + +$client = new SeedClient(options: [ + 'client' => $customClient +]); + +// Or using Symfony HttpClient: +// $customClient = (new \Symfony\Component\HttpClient\Psr18Client()) +// ->withOptions(['timeout' => 5.0]); +// +// $client = new SeedClient(options: [ +// 'client' => $customClient +// ]); +``` + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retryable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retryable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `maxRetries` request option to configure this behavior. + +```php +$response = $client->basicAuth->postWithBasicAuth( + ..., + options: [ + 'maxRetries' => 0 // Override maxRetries at the request level + ] +); +``` + +### Timeouts + +The SDK defaults to a 30 second timeout. Use the `timeout` option to configure this behavior. + +```php +$response = $client->basicAuth->postWithBasicAuth( + ..., + options: [ + 'timeout' => 3.0 // Override timeout at the request level + ] +); +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/composer.json b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/composer.json new file mode 100644 index 000000000000..ad30960a8764 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/composer.json @@ -0,0 +1,46 @@ +{ + "name": "seed/seed", + "version": "0.0.1", + "description": "Seed PHP Library", + "keywords": [ + "seed", + "api", + "sdk" + ], + "license": [], + "require": { + "php": "^8.1", + "ext-json": "*", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "php-http/discovery": "^1.0", + "php-http/multipart-stream-builder": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0", + "friendsofphp/php-cs-fixer": "3.5.0", + "phpstan/phpstan": "^1.12", + "guzzlehttp/guzzle": "^7.4" + }, + "autoload": { + "psr-4": { + "Seed\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Seed\\Tests\\": "tests/" + } + }, + "scripts": { + "build": [ + "@php -l src", + "@php -l tests" + ], + "test": "phpunit", + "analyze": "phpstan analyze src tests --memory-limit=1G" + } +} \ No newline at end of file diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/phpstan.neon b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/phpstan.neon new file mode 100644 index 000000000000..780706b8f8a2 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/phpstan.neon @@ -0,0 +1,6 @@ +parameters: + level: max + reportUnmatchedIgnoredErrors: false + paths: + - src + - tests \ No newline at end of file diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/phpunit.xml b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/phpunit.xml new file mode 100644 index 000000000000..718cb50ee175 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/phpunit.xml @@ -0,0 +1,7 @@ + + + + tests + + + diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/reference.md b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/reference.md new file mode 100644 index 000000000000..76bf05ae1117 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/reference.md @@ -0,0 +1,99 @@ +# Reference +## BasicAuth +
$client->basicAuth->getWithBasicAuth() -> ?bool +
+
+ +#### 📝 Description + +
+
+ +
+
+ +GET request with basic auth scheme +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->basicAuth->getWithBasicAuth(); +``` +
+
+
+
+ + +
+
+
+ +
$client->basicAuth->postWithBasicAuth($request) -> ?bool +
+
+ +#### 📝 Description + +
+
+ +
+
+ +POST request with basic auth scheme +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->basicAuth->postWithBasicAuth( + [ + 'key' => "value", + ], +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$request:** `mixed` + +
+
+
+
+ + +
+
+
+ diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/snippet.json b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/snippet.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/BasicAuth/BasicAuthClient.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/BasicAuth/BasicAuthClient.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/BasicAuth/BasicAuthClient.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/BasicAuth/BasicAuthClient.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/BaseApiRequest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/BaseApiRequest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/BaseApiRequest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/BaseApiRequest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/HttpClientBuilder.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/HttpClientBuilder.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/HttpClientBuilder.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/HttpClientBuilder.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/HttpMethod.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/HttpMethod.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/HttpMethod.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/HttpMethod.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/MockHttpClient.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/MockHttpClient.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/MockHttpClient.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/MockHttpClient.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/RawClient.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/RawClient.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/RawClient.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/RawClient.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/RetryDecoratingClient.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/RetryDecoratingClient.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Client/RetryDecoratingClient.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Client/RetryDecoratingClient.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonApiRequest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonApiRequest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonApiRequest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonApiRequest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonDecoder.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonDecoder.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonDecoder.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonDecoder.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonDeserializer.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonDeserializer.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonDeserializer.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonDeserializer.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonEncoder.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonEncoder.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonEncoder.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonEncoder.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonProperty.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonProperty.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonProperty.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonProperty.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonSerializableType.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializableType.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonSerializableType.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializableType.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonSerializer.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializer.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/JsonSerializer.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/JsonSerializer.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/Utils.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/Utils.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Json/Utils.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Json/Utils.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Multipart/MultipartApiRequest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Multipart/MultipartApiRequest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Multipart/MultipartApiRequest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Multipart/MultipartApiRequest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Multipart/MultipartFormData.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Multipart/MultipartFormData.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Multipart/MultipartFormData.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Multipart/MultipartFormData.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Multipart/MultipartFormDataPart.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Multipart/MultipartFormDataPart.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Multipart/MultipartFormDataPart.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Multipart/MultipartFormDataPart.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/ArrayType.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/ArrayType.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/ArrayType.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/ArrayType.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/Constant.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/Constant.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/Constant.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/Constant.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/Date.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/Date.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/Date.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/Date.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/Union.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/Union.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Core/Types/Union.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Core/Types/Union.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Errors/Types/UnauthorizedRequestErrorBody.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Errors/Types/UnauthorizedRequestErrorBody.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Errors/Types/UnauthorizedRequestErrorBody.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Errors/Types/UnauthorizedRequestErrorBody.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Exceptions/SeedApiException.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Exceptions/SeedApiException.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Exceptions/SeedApiException.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Exceptions/SeedApiException.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Exceptions/SeedException.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Exceptions/SeedException.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Exceptions/SeedException.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Exceptions/SeedException.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/SeedClient.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/SeedClient.php similarity index 92% rename from seed/php-sdk/basic-auth-pw-omitted/src/SeedClient.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/SeedClient.php index b94c5065f3ed..6707c81c9b88 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/SeedClient.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/SeedClient.php @@ -31,7 +31,6 @@ class SeedClient /** * @param string $username The username to use for authentication. - * @param string $password The username to use for authentication. * @param ?array{ * baseUrl?: string, * client?: ClientInterface, @@ -42,7 +41,6 @@ class SeedClient */ public function __construct( string $username, - string $password, ?array $options = null, ) { $defaultHeaders = [ @@ -51,7 +49,7 @@ public function __construct( 'X-Fern-SDK-Version' => '0.0.1', 'User-Agent' => 'seed/seed/0.0.1', ]; - $defaultHeaders['Authorization'] = "Basic " . base64_encode($username . ":" . $password); + $defaultHeaders['Authorization'] = "Basic " . base64_encode($username . ":"); $this->options = $options ?? []; diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/Utils/File.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Utils/File.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/src/Utils/File.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/Utils/File.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example0/snippet.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example0/snippet.php similarity index 88% rename from seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example0/snippet.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example0/snippet.php index f17c29ac0c45..70426907841c 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example0/snippet.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example0/snippet.php @@ -6,7 +6,6 @@ $client = new SeedClient( username: '', - password: '', options: [ 'baseUrl' => 'https://api.fern.com', ], diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example1/snippet.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example1/snippet.php similarity index 88% rename from seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example1/snippet.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example1/snippet.php index f17c29ac0c45..70426907841c 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example1/snippet.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example1/snippet.php @@ -6,7 +6,6 @@ $client = new SeedClient( username: '', - password: '', options: [ 'baseUrl' => 'https://api.fern.com', ], diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example2/snippet.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example2/snippet.php similarity index 88% rename from seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example2/snippet.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example2/snippet.php index f17c29ac0c45..70426907841c 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example2/snippet.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example2/snippet.php @@ -6,7 +6,6 @@ $client = new SeedClient( username: '', - password: '', options: [ 'baseUrl' => 'https://api.fern.com', ], diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example3/snippet.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example3/snippet.php similarity index 90% rename from seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example3/snippet.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example3/snippet.php index 379913d20cec..50c374428362 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example3/snippet.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example3/snippet.php @@ -6,7 +6,6 @@ $client = new SeedClient( username: '', - password: '', options: [ 'baseUrl' => 'https://api.fern.com', ], diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example4/snippet.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example4/snippet.php similarity index 90% rename from seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example4/snippet.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example4/snippet.php index 379913d20cec..50c374428362 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example4/snippet.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example4/snippet.php @@ -6,7 +6,6 @@ $client = new SeedClient( username: '', - password: '', options: [ 'baseUrl' => 'https://api.fern.com', ], diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example5/snippet.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example5/snippet.php similarity index 90% rename from seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example5/snippet.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example5/snippet.php index 379913d20cec..50c374428362 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example5/snippet.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example5/snippet.php @@ -6,7 +6,6 @@ $client = new SeedClient( username: '', - password: '', options: [ 'baseUrl' => 'https://api.fern.com', ], diff --git a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example6/snippet.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example6/snippet.php similarity index 90% rename from seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example6/snippet.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example6/snippet.php index 379913d20cec..50c374428362 100644 --- a/seed/php-sdk/basic-auth-pw-omitted/src/dynamic-snippets/example6/snippet.php +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/src/dynamic-snippets/example6/snippet.php @@ -6,7 +6,6 @@ $client = new SeedClient( username: '', - password: '', options: [ 'baseUrl' => 'https://api.fern.com', ], diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Client/RawClientTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Client/RawClientTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Client/RawClientTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Client/RawClientTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/AdditionalPropertiesTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/AdditionalPropertiesTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/AdditionalPropertiesTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/AdditionalPropertiesTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/DateArrayTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/DateArrayTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/DateArrayTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/DateArrayTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/EmptyArrayTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/EmptyArrayTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/EmptyArrayTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/EmptyArrayTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/EnumTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/EnumTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/EnumTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/EnumTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/ExhaustiveTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/ExhaustiveTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/ExhaustiveTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/ExhaustiveTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/InvalidTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/InvalidTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/InvalidTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/InvalidTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/NestedUnionArrayTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/NestedUnionArrayTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/NestedUnionArrayTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/NestedUnionArrayTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/NullPropertyTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/NullPropertyTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/NullPropertyTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/NullPropertyTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/NullableArrayTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/NullableArrayTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/NullableArrayTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/NullableArrayTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/ScalarTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/ScalarTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/ScalarTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/ScalarTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/TraitTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/TraitTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/TraitTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/TraitTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/UnionArrayTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/UnionArrayTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/UnionArrayTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/UnionArrayTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/UnionPropertyTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/UnionPropertyTest.php similarity index 100% rename from seed/php-sdk/basic-auth-pw-omitted/tests/Core/Json/UnionPropertyTest.php rename to seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Core/Json/UnionPropertyTest.php diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/BasicAuthWireTest.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/BasicAuthWireTest.php new file mode 100644 index 000000000000..0125f21dcc87 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/BasicAuthWireTest.php @@ -0,0 +1,70 @@ +client->basicAuth->getWithBasicAuth( + [ + 'headers' => [ + 'X-Test-Id' => 'basic_auth.get_with_basic_auth.0', + ], + ], + ); + $this->verifyRequestCount( + $testId, + "GET", + "/basic-auth", + null, + 1 + ); + } + + /** + */ + public function testPostWithBasicAuth(): void { + $testId = 'basic_auth.post_with_basic_auth.0'; + $this->client->basicAuth->postWithBasicAuth( + [ + 'key' => "value", + ], + [ + 'headers' => [ + 'X-Test-Id' => 'basic_auth.post_with_basic_auth.0', + ], + ], + ); + $this->verifyRequestCount( + $testId, + "POST", + "/basic-auth", + null, + 1 + ); + } + + /** + */ + protected function setUp(): void { + parent::setUp(); + $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080'; + $this->client = new SeedClient( + username: 'test-username', + options: [ + 'baseUrl' => $wiremockUrl, + ], + ); + } +} diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/WireMockTestCase.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/WireMockTestCase.php new file mode 100644 index 000000000000..0ae28fccdabe --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/WireMockTestCase.php @@ -0,0 +1,80 @@ +|null $queryParams Query parameters to match + * @param int $expected Expected number of requests + */ + protected function verifyRequestCount( + string $testId, + string $method, + string $urlPath, + ?array $queryParams, + int $expected + ): void { + $client = Psr18ClientDiscovery::find(); + $requestFactory = Psr17FactoryDiscovery::findRequestFactory(); + $streamFactory = Psr17FactoryDiscovery::findStreamFactory(); + + $body = [ + 'method' => $method, + 'urlPath' => $urlPath, + 'headers' => [ + 'X-Test-Id' => ['equalTo' => $testId], + ], + ]; + if ($queryParams !== null && $queryParams !== []) { + $body['queryParameters'] = []; + foreach ($queryParams as $k => $v) { + $body['queryParameters'][$k] = ['equalTo' => (string) $v]; + } + } + + $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080'; + $request = $requestFactory->createRequest('POST', $wiremockUrl . '/__admin/requests/find') + ->withHeader('Content-Type', 'application/json') + ->withBody($streamFactory->createStream(JsonEncoder::encode($body))); + $response = $client->sendRequest($request); + + $this->assertSame(200, $response->getStatusCode(), 'Failed to query WireMock requests'); + + $json = json_decode((string) $response->getBody(), true); + + // Ensure we have an array; otherwise, fail the test. + if (!is_array($json)) { + $this->fail('Expected WireMock to return a JSON object.'); + } + + /** @var array $json */ + $requests = []; + if (isset($json['requests']) && is_array($json['requests'])) { + $requests = $json['requests']; + } + + /** @var array $requests */ + $this->assertCount( + $expected, + $requests, + sprintf('Expected %d requests, found %d', $expected, count($requests)) + ); + } +} diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/bootstrap.php b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/bootstrap.php new file mode 100644 index 000000000000..200266641318 --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/tests/Wire/bootstrap.php @@ -0,0 +1,55 @@ +&1', + escapeshellarg($dockerComposeFile) +); +exec($cmd, $output, $exitCode); +if ($exitCode !== 0) { + throw new \RuntimeException("Failed to start WireMock: " . implode("\n", $output)); +} + +// Discover the dynamically assigned port +$portCmd = sprintf( + 'docker compose -f %s port wiremock 8080 2>&1', + escapeshellarg($dockerComposeFile) +); +exec($portCmd, $portOutput, $portExitCode); +if ($portExitCode === 0 && !empty($portOutput[0])) { + $parts = explode(':', $portOutput[0]); + $port = end($parts); + putenv("WIREMOCK_URL=http://localhost:{$port}"); + echo "WireMock container is ready on port {$port}\n"; +} else { + putenv('WIREMOCK_URL=http://localhost:8080'); + echo "WireMock container is ready (default port 8080)\n"; +} + +// Register shutdown function to stop the container after all tests complete +register_shutdown_function(function () use ($dockerComposeFile) { + echo "\nStopping WireMock container...\n"; + $cmd = sprintf( + 'docker compose -f %s down -v 2>&1', + escapeshellarg($dockerComposeFile) + ); + exec($cmd); +}); diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/wiremock/docker-compose.test.yml b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/wiremock/docker-compose.test.yml new file mode 100644 index 000000000000..58747d54a46b --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/wiremock/docker-compose.test.yml @@ -0,0 +1,14 @@ +services: + wiremock: + image: wiremock/wiremock:3.9.1 + ports: + - "0:8080" # Use dynamic port to avoid conflicts with concurrent tests + volumes: + - ./wiremock-mappings.json:/home/wiremock/mappings/wiremock-mappings.json + command: ["--global-response-templating", "--verbose"] + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/__admin/health"] + interval: 2s + timeout: 5s + retries: 15 + start_period: 5s diff --git a/seed/php-sdk/basic-auth-pw-omitted/wire-tests/wiremock/wiremock-mappings.json b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/wiremock/wiremock-mappings.json new file mode 100644 index 000000000000..8a3e7dd565af --- /dev/null +++ b/seed/php-sdk/basic-auth-pw-omitted/wire-tests/wiremock/wiremock-mappings.json @@ -0,0 +1,70 @@ +{ + "mappings": [ + { + "id": "ce59c023-78fc-4d8d-8e8c-95f5e1a6204a", + "name": "getWithBasicAuth - default", + "request": { + "urlPathTemplate": "/basic-auth", + "method": "GET", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTo=" + } + } + }, + "response": { + "status": 200, + "body": "true", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "ce59c023-78fc-4d8d-8e8c-95f5e1a6204a", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + }, + "postServeActions": [] + }, + { + "id": "9cf6385c-29ea-4710-8792-fd2e00adc7c7", + "name": "postWithBasicAuth - default", + "request": { + "urlPathTemplate": "/basic-auth", + "method": "POST", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTo=" + } + } + }, + "response": { + "status": 200, + "body": "true", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "9cf6385c-29ea-4710-8792-fd2e00adc7c7", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + } + ], + "meta": { + "total": 2 + } +} \ No newline at end of file diff --git a/seed/php-sdk/basic-auth/wire-tests/src/SeedClient.php b/seed/php-sdk/basic-auth/wire-tests/src/SeedClient.php index b94c5065f3ed..197e6664136c 100644 --- a/seed/php-sdk/basic-auth/wire-tests/src/SeedClient.php +++ b/seed/php-sdk/basic-auth/wire-tests/src/SeedClient.php @@ -31,7 +31,7 @@ class SeedClient /** * @param string $username The username to use for authentication. - * @param string $password The username to use for authentication. + * @param string $password The password to use for authentication. * @param ?array{ * baseUrl?: string, * client?: ClientInterface, diff --git a/seed/php-sdk/basic-auth/wire-tests/tests/Wire/BasicAuthWireTest.php b/seed/php-sdk/basic-auth/wire-tests/tests/Wire/BasicAuthWireTest.php index 2d804a182fff..edf399f0571e 100644 --- a/seed/php-sdk/basic-auth/wire-tests/tests/Wire/BasicAuthWireTest.php +++ b/seed/php-sdk/basic-auth/wire-tests/tests/Wire/BasicAuthWireTest.php @@ -61,7 +61,7 @@ protected function setUp(): void { parent::setUp(); $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080'; $this->client = new SeedClient( - username: 'test-user', + username: 'test-username', password: 'test-password', options: [ 'baseUrl' => $wiremockUrl, diff --git a/seed/php-sdk/basic-auth/wire-tests/wiremock/wiremock-mappings.json b/seed/php-sdk/basic-auth/wire-tests/wiremock/wiremock-mappings.json index e4105fe17be0..043be0044335 100644 --- a/seed/php-sdk/basic-auth/wire-tests/wiremock/wiremock-mappings.json +++ b/seed/php-sdk/basic-auth/wire-tests/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getWithBasicAuth - default", "request": { "urlPathTemplate": "/basic-auth", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk" + } + } }, "response": { "status": 200, @@ -32,7 +37,12 @@ "name": "postWithBasicAuth - default", "request": { "urlPathTemplate": "/basic-auth", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk" + } + } }, "response": { "status": 200, diff --git a/seed/php-sdk/endpoint-security-auth/src/SeedClient.php b/seed/php-sdk/endpoint-security-auth/src/SeedClient.php index 65cb903b9940..71d3ec922ad5 100644 --- a/seed/php-sdk/endpoint-security-auth/src/SeedClient.php +++ b/seed/php-sdk/endpoint-security-auth/src/SeedClient.php @@ -46,7 +46,7 @@ class SeedClient * @param ?string $token The token to use for authentication. * @param ?string $apiKey The apiKey to use for authentication. * @param ?string $username The username to use for authentication. - * @param ?string $password The username to use for authentication. + * @param ?string $password The password to use for authentication. * @param ?string $clientId * @param ?string $clientSecret * @param ?array{ diff --git a/seed/php-sdk/exhaustive/wire-tests/wiremock/wiremock-mappings.json b/seed/php-sdk/exhaustive/wire-tests/wiremock/wiremock-mappings.json index 09670fa261e5..a1128f12af7c 100644 --- a/seed/php-sdk/exhaustive/wire-tests/wiremock/wiremock-mappings.json +++ b/seed/php-sdk/exhaustive/wire-tests/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -322,7 +382,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -349,6 +414,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -380,6 +450,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -411,6 +486,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -441,7 +521,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -467,7 +552,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -493,7 +583,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -519,7 +614,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -546,6 +646,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -576,7 +681,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -602,7 +712,12 @@ "name": "getAndReturnWithUnknownField - BackslashExample", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -628,7 +743,12 @@ "name": "getAndReturnWithDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-with-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -654,7 +774,12 @@ "name": "getAndReturnMapOfDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -680,7 +805,12 @@ "name": "getAndReturnWithDatetimeLikeString - DatetimeLikeStringExample", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -706,7 +836,12 @@ "name": "listItems - default", "request": { "urlPathTemplate": "/pagination", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -734,6 +869,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -765,6 +905,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -795,7 +940,12 @@ "name": "getWithQuery - default", "request": { "urlPathTemplate": "/params", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -822,7 +972,12 @@ "name": "getWithAllowMultipleQuery - default", "request": { "urlPathTemplate": "/params", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -850,6 +1005,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -881,6 +1041,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -912,6 +1077,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -943,6 +1113,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -974,6 +1149,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1004,7 +1184,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1030,7 +1215,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1056,7 +1246,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1082,7 +1277,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1108,7 +1308,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1134,7 +1339,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1160,7 +1370,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1186,7 +1401,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1212,7 +1432,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1239,6 +1464,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1269,7 +1499,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1295,7 +1530,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1322,7 +1562,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1349,7 +1594,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1376,7 +1626,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1455,7 +1710,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1482,7 +1742,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1508,7 +1773,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/php-sdk/seed.yml b/seed/php-sdk/seed.yml index 42fa78a77e45..4a2eb1b196da 100644 --- a/seed/php-sdk/seed.yml +++ b/seed/php-sdk/seed.yml @@ -29,6 +29,10 @@ fixtures: - outputFolder: wire-tests customConfig: enable-wire-tests: true + basic-auth-pw-omitted: + - outputFolder: wire-tests + customConfig: + enable-wire-tests: true exhaustive: - outputFolder: no-custom-config customConfig: null diff --git a/seed/python-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json b/seed/python-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json index 4dcf40f64bf6..23c1ea7bfdf2 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json +++ b/seed/python-sdk/exhaustive/no-custom-config/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -322,7 +382,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -349,6 +414,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -380,6 +450,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -411,6 +486,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -441,7 +521,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -467,7 +552,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -493,7 +583,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -519,7 +614,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -546,6 +646,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -576,7 +681,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -602,7 +712,12 @@ "name": "getAndReturnWithUnknownField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -628,7 +743,12 @@ "name": "getAndReturnWithDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-with-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -654,7 +774,12 @@ "name": "getAndReturnMapOfDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -680,7 +805,12 @@ "name": "getAndReturnWithDatetimeLikeString - default", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -707,6 +837,11 @@ "request": { "urlPathTemplate": "/pagination", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "cursor": { "equalTo": "cursor" @@ -742,6 +877,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -773,6 +913,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -804,6 +949,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -839,6 +989,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -874,6 +1029,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -910,6 +1070,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -946,6 +1111,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -977,6 +1147,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1008,6 +1183,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1038,7 +1218,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1064,7 +1249,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1090,7 +1280,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1116,7 +1311,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1142,7 +1342,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1168,7 +1373,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1194,7 +1404,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1220,7 +1435,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1246,7 +1466,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1273,6 +1498,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1303,7 +1533,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1329,7 +1564,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1356,7 +1596,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1383,7 +1628,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1410,7 +1660,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1489,7 +1744,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1516,7 +1776,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1542,7 +1807,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/python-sdk/exhaustive/wire-tests-custom-client-name/wiremock/wiremock-mappings.json b/seed/python-sdk/exhaustive/wire-tests-custom-client-name/wiremock/wiremock-mappings.json index 4dcf40f64bf6..23c1ea7bfdf2 100644 --- a/seed/python-sdk/exhaustive/wire-tests-custom-client-name/wiremock/wiremock-mappings.json +++ b/seed/python-sdk/exhaustive/wire-tests-custom-client-name/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -322,7 +382,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -349,6 +414,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -380,6 +450,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -411,6 +486,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -441,7 +521,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -467,7 +552,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -493,7 +583,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -519,7 +614,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -546,6 +646,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -576,7 +681,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -602,7 +712,12 @@ "name": "getAndReturnWithUnknownField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -628,7 +743,12 @@ "name": "getAndReturnWithDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-with-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -654,7 +774,12 @@ "name": "getAndReturnMapOfDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -680,7 +805,12 @@ "name": "getAndReturnWithDatetimeLikeString - default", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -707,6 +837,11 @@ "request": { "urlPathTemplate": "/pagination", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "cursor": { "equalTo": "cursor" @@ -742,6 +877,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -773,6 +913,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -804,6 +949,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -839,6 +989,11 @@ "request": { "urlPathTemplate": "/params", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "queryParameters": { "query": { "equalTo": "query" @@ -874,6 +1029,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -910,6 +1070,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -946,6 +1111,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -977,6 +1147,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1008,6 +1183,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1038,7 +1218,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1064,7 +1249,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1090,7 +1280,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1116,7 +1311,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1142,7 +1342,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1168,7 +1373,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1194,7 +1404,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1220,7 +1435,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1246,7 +1466,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1273,6 +1498,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1303,7 +1533,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1329,7 +1564,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1356,7 +1596,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1383,7 +1628,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1410,7 +1660,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1489,7 +1744,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1516,7 +1776,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1542,7 +1807,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/python-sdk/seed.yml b/seed/python-sdk/seed.yml index 22a28de2805d..43a30281724f 100644 --- a/seed/python-sdk/seed.yml +++ b/seed/python-sdk/seed.yml @@ -33,10 +33,14 @@ test: - chmod +x setup-python.sh && ./setup-python.sh - poetry config virtualenvs.in-project true - poetry install - # The envvar is needed to trick the generator to look in the right place for the core_utils files + - (cd ../../ && pnpm turbo run dist:cli --filter @fern-api/python-sdk) runCommand: poetry run python -m src.fern_python.generators.sdk.cli {CONFIG_PATH} env: PYTEST_CURRENT_TEST: "some value" + PYTHON_V2_PATH: ../../generators/python-v2/sdk/dist/cli.cjs + FERN_CORE_UTILITIES_PATH: ../../generators/python/core_utilities/sdk:../../generators/python/core_utilities/shared + FERN_ASSETS_PATH: ../../generators/python + FERN_FEATURES_YML_PATH: ../../generators/python/sdk/features.yml language: python generatorType: SDK diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/README.md b/seed/ruby-sdk-v2/basic-auth-pw-omitted/README.md index 39dcc2ae12d7..6f843fc1d63a 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/README.md +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/README.md @@ -29,8 +29,7 @@ Instantiate and use the client with the following: require "seed" client = Seed::Client.new( - username: "", - password: "" + username: "" ) client.basic_auth.post_with_basic_auth diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/.fern/metadata.json b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.fern/metadata.json similarity index 74% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/.fern/metadata.json rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.fern/metadata.json index 4e868ad06d8a..cd5e87482aab 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/.fern/metadata.json +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.fern/metadata.json @@ -2,6 +2,9 @@ "cliVersion": "DUMMY", "generatorName": "fernapi/fern-ruby-sdk-v2", "generatorVersion": "local", + "generatorConfig": { + "enableWireTests": true + }, "originGitCommit": "DUMMY", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/.github/workflows/ci.yml b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.github/workflows/ci.yml similarity index 96% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/.github/workflows/ci.yml rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.github/workflows/ci.yml index 72178ea4c8f1..9a224d6dfd0d 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/.github/workflows/ci.yml +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: run: bundle install - name: Run Tests - run: bundle exec rake test + run: RUN_WIRE_TESTS=true bundle exec rake test publish: name: Publish to RubyGems.org diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.gitignore b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.gitignore new file mode 100644 index 000000000000..c111b331371a --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.gitignore @@ -0,0 +1 @@ +*.gem diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.rubocop.yml b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.rubocop.yml new file mode 100644 index 000000000000..75d8f836f2f0 --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/.rubocop.yml @@ -0,0 +1,69 @@ +plugins: + - rubocop-minitest + +AllCops: + TargetRubyVersion: 3.3 + NewCops: enable + +Style/StringLiterals: + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + EnforcedStyle: double_quotes + +Style/AccessModifierDeclarations: + Enabled: false + +Lint/ConstantDefinitionInBlock: + Enabled: false + +Metrics/AbcSize: + Enabled: false + +Metrics/BlockLength: + Enabled: false + +Metrics/ClassLength: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/ModuleLength: + Enabled: false + +Layout/LineLength: + Enabled: false + +Naming/VariableNumber: + EnforcedStyle: normalcase + +Style/Documentation: + Enabled: false + +Style/Lambda: + EnforcedStyle: literal + +Minitest/MultipleAssertions: + Enabled: false + +Minitest/UselessAssertion: + Enabled: false + +# Dynamic snippets are code samples for documentation, not standalone Ruby files. +Style/FrozenStringLiteralComment: + Exclude: + - "dynamic-snippets/**/*" + +Layout/FirstHashElementIndentation: + Exclude: + - "dynamic-snippets/**/*" diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Gemfile b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Gemfile new file mode 100644 index 000000000000..16877f89f300 --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Gemfile @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gemspec + +group :test, :development do + gem "minitest", "~> 5.16" + gem "minitest-rg" + gem "pry" + gem "rake", "~> 13.0" + gem "rubocop", "~> 1.21" + gem "rubocop-minitest" + gem "webmock" +end + +# Load custom Gemfile configuration if it exists +custom_gemfile = File.join(__dir__, "Gemfile.custom") +eval_gemfile(custom_gemfile) if File.exist?(custom_gemfile) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Gemfile.custom b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Gemfile.custom new file mode 100644 index 000000000000..11bdfaf13f2d --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Gemfile.custom @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# Custom Gemfile configuration file +# This file is automatically loaded by the main Gemfile. You can add custom gems, +# groups, or other Gemfile configurations here. If you do make changes to this file, +# you will need to add it to the .fernignore file to prevent your changes from being +# overwritten by the generator. + +# Example usage: +# group :test, :development do +# gem 'custom-gem', '~> 2.0' +# end + +# Add your custom gem dependencies here \ No newline at end of file diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/README.md b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/README.md new file mode 100644 index 000000000000..39dcc2ae12d7 --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/README.md @@ -0,0 +1,157 @@ +# Seed Ruby Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Seed%2FRuby) + +The Seed Ruby library provides convenient access to the Seed APIs from Ruby. + +## Table of Contents + +- [Reference](#reference) +- [Usage](#usage) +- [Environments](#environments) +- [Errors](#errors) +- [Advanced](#advanced) + - [Retries](#retries) + - [Timeouts](#timeouts) + - [Additional Headers](#additional-headers) + - [Additional Query Parameters](#additional-query-parameters) +- [Contributing](#contributing) + +## Reference + +A full reference for this library is available [here](./reference.md). + +## Usage + +Instantiate and use the client with the following: + +```ruby +require "seed" + +client = Seed::Client.new( + username: "", + password: "" +) + +client.basic_auth.post_with_basic_auth +``` + +## Environments + +This SDK allows you to configure different custom URLs for API requests. You can specify your own custom URL. + +### Custom URL +```ruby +require "seed" + +client = Seed::Client.new( + base_url: "https://example.com" +) +``` + +## Errors + +Failed API calls will raise errors that can be rescued from granularly. + +```ruby +require "seed" + +client = Seed::Client.new( + base_url: "https://example.com" +) + +begin + result = client.basic_auth.post_with_basic_auth +rescue Seed::Errors::TimeoutError + puts "API didn't respond before our timeout elapsed" +rescue Seed::Errors::ServiceUnavailableError + puts "API returned status 503, is probably overloaded, try again later" +rescue Seed::Errors::ServerError + puts "API returned some other 5xx status, this is probably a bug" +rescue Seed::Errors::ResponseError => e + puts "API returned an unexpected status other than 5xx: #{e.code} #{e.message}" +rescue Seed::Errors::ApiError => e + puts "Some other error occurred when calling the API: #{e.message}" +end +``` + +## Advanced + +### Retries + +The SDK is instrumented with automatic retries. A request will be retried as long as the request is deemed +retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2). + +A request is deemed retryable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `max_retries` option to configure this behavior. + +```ruby +require "seed" + +client = Seed::Client.new( + base_url: "https://example.com", + max_retries: 3 # Configure max retries (default is 2) +) +``` + +### Timeouts + +The SDK defaults to a 60 second timeout. Use the `timeout` option to configure this behavior. + +```ruby +require "seed" + +response = client.basic_auth.post_with_basic_auth( + ..., + timeout: 30 # 30 second timeout +) +``` + +### Additional Headers + +If you would like to send additional headers as part of the request, use the `additional_headers` request option. + +```ruby +require "seed" + +response = client.basic_auth.post_with_basic_auth( + ..., + request_options: { + additional_headers: { + "X-Custom-Header" => "custom-value" + } + } +) +``` + +### Additional Query Parameters + +If you would like to send additional query parameters as part of the request, use the `additional_query_parameters` request option. + +```ruby +require "seed" + +response = client.basic_auth.post_with_basic_auth( + ..., + request_options: { + additional_query_parameters: { + "custom_param" => "custom-value" + } + } +) +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Rakefile b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Rakefile new file mode 100644 index 000000000000..9bdd4a6ce80b --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/Rakefile @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "minitest/test_task" + +Minitest::TestTask.create + +require "rubocop/rake_task" + +RuboCop::RakeTask.new + +task default: %i[test] + +task lint: %i[rubocop] + +# Run only the custom test file +Minitest::TestTask.create(:customtest) do |t| + t.libs << "test" + t.test_globs = ["test/custom.test.rb"] +end diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/custom.gemspec.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/custom.gemspec.rb new file mode 100644 index 000000000000..86d8efd3cd3c --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/custom.gemspec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# Custom gemspec configuration file +# This file is automatically loaded by the main gemspec file. The 'spec' variable is available +# in this context from the main gemspec file. You can modify this file to add custom metadata, +# dependencies, or other gemspec configurations. If you do make changes to this file, you will +# need to add it to the .fernignore file to prevent your changes from being overwritten. + +def add_custom_gemspec_data(spec) + # Example custom configurations (uncomment and modify as needed) + + # spec.authors = ["Your name"] + # spec.email = ["your.email@example.com"] + # spec.homepage = "https://github.com/your-org/seed-ruby" + # spec.license = "Your license" +end diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example0/snippet.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example0/snippet.rb similarity index 84% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example0/snippet.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example0/snippet.rb index 2d4035b00456..8b9ab0c730ed 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example0/snippet.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example0/snippet.rb @@ -2,7 +2,6 @@ client = Seed::Client.new( username: "", - password: "", base_url: "https://api.fern.com" ) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example1/snippet.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example1/snippet.rb similarity index 84% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example1/snippet.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example1/snippet.rb index 2d4035b00456..8b9ab0c730ed 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example1/snippet.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example1/snippet.rb @@ -2,7 +2,6 @@ client = Seed::Client.new( username: "", - password: "", base_url: "https://api.fern.com" ) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example2/snippet.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example2/snippet.rb similarity index 84% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example2/snippet.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example2/snippet.rb index 2d4035b00456..8b9ab0c730ed 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example2/snippet.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example2/snippet.rb @@ -2,7 +2,6 @@ client = Seed::Client.new( username: "", - password: "", base_url: "https://api.fern.com" ) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example4/snippet.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example3/snippet.rb similarity index 84% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example4/snippet.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example3/snippet.rb index 37fb27d10d1a..e99bb741c146 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example4/snippet.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example3/snippet.rb @@ -2,7 +2,6 @@ client = Seed::Client.new( username: "", - password: "", base_url: "https://api.fern.com" ) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example5/snippet.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example4/snippet.rb similarity index 84% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example5/snippet.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example4/snippet.rb index 37fb27d10d1a..e99bb741c146 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example5/snippet.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example4/snippet.rb @@ -2,7 +2,6 @@ client = Seed::Client.new( username: "", - password: "", base_url: "https://api.fern.com" ) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example6/snippet.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example5/snippet.rb similarity index 84% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example6/snippet.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example5/snippet.rb index 37fb27d10d1a..e99bb741c146 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example6/snippet.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example5/snippet.rb @@ -2,7 +2,6 @@ client = Seed::Client.new( username: "", - password: "", base_url: "https://api.fern.com" ) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example3/snippet.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example6/snippet.rb similarity index 84% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example3/snippet.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example6/snippet.rb index 37fb27d10d1a..e99bb741c146 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/dynamic-snippets/example3/snippet.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/dynamic-snippets/example6/snippet.rb @@ -2,7 +2,6 @@ client = Seed::Client.new( username: "", - password: "", base_url: "https://api.fern.com" ) diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/basic_auth/client.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/basic_auth/client.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/basic_auth/client.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/basic_auth/client.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/client.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/client.rb similarity index 83% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/client.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/client.rb index 0229aeba3a22..aba6234f5885 100644 --- a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/client.rb +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/client.rb @@ -4,15 +4,14 @@ module Seed class Client # @param base_url [String, nil] # @param username [String] - # @param password [String] # # @return [void] - def initialize(username:, password:, base_url: nil) + def initialize(username:, base_url: nil) headers = { "User-Agent" => "fern_basic-auth-pw-omitted/0.0.1", "X-Fern-Language" => "Ruby" } - headers["Authorization"] = "Basic #{Base64.strict_encode64("#{username}:#{password}")}" + headers["Authorization"] = "Basic #{Base64.strict_encode64("#{username}:")}" @raw_client = Seed::Internal::Http::RawClient.new( base_url: base_url, headers: headers diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/api_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/api_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/api_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/api_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/client_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/client_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/client_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/client_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/redirect_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/redirect_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/redirect_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/redirect_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/response_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/response_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/response_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/response_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/server_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/server_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/server_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/server_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/timeout_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/timeout_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/timeout_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/timeout_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/types/unauthorized_request_error_body.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/types/unauthorized_request_error_body.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/errors/types/unauthorized_request_error_body.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/errors/types/unauthorized_request_error_body.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/errors/constraint_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/errors/constraint_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/errors/constraint_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/errors/constraint_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/errors/type_error.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/errors/type_error.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/errors/type_error.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/errors/type_error.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/http/base_request.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/http/base_request.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/http/base_request.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/http/base_request.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/http/raw_client.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/http/raw_client.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/http/raw_client.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/http/raw_client.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/cursor_item_iterator.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/cursor_item_iterator.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/cursor_item_iterator.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/cursor_item_iterator.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/cursor_page_iterator.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/cursor_page_iterator.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/cursor_page_iterator.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/cursor_page_iterator.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/item_iterator.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/item_iterator.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/item_iterator.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/item_iterator.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/offset_item_iterator.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/offset_item_iterator.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/offset_item_iterator.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/offset_item_iterator.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/offset_page_iterator.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/offset_page_iterator.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/iterators/offset_page_iterator.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/iterators/offset_page_iterator.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/json/request.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/json/request.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/json/request.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/json/request.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/json/serializable.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/json/serializable.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/json/serializable.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/json/serializable.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_encoder.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_encoder.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_encoder.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_encoder.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_form_data.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_form_data.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_form_data.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_form_data.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_form_data_part.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_form_data_part.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_form_data_part.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_form_data_part.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_request.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_request.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/multipart/multipart_request.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/multipart/multipart_request.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/array.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/array.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/array.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/array.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/boolean.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/boolean.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/boolean.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/boolean.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/enum.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/enum.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/enum.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/enum.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/hash.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/hash.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/hash.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/hash.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/model.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/model.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/model.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/model.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/model/field.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/model/field.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/model/field.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/model/field.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/type.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/type.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/type.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/type.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/union.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/union.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/union.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/union.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/unknown.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/unknown.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/unknown.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/unknown.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/utils.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/utils.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/internal/types/utils.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/internal/types/utils.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/version.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/version.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/lib/seed/version.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/lib/seed/version.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/reference.md b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/reference.md new file mode 100644 index 000000000000..7bfdfbd7ac04 --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/reference.md @@ -0,0 +1,118 @@ +# Reference +## BasicAuth +
client.basic_auth.get_with_basic_auth() -> Internal::Types::Boolean +
+
+ +#### 📝 Description + +
+
+ +
+
+ +GET request with basic auth scheme +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.basic_auth.get_with_basic_auth +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `Seed::BasicAuth::RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.basic_auth.post_with_basic_auth(request) -> Internal::Types::Boolean +
+
+ +#### 📝 Description + +
+
+ +
+
+ +POST request with basic auth scheme +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```ruby +client.basic_auth.post_with_basic_auth +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Object` + +
+
+ +
+
+ +**request_options:** `Seed::BasicAuth::RequestOptions` + +
+
+
+
+ + +
+
+
+ diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/seed.gemspec b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/seed.gemspec new file mode 100644 index 000000000000..6fdd2f7d837d --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/seed.gemspec @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require_relative "lib/seed/version" +require_relative "custom.gemspec" + +# NOTE: A handful of these fields are required as part of the Ruby specification. +# You can change them here or overwrite them in the custom gemspec file. +Gem::Specification.new do |spec| + spec.name = "fern_basic-auth-pw-omitted" + spec.authors = ["Seed"] + spec.version = Seed::VERSION + spec.summary = "Ruby client library for the Seed API" + spec.description = "The Seed Ruby library provides convenient access to the Seed API from Ruby." + spec.required_ruby_version = ">= 3.3.0" + spec.metadata["rubygems_mfa_required"] = "true" + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + gemspec = File.basename(__FILE__) + spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls| + ls.readlines("\x0", chomp: true).reject do |f| + (f == gemspec) || + f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile]) + end + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + spec.add_dependency "base64" + # For more information and examples about making a new gem, check out our + # guide at: https://bundler.io/guides/creating_gem.html + + # Load custom gemspec configuration if it exists + custom_gemspec_file = File.join(__dir__, "custom.gemspec.rb") + add_custom_gemspec_data(spec) if File.exist?(custom_gemspec_file) +end diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/snippet.json b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/snippet.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/custom.test.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/custom.test.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/custom.test.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/custom.test.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/test_helper.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/test_helper.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/test_helper.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/test_helper.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/iterators/test_cursor_item_iterator.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/iterators/test_cursor_item_iterator.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/iterators/test_cursor_item_iterator.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/iterators/test_cursor_item_iterator.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/iterators/test_offset_item_iterator.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/iterators/test_offset_item_iterator.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/iterators/test_offset_item_iterator.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/iterators/test_offset_item_iterator.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_array.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_array.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_array.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_array.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_boolean.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_boolean.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_boolean.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_boolean.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_enum.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_enum.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_enum.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_enum.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_hash.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_hash.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_hash.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_hash.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_model.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_model.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_model.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_model.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_union.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_union.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_union.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_union.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_utils.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_utils.rb similarity index 100% rename from seed/ruby-sdk-v2/basic-auth-pw-omitted/test/unit/internal/types/test_utils.rb rename to seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/unit/internal/types/test_utils.rb diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/basic_auth_test.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/basic_auth_test.rb new file mode 100644 index 000000000000..46391d6843ae --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/basic_auth_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "wiremock_test_case" + +class BasicAuthWireTest < WireMockTestCase + def setup + super + + @client = Seed::Client.new( + username: "test-username", + base_url: WIREMOCK_BASE_URL + ) + end + + def test_basic_auth_get_with_basic_auth_with_wiremock + test_id = "basic_auth.get_with_basic_auth.0" + + @client.basic_auth.get_with_basic_auth(request_options: { + additional_headers: { + "X-Test-Id" => "basic_auth.get_with_basic_auth.0" + } + }) + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/basic-auth", + query_params: nil, + expected: 1 + ) + + verify_authorization_header( + test_id: test_id, + method: "GET", + url_path: "/basic-auth", + expected_value: "Basic dGVzdC11c2VybmFtZTo=" + ) + end + + def test_basic_auth_post_with_basic_auth_with_wiremock + test_id = "basic_auth.post_with_basic_auth.0" + + @client.basic_auth.post_with_basic_auth(request_options: { + additional_headers: { + "X-Test-Id" => "basic_auth.post_with_basic_auth.0" + } + }) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/basic-auth", + query_params: nil, + expected: 1 + ) + + verify_authorization_header( + test_id: test_id, + method: "POST", + url_path: "/basic-auth", + expected_value: "Basic dGVzdC11c2VybmFtZTo=" + ) + end +end diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/wire_helper.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/wire_helper.rb new file mode 100644 index 000000000000..ce0ea46b0406 --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/wire_helper.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require "test_helper" + +# WireMock container lifecycle management for wire tests. +# It automatically starts the WireMock container before tests and stops it after. +# If WIREMOCK_URL is already set (external orchestration), container management is skipped. + +WIREMOCK_COMPOSE_FILE = File.expand_path("../../wiremock/docker-compose.test.yml", __dir__) + +# Start WireMock container when this file is required +if ENV["RUN_WIRE_TESTS"] == "true" && File.exist?(WIREMOCK_COMPOSE_FILE) && !ENV["WIREMOCK_URL"] + puts "Starting WireMock container..." + warn "Failed to start WireMock container" unless system("docker compose -f #{WIREMOCK_COMPOSE_FILE} up -d --wait") + + # Discover the dynamically assigned port and set WIREMOCK_URL + port_output = `docker compose -f #{WIREMOCK_COMPOSE_FILE} port wiremock 8080 2>&1`.strip + if port_output =~ /:(\d+)$/ + ENV["WIREMOCK_URL"] = "http://localhost:#{Regexp.last_match(1)}" + puts "WireMock container is ready at #{ENV.fetch("WIREMOCK_URL", nil)}" + else + ENV["WIREMOCK_URL"] = "http://localhost:8080" + puts "WireMock container is ready (default port 8080)" + end + + # Stop WireMock container after all tests complete + Minitest.after_run do + puts "Stopping WireMock container..." + system("docker compose -f #{WIREMOCK_COMPOSE_FILE} down") + end +end diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/wiremock_test_case.rb b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/wiremock_test_case.rb new file mode 100644 index 000000000000..dec2e7e529b4 --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/test/wire/wiremock_test_case.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +require "test_helper" +require_relative "wire_helper" +require "net/http" +require "json" +require "uri" +require "seed" + +# Base test case for WireMock-based wire tests. +# +# This class provides helper methods for verifying requests made to WireMock +# and manages the test lifecycle for integration tests. +class WireMockTestCase < Minitest::Test + WIREMOCK_BASE_URL = ENV["WIREMOCK_URL"] || "http://localhost:8080" + WIREMOCK_ADMIN_URL = "#{WIREMOCK_BASE_URL}/__admin".freeze + + def setup + super + return if ENV["RUN_WIRE_TESTS"] == "true" + + skip "Wire tests are disabled by default. Set RUN_WIRE_TESTS=true to enable them." + end + + # Verifies the number of requests made to WireMock filtered by test ID for concurrency safety. + # + # @param test_id [String] The test ID used to filter requests + # @param method [String] The HTTP method (GET, POST, etc.) + # @param url_path [String] The URL path to match + # @param query_params [Hash, nil] Query parameters to match + # @param expected [Integer] Expected number of requests + def verify_request_count(test_id:, method:, url_path:, expected:, query_params: nil) + admin_url = ENV["WIREMOCK_URL"] ? "#{ENV["WIREMOCK_URL"]}/__admin" : WIREMOCK_ADMIN_URL + uri = URI("#{admin_url}/requests/find") + http = Net::HTTP.new(uri.host, uri.port) + post_request = Net::HTTP::Post.new(uri.path, { "Content-Type" => "application/json" }) + + request_body = { "method" => method, "urlPath" => url_path } + request_body["headers"] = { "X-Test-Id" => { "equalTo" => test_id } } + request_body["queryParameters"] = query_params.transform_values { |v| { "equalTo" => v } } if query_params + + post_request.body = request_body.to_json + response = http.request(post_request) + result = JSON.parse(response.body) + requests = result["requests"] || [] + + assert_equal expected, requests.length, "Expected #{expected} requests, found #{requests.length}" + end + + # Verifies that the Authorization header on captured requests matches the expected value. + # + # @param test_id [String] The test ID used to filter requests + # @param method [String] The HTTP method (GET, POST, etc.) + # @param url_path [String] The URL path to match + # @param expected_value [String] The expected Authorization header value + def verify_authorization_header(test_id:, method:, url_path:, expected_value:) + admin_url = ENV["WIREMOCK_URL"] ? "#{ENV["WIREMOCK_URL"]}/__admin" : WIREMOCK_ADMIN_URL + uri = URI("#{admin_url}/requests/find") + http = Net::HTTP.new(uri.host, uri.port) + post_request = Net::HTTP::Post.new(uri.path, { "Content-Type" => "application/json" }) + + request_body = { "method" => method, "urlPath" => url_path } + request_body["headers"] = { "X-Test-Id" => { "equalTo" => test_id } } + + post_request.body = request_body.to_json + response = http.request(post_request) + result = JSON.parse(response.body) + requests = result["requests"] || [] + + refute_empty requests, "No requests found for test_id #{test_id}" + actual_header = requests.first.dig("request", "headers", "Authorization") + + assert_equal expected_value, actual_header, "Expected Authorization header '#{expected_value}', got '#{actual_header}'" + end +end diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/wiremock/docker-compose.test.yml b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/wiremock/docker-compose.test.yml new file mode 100644 index 000000000000..58747d54a46b --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/wiremock/docker-compose.test.yml @@ -0,0 +1,14 @@ +services: + wiremock: + image: wiremock/wiremock:3.9.1 + ports: + - "0:8080" # Use dynamic port to avoid conflicts with concurrent tests + volumes: + - ./wiremock-mappings.json:/home/wiremock/mappings/wiremock-mappings.json + command: ["--global-response-templating", "--verbose"] + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/__admin/health"] + interval: 2s + timeout: 5s + retries: 15 + start_period: 5s diff --git a/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/wiremock/wiremock-mappings.json b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/wiremock/wiremock-mappings.json new file mode 100644 index 000000000000..8a3e7dd565af --- /dev/null +++ b/seed/ruby-sdk-v2/basic-auth-pw-omitted/wire-tests/wiremock/wiremock-mappings.json @@ -0,0 +1,70 @@ +{ + "mappings": [ + { + "id": "ce59c023-78fc-4d8d-8e8c-95f5e1a6204a", + "name": "getWithBasicAuth - default", + "request": { + "urlPathTemplate": "/basic-auth", + "method": "GET", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTo=" + } + } + }, + "response": { + "status": 200, + "body": "true", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "ce59c023-78fc-4d8d-8e8c-95f5e1a6204a", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + }, + "postServeActions": [] + }, + { + "id": "9cf6385c-29ea-4710-8792-fd2e00adc7c7", + "name": "postWithBasicAuth - default", + "request": { + "urlPathTemplate": "/basic-auth", + "method": "POST", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTo=" + } + } + }, + "response": { + "status": 200, + "body": "true", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "9cf6385c-29ea-4710-8792-fd2e00adc7c7", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + } + ], + "meta": { + "total": 2 + } +} \ No newline at end of file diff --git a/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/basic_auth_test.rb b/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/basic_auth_test.rb index c4934ed5a2d9..00cc66467aa7 100644 --- a/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/basic_auth_test.rb +++ b/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/basic_auth_test.rb @@ -29,6 +29,13 @@ def test_basic_auth_get_with_basic_auth_with_wiremock query_params: nil, expected: 1 ) + + verify_authorization_header( + test_id: test_id, + method: "GET", + url_path: "/basic-auth", + expected_value: "Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk" + ) end def test_basic_auth_post_with_basic_auth_with_wiremock @@ -47,5 +54,12 @@ def test_basic_auth_post_with_basic_auth_with_wiremock query_params: nil, expected: 1 ) + + verify_authorization_header( + test_id: test_id, + method: "POST", + url_path: "/basic-auth", + expected_value: "Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk" + ) end end diff --git a/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/wiremock_test_case.rb b/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/wiremock_test_case.rb index 26de2f33e8e4..dec2e7e529b4 100644 --- a/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/wiremock_test_case.rb +++ b/seed/ruby-sdk-v2/basic-auth/wire-tests/test/wire/wiremock_test_case.rb @@ -46,4 +46,30 @@ def verify_request_count(test_id:, method:, url_path:, expected:, query_params: assert_equal expected, requests.length, "Expected #{expected} requests, found #{requests.length}" end + + # Verifies that the Authorization header on captured requests matches the expected value. + # + # @param test_id [String] The test ID used to filter requests + # @param method [String] The HTTP method (GET, POST, etc.) + # @param url_path [String] The URL path to match + # @param expected_value [String] The expected Authorization header value + def verify_authorization_header(test_id:, method:, url_path:, expected_value:) + admin_url = ENV["WIREMOCK_URL"] ? "#{ENV["WIREMOCK_URL"]}/__admin" : WIREMOCK_ADMIN_URL + uri = URI("#{admin_url}/requests/find") + http = Net::HTTP.new(uri.host, uri.port) + post_request = Net::HTTP::Post.new(uri.path, { "Content-Type" => "application/json" }) + + request_body = { "method" => method, "urlPath" => url_path } + request_body["headers"] = { "X-Test-Id" => { "equalTo" => test_id } } + + post_request.body = request_body.to_json + response = http.request(post_request) + result = JSON.parse(response.body) + requests = result["requests"] || [] + + refute_empty requests, "No requests found for test_id #{test_id}" + actual_header = requests.first.dig("request", "headers", "Authorization") + + assert_equal expected_value, actual_header, "Expected Authorization header '#{expected_value}', got '#{actual_header}'" + end end diff --git a/seed/ruby-sdk-v2/basic-auth/wire-tests/wiremock/wiremock-mappings.json b/seed/ruby-sdk-v2/basic-auth/wire-tests/wiremock/wiremock-mappings.json index e4105fe17be0..043be0044335 100644 --- a/seed/ruby-sdk-v2/basic-auth/wire-tests/wiremock/wiremock-mappings.json +++ b/seed/ruby-sdk-v2/basic-auth/wire-tests/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getWithBasicAuth - default", "request": { "urlPathTemplate": "/basic-auth", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk" + } + } }, "response": { "status": 200, @@ -32,7 +37,12 @@ "name": "postWithBasicAuth - default", "request": { "urlPathTemplate": "/basic-auth", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "equalTo": "Basic dGVzdC11c2VybmFtZTp0ZXN0LXBhc3N3b3Jk" + } + } }, "response": { "status": 200, diff --git a/seed/ruby-sdk-v2/examples/wire-tests/test/wire/wiremock_test_case.rb b/seed/ruby-sdk-v2/examples/wire-tests/test/wire/wiremock_test_case.rb index 26de2f33e8e4..dec2e7e529b4 100644 --- a/seed/ruby-sdk-v2/examples/wire-tests/test/wire/wiremock_test_case.rb +++ b/seed/ruby-sdk-v2/examples/wire-tests/test/wire/wiremock_test_case.rb @@ -46,4 +46,30 @@ def verify_request_count(test_id:, method:, url_path:, expected:, query_params: assert_equal expected, requests.length, "Expected #{expected} requests, found #{requests.length}" end + + # Verifies that the Authorization header on captured requests matches the expected value. + # + # @param test_id [String] The test ID used to filter requests + # @param method [String] The HTTP method (GET, POST, etc.) + # @param url_path [String] The URL path to match + # @param expected_value [String] The expected Authorization header value + def verify_authorization_header(test_id:, method:, url_path:, expected_value:) + admin_url = ENV["WIREMOCK_URL"] ? "#{ENV["WIREMOCK_URL"]}/__admin" : WIREMOCK_ADMIN_URL + uri = URI("#{admin_url}/requests/find") + http = Net::HTTP.new(uri.host, uri.port) + post_request = Net::HTTP::Post.new(uri.path, { "Content-Type" => "application/json" }) + + request_body = { "method" => method, "urlPath" => url_path } + request_body["headers"] = { "X-Test-Id" => { "equalTo" => test_id } } + + post_request.body = request_body.to_json + response = http.request(post_request) + result = JSON.parse(response.body) + requests = result["requests"] || [] + + refute_empty requests, "No requests found for test_id #{test_id}" + actual_header = requests.first.dig("request", "headers", "Authorization") + + assert_equal expected_value, actual_header, "Expected Authorization header '#{expected_value}', got '#{actual_header}'" + end end diff --git a/seed/ruby-sdk-v2/examples/wire-tests/wiremock/wiremock-mappings.json b/seed/ruby-sdk-v2/examples/wire-tests/wiremock/wiremock-mappings.json index 39a85251985f..69296f5b1908 100644 --- a/seed/ruby-sdk-v2/examples/wire-tests/wiremock/wiremock-mappings.json +++ b/seed/ruby-sdk-v2/examples/wire-tests/wiremock/wiremock-mappings.json @@ -57,7 +57,12 @@ "name": "getException - default", "request": { "urlPathTemplate": "/file/notification/{notificationId}", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -85,6 +90,11 @@ "request": { "urlPathTemplate": "/file/{filename}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "filename": { "equalTo": "file.txt" @@ -116,6 +126,11 @@ "request": { "urlPathTemplate": "/check/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id-2sdx82h" @@ -146,7 +161,12 @@ "name": "ping - Example0", "request": { "urlPathTemplate": "/ping", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/ruby-sdk-v2/exhaustive/wire-tests/test/wire/wiremock_test_case.rb b/seed/ruby-sdk-v2/exhaustive/wire-tests/test/wire/wiremock_test_case.rb index 26de2f33e8e4..dec2e7e529b4 100644 --- a/seed/ruby-sdk-v2/exhaustive/wire-tests/test/wire/wiremock_test_case.rb +++ b/seed/ruby-sdk-v2/exhaustive/wire-tests/test/wire/wiremock_test_case.rb @@ -46,4 +46,30 @@ def verify_request_count(test_id:, method:, url_path:, expected:, query_params: assert_equal expected, requests.length, "Expected #{expected} requests, found #{requests.length}" end + + # Verifies that the Authorization header on captured requests matches the expected value. + # + # @param test_id [String] The test ID used to filter requests + # @param method [String] The HTTP method (GET, POST, etc.) + # @param url_path [String] The URL path to match + # @param expected_value [String] The expected Authorization header value + def verify_authorization_header(test_id:, method:, url_path:, expected_value:) + admin_url = ENV["WIREMOCK_URL"] ? "#{ENV["WIREMOCK_URL"]}/__admin" : WIREMOCK_ADMIN_URL + uri = URI("#{admin_url}/requests/find") + http = Net::HTTP.new(uri.host, uri.port) + post_request = Net::HTTP::Post.new(uri.path, { "Content-Type" => "application/json" }) + + request_body = { "method" => method, "urlPath" => url_path } + request_body["headers"] = { "X-Test-Id" => { "equalTo" => test_id } } + + post_request.body = request_body.to_json + response = http.request(post_request) + result = JSON.parse(response.body) + requests = result["requests"] || [] + + refute_empty requests, "No requests found for test_id #{test_id}" + actual_header = requests.first.dig("request", "headers", "Authorization") + + assert_equal expected_value, actual_header, "Expected Authorization header '#{expected_value}', got '#{actual_header}'" + end end diff --git a/seed/ruby-sdk-v2/exhaustive/wire-tests/wiremock/wiremock-mappings.json b/seed/ruby-sdk-v2/exhaustive/wire-tests/wiremock/wiremock-mappings.json index 09670fa261e5..a1128f12af7c 100644 --- a/seed/ruby-sdk-v2/exhaustive/wire-tests/wiremock/wiremock-mappings.json +++ b/seed/ruby-sdk-v2/exhaustive/wire-tests/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -322,7 +382,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -349,6 +414,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -380,6 +450,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -411,6 +486,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -441,7 +521,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -467,7 +552,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -493,7 +583,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -519,7 +614,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -546,6 +646,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -576,7 +681,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -602,7 +712,12 @@ "name": "getAndReturnWithUnknownField - BackslashExample", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -628,7 +743,12 @@ "name": "getAndReturnWithDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-with-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -654,7 +774,12 @@ "name": "getAndReturnMapOfDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -680,7 +805,12 @@ "name": "getAndReturnWithDatetimeLikeString - DatetimeLikeStringExample", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -706,7 +836,12 @@ "name": "listItems - default", "request": { "urlPathTemplate": "/pagination", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -734,6 +869,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -765,6 +905,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -795,7 +940,12 @@ "name": "getWithQuery - default", "request": { "urlPathTemplate": "/params", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -822,7 +972,12 @@ "name": "getWithAllowMultipleQuery - default", "request": { "urlPathTemplate": "/params", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -850,6 +1005,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -881,6 +1041,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -912,6 +1077,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -943,6 +1113,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -974,6 +1149,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1004,7 +1184,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1030,7 +1215,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1056,7 +1246,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1082,7 +1277,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1108,7 +1308,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1134,7 +1339,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1160,7 +1370,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1186,7 +1401,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1212,7 +1432,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1239,6 +1464,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1269,7 +1499,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1295,7 +1530,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1322,7 +1562,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1349,7 +1594,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1376,7 +1626,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1455,7 +1710,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1482,7 +1742,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1508,7 +1773,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/ruby-sdk-v2/seed.yml b/seed/ruby-sdk-v2/seed.yml index a503260d8792..c45a14e033e2 100644 --- a/seed/ruby-sdk-v2/seed.yml +++ b/seed/ruby-sdk-v2/seed.yml @@ -49,6 +49,10 @@ fixtures: - outputFolder: wire-tests customConfig: enableWireTests: true + basic-auth-pw-omitted: + - outputFolder: wire-tests + customConfig: + enableWireTests: true exhaustive: - outputFolder: wire-tests customConfig: diff --git a/seed/rust-sdk/examples/readme-config/wiremock/wiremock-mappings.json b/seed/rust-sdk/examples/readme-config/wiremock/wiremock-mappings.json index 2b7cfb35b885..876ec7e8480f 100644 --- a/seed/rust-sdk/examples/readme-config/wiremock/wiremock-mappings.json +++ b/seed/rust-sdk/examples/readme-config/wiremock/wiremock-mappings.json @@ -57,7 +57,12 @@ "name": "getException - default", "request": { "urlPathTemplate": "/file/notification/{notificationId}", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -85,6 +90,11 @@ "request": { "urlPathTemplate": "/file/{filename}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "filename": { "equalTo": "file.txt" @@ -116,6 +126,11 @@ "request": { "urlPathTemplate": "/check/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id-2sdx82h" @@ -146,7 +161,12 @@ "name": "ping - Example0", "request": { "urlPathTemplate": "/ping", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/rust-sdk/exhaustive/wiremock/wiremock-mappings.json b/seed/rust-sdk/exhaustive/wiremock/wiremock-mappings.json index aa9597896096..5940350c8ec1 100644 --- a/seed/rust-sdk/exhaustive/wiremock/wiremock-mappings.json +++ b/seed/rust-sdk/exhaustive/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getAndReturnListOfPrimitives - default", "request": { "urlPathTemplate": "/container/list-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -31,7 +36,12 @@ "name": "getAndReturnListOfObjects - default", "request": { "urlPathTemplate": "/container/list-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -57,7 +67,12 @@ "name": "getAndReturnSetOfPrimitives - default", "request": { "urlPathTemplate": "/container/set-of-primitives", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -83,7 +98,12 @@ "name": "getAndReturnSetOfObjects - default", "request": { "urlPathTemplate": "/container/set-of-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -109,7 +129,12 @@ "name": "getAndReturnMapPrimToPrim - default", "request": { "urlPathTemplate": "/container/map-prim-to-prim", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -135,7 +160,12 @@ "name": "getAndReturnMapOfPrimToObject - default", "request": { "urlPathTemplate": "/container/map-prim-to-object", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -161,7 +191,12 @@ "name": "getAndReturnMapOfPrimToUndiscriminatedUnion - default", "request": { "urlPathTemplate": "/container/map-prim-to-union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -187,7 +222,12 @@ "name": "getAndReturnOptional - default", "request": { "urlPathTemplate": "/container/opt-objects", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -213,7 +253,12 @@ "name": "postJsonPatchContentType - default", "request": { "urlPathTemplate": "/foo/bar", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -239,7 +284,12 @@ "name": "postJsonPatchContentWithCharsetType - default", "request": { "urlPathTemplate": "/foo/baz", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -265,7 +315,12 @@ "name": "getAndReturnEnum - default", "request": { "urlPathTemplate": "/enum", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -292,6 +347,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -322,7 +382,12 @@ "name": "testPost - default", "request": { "urlPathTemplate": "/http-methods", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -349,6 +414,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -380,6 +450,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -411,6 +486,11 @@ "request": { "urlPathTemplate": "/http-methods/{id}", "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -441,7 +521,12 @@ "name": "getAndReturnWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -467,7 +552,12 @@ "name": "getAndReturnWithRequiredField - default", "request": { "urlPathTemplate": "/object/get-and-return-with-required-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -493,7 +583,12 @@ "name": "getAndReturnWithMapOfMap - default", "request": { "urlPathTemplate": "/object/get-and-return-with-map-of-map", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -519,7 +614,12 @@ "name": "getAndReturnNestedWithOptionalField - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-optional-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -546,6 +646,11 @@ "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field/{string}", "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "string": { "equalTo": "string" @@ -576,7 +681,12 @@ "name": "getAndReturnNestedWithRequiredFieldAsList - default", "request": { "urlPathTemplate": "/object/get-and-return-nested-with-required-field-list", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -602,7 +712,12 @@ "name": "getAndReturnWithUnknownField - BackslashExample", "request": { "urlPathTemplate": "/object/get-and-return-with-unknown-field", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -628,7 +743,12 @@ "name": "getAndReturnWithDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-with-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -654,7 +774,12 @@ "name": "getAndReturnMapOfDocumentedUnknownType - default", "request": { "urlPathTemplate": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -680,7 +805,12 @@ "name": "getAndReturnWithDatetimeLikeString - DatetimeLikeStringExample", "request": { "urlPathTemplate": "/object/get-and-return-with-datetime-like-string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -706,7 +836,12 @@ "name": "listItems - default", "request": { "urlPathTemplate": "/pagination", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -734,6 +869,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -765,6 +905,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -795,7 +940,12 @@ "name": "getWithQuery - default", "request": { "urlPathTemplate": "/params", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -822,7 +972,12 @@ "name": "getWithAllowMultipleQuery - default", "request": { "urlPathTemplate": "/params", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -850,6 +1005,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -881,6 +1041,11 @@ "request": { "urlPathTemplate": "/params/path-query/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -912,6 +1077,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -943,6 +1113,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -974,6 +1149,11 @@ "request": { "urlPathTemplate": "/params/path/{param}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "param": { "equalTo": "param" @@ -1004,7 +1184,12 @@ "name": "getAndReturnString - default", "request": { "urlPathTemplate": "/primitive/string", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1030,7 +1215,12 @@ "name": "getAndReturnInt - default", "request": { "urlPathTemplate": "/primitive/integer", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1056,7 +1246,12 @@ "name": "getAndReturnLong - default", "request": { "urlPathTemplate": "/primitive/long", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1082,7 +1277,12 @@ "name": "getAndReturnDouble - default", "request": { "urlPathTemplate": "/primitive/double", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1108,7 +1308,12 @@ "name": "getAndReturnBool - default", "request": { "urlPathTemplate": "/primitive/boolean", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1134,7 +1339,12 @@ "name": "getAndReturnDatetime - default", "request": { "urlPathTemplate": "/primitive/datetime", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1160,7 +1370,12 @@ "name": "getAndReturnDate - default", "request": { "urlPathTemplate": "/primitive/date", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1186,7 +1401,12 @@ "name": "getAndReturnUUID - default", "request": { "urlPathTemplate": "/primitive/uuid", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1212,7 +1432,12 @@ "name": "getAndReturnBase64 - default", "request": { "urlPathTemplate": "/primitive/base64", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1239,6 +1464,11 @@ "request": { "urlPathTemplate": "/{id}", "method": "PUT", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" @@ -1269,7 +1499,12 @@ "name": "getAndReturnUnion - default", "request": { "urlPathTemplate": "/union", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1295,7 +1530,12 @@ "name": "withMixedCase - default", "request": { "urlPathTemplate": "/urls/MixedCase", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1322,7 +1562,12 @@ "name": "noEndingSlash - default", "request": { "urlPathTemplate": "/urls/no-ending-slash", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1349,7 +1594,12 @@ "name": "withEndingSlash - default", "request": { "urlPathTemplate": "/urls/with-ending-slash/", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1376,7 +1626,12 @@ "name": "withUnderscores - default", "request": { "urlPathTemplate": "/urls/with_underscores", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1455,7 +1710,12 @@ "name": "getWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1482,7 +1742,12 @@ "name": "postWithNoRequestBody - default", "request": { "urlPathTemplate": "/no-req-body", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, @@ -1508,7 +1773,12 @@ "name": "getWithCustomHeader - default", "request": { "urlPathTemplate": "/test-headers/custom-header", - "method": "POST" + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/rust-sdk/simple-api/basic-custom-config/wiremock/wiremock-mappings.json b/seed/rust-sdk/simple-api/basic-custom-config/wiremock/wiremock-mappings.json index 60ad7d35b22b..9174d97706ce 100644 --- a/seed/rust-sdk/simple-api/basic-custom-config/wiremock/wiremock-mappings.json +++ b/seed/rust-sdk/simple-api/basic-custom-config/wiremock/wiremock-mappings.json @@ -6,6 +6,11 @@ "request": { "urlPathTemplate": "/users/{id}", "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, "pathParameters": { "id": { "equalTo": "id" diff --git a/seed/rust-sdk/single-url-environment-default/full-custom/wiremock/wiremock-mappings.json b/seed/rust-sdk/single-url-environment-default/full-custom/wiremock/wiremock-mappings.json index 58c43fdc07ff..4ac364aeaef6 100644 --- a/seed/rust-sdk/single-url-environment-default/full-custom/wiremock/wiremock-mappings.json +++ b/seed/rust-sdk/single-url-environment-default/full-custom/wiremock/wiremock-mappings.json @@ -5,7 +5,12 @@ "name": "getDummy - default", "request": { "urlPathTemplate": "/dummy", - "method": "GET" + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } }, "response": { "status": 200, diff --git a/seed/swift-sdk/seed.yml b/seed/swift-sdk/seed.yml index ed3e8f48053c..36a2c410822f 100644 --- a/seed/swift-sdk/seed.yml +++ b/seed/swift-sdk/seed.yml @@ -30,12 +30,25 @@ defaultOutputMode: github defaultCustomConfig: {} scripts: - - image: swift:6.1.2 - commands: - build: - - swift build -c release --build-tests - test: - - swift test + docker: + - image: swift:6.1.2 + commands: + build: + - swift build -c release --build-tests + test: + - swift test + local: + - commands: + build: + - if [ -d /Applications/Xcode.app/Contents/Developer ]; then export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer; else export DEVELOPER_DIR=/Library/Developer/CommandLineTools; fi + - if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk ]; then export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk; else export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk; fi + - export PATH="$HOME/.local/bin:$PATH" + - swift build -c release --build-tests + test: + - if [ -d /Applications/Xcode.app/Contents/Developer ]; then export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer; else export DEVELOPER_DIR=/Library/Developer/CommandLineTools; fi + - if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk ]; then export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk; else export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk; fi + - export PATH="$HOME/.local/bin:$PATH" + - swift test fixtures: client-side-params: diff --git a/test-definitions/fern/apis/basic-auth-pw-omitted/generators.yml b/test-definitions/fern/apis/basic-auth-pw-omitted/generators.yml index fc35e4407493..64ff4bd50cfc 100644 --- a/test-definitions/fern/apis/basic-auth-pw-omitted/generators.yml +++ b/test-definitions/fern/apis/basic-auth-pw-omitted/generators.yml @@ -4,7 +4,6 @@ groups: generators: - name: fernapi/fern-php-sdk version: latest - ir-version: v61 github: token: ${GITHUB_TOKEN} mode: push @@ -14,7 +13,7 @@ groups: generators: - name: fernapi/fern-go-sdk version: latest - ir-version: v61 + ir-version: v63 github: token: ${GITHUB_TOKEN} mode: push