Skip to content

Static credentials DeserializationError #3304

@SynqlyGabriel

Description

@SynqlyGabriel

Acknowledgements

Describe the bug

A DeserializationError is returned when using a static credentials provider created with a static credentials that has a trailing space or new line in the SecretAccessKey value

DeserializationError: "failed to decode response body, invalid character '\\n' in string literal"

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

An error message relating to the SecretAccessKey being invalid is returned

Current Behavior

A DeserializationError error is returned: "failed to decode response body, invalid character '\\n' in string literal"

Reproduction Steps

  1. Create a new credentials provider using credentials.NewStaticCredentialsProvider with the SecretAccessKey value containing a trailing space or new line.
  2. Create an aws.config value as normal using the credentials provider created in the above step
  3. Create an inspector2.Client with the NewFromConfig method
  4. Use the inspector2.Client.ListFindings method

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2 v1.41.1
github.com/aws/aws-sdk-go-v2/service/inspector2 v1.46.2
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17 // indirect
github.com/aws/smithy-go v1.24.0

Compiler and Version used

go version go1.25.5 darwin/arm64

Operating System and version

macOS Tahoe 26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.p3This is a minor priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions