Skip to content

Commit

Permalink
Merge branch 'main' into fix-aws-sso
Browse files Browse the repository at this point in the history
  • Loading branch information
endgame committed Aug 7, 2023
2 parents d579a81 + 7353924 commit 0c0614e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/amazonka-core/src/Amazonka/Data/Log.hs
Expand Up @@ -17,6 +17,7 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Builder as Build
import qualified Data.ByteString.Lazy as LBS
import qualified Data.CaseInsensitive as CI
import qualified Data.Char as Char
import qualified Data.List as List
import qualified Data.Text as Text
import qualified Data.Text.Encoding as Text
Expand All @@ -34,10 +35,14 @@ instance ToLog ByteStringBuilder where
build = id

instance ToLog ByteStringLazy where
build = Build.lazyByteString
build lbs = case LText.decodeUtf8' lbs of
Right lt | LText.all Char.isPrint lt -> Build.lazyByteString lbs
_ -> mconcat ["non-printable lazy ByteString (", build (LBS.length lbs), " bytes)"]

instance ToLog ByteString where
build = Build.byteString
build bs = case Text.decodeUtf8' bs of
Right t | Text.all Char.isPrint t -> Build.byteString bs
_ -> mconcat ["non-printable strict ByteString (", build (BS.length bs), " bytes)"]

instance ToLog Int where
build = Build.intDec
Expand Down
3 changes: 3 additions & 0 deletions lib/amazonka/CHANGELOG.md
Expand Up @@ -12,6 +12,9 @@
- `amazonka`: Allow reading the AWS config file when the credentials file is missing [\#951](https://github.com/brendanhay/amazonka/pull/951).
This is useful when you are using a role-based authentication method or AWS IAM Identity Center (formerly AWS SSO) which does not require a credentials file.
Before this fix you had to create an empty credentials file for these methods to work correctly.
- `amazonka`: During logging, do not print bytestrings that have unprintable characters
[\#952](https://github.com/brendanhay/amazonka/pull/952)


## [2.0.0](https://github.com/brendanhay/amazonka/tree/2.0.0)
Released: **28 July 2023**, Compare: [2.0.0-rc2](https://github.com/brendanhay/amazonka/compare/2.0.0-rc2...2.0.0)
Expand Down

0 comments on commit 0c0614e

Please sign in to comment.