You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* temporary disable API Keys until awslabs/aws-sdk-swift#1979 is fixed
* swift format
* add a note in the README
* pave the road towards using a bearer token provider
* remove debugging statements
* swift-format
* fix bearer token authentication
* fix tests
* fix format
* add Examples/api-key in the list of integration tests
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,9 @@ let bedrock = try await BedrockService(
135
135
)
136
136
```
137
137
138
-
### API Key Authentication
138
+
### API Key Authentication (temporary unavailable)
139
+
140
+
This capability will be available when issue [#1979](https://github.com/awslabs/aws-sdk-swift/issues/1979) from the AWS SDK for Swift will be fixed or a workaround provided.
139
141
140
142
Use an API key for authentication. API keys are generated in the AWS console and provide a simpler authentication method for specific use cases.
Copy file name to clipboardExpand all lines: Sources/BedrockAuthentication.swift
+16-4Lines changed: 16 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -56,16 +56,15 @@ public enum BedrockAuthentication: Sendable, CustomStringConvertible {
56
56
/// Creates an AWS credential identity resolver depending on the authentication parameter.
57
57
/// - Parameters:
58
58
/// - authentication: The authentication type to use
59
-
/// - Returns: An optional AWS credential identity resolver. A nil return value means that the default AWS credential provider chain will be used.
59
+
/// - Returns: An optional AWS credential identity resolver. A nil return value means that the default AWS credential provider chain will be used or that the authentication type does not require a specific resolver (like `apiKey`).
@@ -84,4 +83,17 @@ public enum BedrockAuthentication: Sendable, CustomStringConvertible {
84
83
returnStaticAWSCredentialIdentityResolver(creds)
85
84
}
86
85
}
86
+
87
+
/// Creates a BearerTokenIdentityResolver depending on the authentication parameter.
88
+
/// - Returns: An optional BearerTokenIdentityResolver. A nil return value means that the authentication type requires an AWSCredentialsProvider instead (like `default`, `profile`, `sso`, `webIdentity`, or `static`).
89
+
/// - Note: Only `apiKey` authentication uses BearerTokenIdentityResolver.
// force utilisation of a bearer token instead of AWS credentials + Signv4
187
+
// see https://github.com/awslabs/aws-sdk-swift/blob/15b8951d108968f767f4199a3c011e27ac519d61/Sources/Services/AWSBedrockRuntime/Sources/AWSBedrockRuntime/AuthSchemeResolver.swift#L58
0 commit comments