Skip to content

Commit e1dbc92

Browse files
authored
Remove install docc process from get-docs.yml (#657)
* Remove install docc process * Use ubuntu:latest with container swift:latest in gen-docs.yml * Use JamesIves/github-pages-deploy-action@v4 * Add install rsync * Fixup broken links in documentation * Update AWSClient documentation
1 parent 55a8ebc commit e1dbc92

File tree

8 files changed

+48
-69
lines changed

8 files changed

+48
-69
lines changed

.github/workflows/gen-docs.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,27 @@ on:
88
jobs:
99
build:
1010

11-
runs-on: macOS-latest
11+
runs-on: ubuntu-latest
1212
timeout-minutes: 15
13+
container:
14+
image: swift:latest
1315

1416
steps:
1517
- name: Checkout
1618
uses: actions/checkout@v4
1719
with:
1820
fetch-depth: 0
19-
- name: Install Dependencies
21+
- name: Install rsync 📚
2022
run: |
21-
brew install mint
22-
mint install apple/swift-docc@main
23-
echo "$HOME/.mint/bin" >> $GITHUB_PATH
23+
apt-get update && apt-get install -y rsync bc
2424
- name: Build
2525
env:
2626
DOCC: docc
2727
run: |
2828
./scripts/build-docc.sh
29-
- name: Commit
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
REMOTE_BRANCH: "gh-pages"
33-
run: |
34-
REMOTE_REPO="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
35-
git config user.name "${GITHUB_ACTOR}"
36-
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
37-
git checkout ${REMOTE_BRANCH}
38-
rm -rf 7.x.x/
39-
mv docs/soto-core/7.x.x/ 7.x.x/
40-
git add --all 7.x.x
41-
git status
42-
43-
git commit -m "Documentation for https://github.com/${GITHUB_REPOSITORY}/tree/${GITHUB_SHA}" -m "Generated by gen-docs.yml"
44-
git push ${REMOTE_REPO} ${REMOTE_BRANCH}
29+
- name: Deploy 🚀
30+
uses: JamesIves/github-pages-deploy-action@v4
31+
with:
32+
folder: docs/soto-core/7.x.x
33+
target-folder: 7.x.x
4534

SotoCore.docc/SotoCore/AWSClient.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Client managing communication with AWS services
1010

1111
The `AWSClient` is the core of Soto. This is the object that manages your communication with AWS. It manages credential acquisition, takes your request, encodes it, signs it, sends it to AWS and then decodes the response for you. In most situations your application should only require one `AWSClient`. Create this at startup and use it throughout.
1212

13-
When creating an `AWSClient` you need to provide how you are going to acquire AWS credentials, what your policy is on retrying failed requests, a list of middleware you would apply to requests to AWS and responses from AWS, client options, where you get your `HTTPClient` and a `Logger` to log any output not directly linked to a request. There are defaults for most of these parameters. The only one required is the `httpClientProvider`.
13+
When creating an `AWSClient` you need to provide how you are going to acquire AWS credentials, what your policy is on retrying failed requests, a list of middleware you would apply to requests to AWS and responses from AWS, client options, where you get your `HTTPClient` and a `Logger` to log any output not directly linked to a request.
1414

1515
```swift
1616
let awsClient = AWSClient(
1717
credentialProvider: .default,
1818
retryPolicy: .default,
1919
middlewares: [],
2020
options: .init(),
21-
httpClientProvider: .createNew,
21+
httpClient: HTTPClient.shared,
2222
logger: AWSClient.loggingDisabled
2323
)
2424
```
@@ -55,20 +55,11 @@ The `retryPolicy` defines how the client reacts to a failed request. There are t
5555

5656
### Middleware
5757

58-
Middleware allows you to insert your own code just as a request has been constructed or a response has been received. You can use this to edit the request/response or just to view it. SotoCore supplies one middleware — `AWSLoggingMiddleware` — which outputs your request to the console once constructed and the response is received from AWS.
58+
Middleware allows you to insert your own code just as a request has been constructed or a response has been received. You can use this to edit the request/response or just to view it. SotoCore supplies one middleware — ``AWSLoggingMiddleware`` — which outputs your request to the console once constructed and the response is received from AWS.
5959

60-
### HTTP Client provider
60+
### HTTP Client
6161

62-
The `HTTPClientProvider` defines where you get your HTTP client from. You have three options:
63-
64-
- Pass `.createNew` which indicates the `AWSClient` should create its own HTTP client. This creates an instance of `HTTPClient` using [`AsyncHTTPClient`](https://github.com/swift-server/async-http.client).
65-
- Supply your own `EventLoopGroup` with `.createNewWithEventLoopGroup(EventLoopGroup`). This creates a new `HTTPClient` but has it use the supplied `EventLoopGroup`.
66-
- Supply your own HTTP client with `.shared(HTTPClient)`.
67-
68-
There are a number of reasons you might want to provide your own client, such as:
69-
70-
- You have one HTTP client you want to use across all your systems.
71-
- You want to change the configuration for the HTTP client used, perhaps you are running behind a proxy or want to enable response decompression.
62+
This is the HTTP client that the AWS client uses to communicate with AWS services. This is defined by protocol, as Soto is agnostic about what HTTP client is used. Currently Soto only provides an implementation for [AsyncHTTPClient](https://github.com/swift-server/async-http-client). By default AWSClient uses the `shared` instance of `HTTPClient`.
7263

7364
## AWSClient Shutdown
7465

@@ -78,21 +69,20 @@ The AWSClient requires you shut it down manually before it is deinitialized. The
7869

7970
### Initializers
8071

81-
- ``init(credentialProvider:retryPolicy:middleware:options:httpClientProvider:logger:)``
82-
- ``init(credentialProvider:retryPolicy:options:httpClientProvider:logger:)``
83-
- ``HTTPClientProvider``
72+
- ``init(credentialProvider:retryPolicy:middleware:options:httpClient:logger:)``
73+
- ``init(credentialProvider:retryPolicy:options:httpClient:logger:)``
8474
- ``Options``
8575
- ``loggingDisabled``
8676

8777
### Shutdown
8878

8979
- ``shutdown()``
80+
- ``syncShutdown()``
9081

9182
### Instance Properties
9283

9384
- ``credentialProvider``
9485
- ``middleware``
95-
- ``retryPolicy``
9686
- ``httpClient``
9787

9888
### Credentials

SotoCore.docc/SotoCore/SotoCore.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
2121

2222
- ``AWSService``
2323
- ``AWSServiceConfig``
24+
- ``AWSServiceErrorType``
2425
- ``ServiceProtocol``
2526
- ``Region``
2627
- ``AWSPartition``
@@ -32,7 +33,6 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
3233
- ``AWSMiddleware``
3334
- ``AWSMiddlewareBuilder``
3435
- ``AWSMiddlewareStack(_:)``
35-
- ``AWSDynamicMiddlewareStack``
3636
- ``AWSMiddlewareContext``
3737
- ``AWSMiddlewareNextHandler``
3838
- ``AWSEditHeadersMiddleware``
@@ -45,14 +45,14 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
4545
### Credentials
4646

4747
- ``CredentialProvider``
48-
- ``AsyncCredentialProvider``
4948
- ``NullCredentialProvider``
5049
- ``ExpiringCredential``
5150
- ``CredentialProviderFactory``
5251
- ``DeferredCredentialProvider``
5352
- ``RotatingCredentialProvider``
5453
- ``RotatingCredential``
5554
- ``CredentialProviderError``
55+
- ``EmptyCredential``
5656

5757
### Retry
5858

@@ -64,7 +64,6 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
6464

6565
- ``AWSEndpoints``
6666
- ``AWSEndpointStorage``
67-
- ``AWSEndpointDiscovery``
6867

6968
### Errors
7069

@@ -81,11 +80,10 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
8180
- ``AWSShape``
8281
- ``AWSEncodableShape``
8382
- ``AWSDecodableShape``
84-
- ``AWSShapeWithPayload``
83+
- ``AWSErrorShape``
8584
- ``AWSShapeOptions``
86-
- ``AWSPayload``
8785
- ``AWSBase64Data``
88-
- ``AWSMemberEncoding``
86+
- ``AWSDocument``
8987
- ``AWSPaginateToken``
9088

9189
### Waiters
@@ -98,12 +96,6 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
9896
- ``JMESAllPathMatcher``
9997
- ``JMESAnyPathMatcher``
10098

101-
### Streaming
102-
103-
- ``StreamReadFunction``
104-
- ``StreamReaderResult``
105-
- ``AWSResponseStream``
106-
10799
### Encoding/Decoding
108100

109101
- ``QueryEncoder``
@@ -121,6 +113,9 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
121113
- ``StandardDictionaryCoder``
122114
- ``StandardArrayCoderProperties``
123115
- ``StandardDictionaryCoderProperties``
116+
- ``EC2ArrayCoder``
117+
- ``EC2StandardArrayCoder``
118+
- ``DateFormatCoder``
124119
- ``ISO8601DateCoder``
125120
- ``HTTPHeaderDateCoder``
126121
- ``UnixEpochDateCoder``
@@ -142,6 +137,7 @@ SotoCore is the underlying driver for executing requests for the Soto Swift SDK
142137

143138
- ``AWSEventStream``
144139
- ``AWSEventPayload``
140+
- ``AWSEventStreamError``
145141

146142
## See Also
147143

Sources/SotoCore/AWSClient.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public final class AWSClient: Sendable {
5858

5959
/// Initialize an AWSClient struct
6060
/// - parameters:
61-
/// - credentialProvider: An object that returns valid signing credentials for request signing.
62-
/// - retryPolicy: Object returning whether retries should be attempted.
61+
/// - credentialProviderFactory: An object that returns valid signing credentials for request signing.
62+
/// - retryPolicyFactory: Object returning whether retries should be attempted.
6363
/// Possible options are `.default`, `.noRetry`, `.exponential` or `.jitter`.
6464
/// - middleware: Chain of middlewares to apply to requests and responses
6565
/// - options: Configuration flags
@@ -94,8 +94,8 @@ public final class AWSClient: Sendable {
9494

9595
/// Initialize an AWSClient struct
9696
/// - parameters:
97-
/// - credentialProvider: An object that returns valid signing credentials for request signing.
98-
/// - retryPolicy: Object returning whether retries should be attempted.
97+
/// - credentialProviderFactory: An object that returns valid signing credentials for request signing.
98+
/// - retryPolicyFactory: Object returning whether retries should be attempted.
9999
/// Possible options are `.default`, `.noRetry`, `.exponential` or `.jitter`.
100100
/// - options: Configuration flags
101101
/// - httpClient: HTTPClient to use.
@@ -217,7 +217,7 @@ public final class AWSClient: Sendable {
217217
let errorLogLevel: Logger.Level
218218

219219
/// Initialize AWSClient.Options
220-
/// - Parameters:
220+
/// - parameters:
221221
// - requestLogLevel: Log level used for request logging
222222
// - errorLogLevel: Log level used for error logging
223223
public init(
@@ -230,10 +230,10 @@ public final class AWSClient: Sendable {
230230
}
231231

232232
/// Initialize AWSClient.Options
233-
/// - Parameters:
234-
/// - signingAlgorithm: Algorithm to use when signing requests
235-
// - requestLogLevel: Log level used for request logging
236-
// - errorLogLevel: Log level used for error logging
233+
/// - parameters:
234+
/// - signingAlgorithm: Algorithm to use when signing requests
235+
/// - requestLogLevel: Log level used for request logging
236+
/// - errorLogLevel: Log level used for error logging
237237
public init(
238238
signingAlgorithm: AWSSigner.Algorithm,
239239
requestLogLevel: Logger.Level = .debug,
@@ -476,9 +476,9 @@ extension AWSClient {
476476

477477
/// Generate a signed URL
478478
/// - parameters:
479-
/// - url : URL to sign
479+
/// - url: URL to sign
480480
/// - httpMethod: HTTP method to use (.GET, .PUT, .PUSH etc)
481-
/// - httpHeaders: Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
481+
/// - headers: Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
482482
/// - expires: How long before the signed URL expires
483483
/// - serviceConfig: additional AWS service configuration used to sign the url
484484
/// - logger: Logger to output to
@@ -506,7 +506,7 @@ extension AWSClient {
506506

507507
/// Generate signed headers
508508
/// - parameters:
509-
/// - url : URL to sign
509+
/// - url: URL to sign
510510
/// - httpMethod: HTTP method to use (.GET, .PUT, .PUSH etc)
511511
/// - headers: Headers that are to be used with this URL.
512512
/// - body: Payload to sign as well. While it is unnecessary to provide the body for S3 other services may require it

Sources/SotoCore/AWSService.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public protocol AWSService: Sendable {
2424
var config: AWSServiceConfig { get }
2525
/// Create new version of service with patch
2626
///
27-
/// This is required to support ``with(region:middlewares:timeout:byteBufferAllocator:options:)``.
27+
/// This is required to support ``with(region:middleware:timeout:byteBufferAllocator:options:)``.
2828
/// Standard implementation is as follows
2929
/// ```swift
3030
/// public init(from: MyService, patch: AWSServiceConfig.Patch) {
@@ -44,7 +44,7 @@ extension AWSService {
4444
/// Return new version of Service with edited parameters
4545
/// - Parameters:
4646
/// - region: Server region
47-
/// - middlewares: Additional middleware to add
47+
/// - middleware: Additional middleware to add
4848
/// - timeout: Time out value for HTTP requests
4949
/// - byteBufferAllocator: byte buffer allocator used throughout AWSClient
5050
/// - options: options used by client when processing requests
@@ -70,7 +70,7 @@ extension AWSService {
7070

7171
/// Generate a signed URL
7272
/// - parameters:
73-
/// - url : URL to sign
73+
/// - url: URL to sign
7474
/// - httpMethod: HTTP method to use (.GET, .PUT, .PUSH etc)
7575
/// - headers: Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
7676
/// - expires: How long before the signed URL expires
@@ -96,7 +96,7 @@ extension AWSService {
9696

9797
/// Generate signed headers
9898
/// - parameters:
99-
/// - url : URL to sign
99+
/// - url: URL to sign
100100
/// - httpMethod: HTTP method to use (.GET, .PUT, .PUSH etc)
101101
/// - headers: Headers that are to be used with this URL. Be sure to include these headers when you used the returned URL
102102
/// - body: body payload to sign as well. While it is unnecessary to provide the body for S3 other services require it

Sources/SotoCore/AWSServiceConfig.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public final class AWSServiceConfig {
5656
/// - region: Region of server you want to communicate with
5757
/// - partition: Amazon endpoint partition. This is ignored if region is set. If no region is set then this is used along side partitionEndpoints to calculate endpoint
5858
/// - amzTarget: "x-amz-target" header value
59+
/// - serviceName: Name of service
5960
/// - serviceIdentifier: Identifier of service. Used in ARN and endpoint
6061
/// - signingName: Name that all AWS requests are signed with
6162
/// - serviceProtocol: protocol of service (.json, .xml, .query etc)
@@ -208,7 +209,7 @@ public final class AWSServiceConfig {
208209
/// Return new version of Service with edited parameters
209210
/// - Parameters:
210211
/// - region: Server region
211-
/// - middlewares: Additional middleware to add
212+
/// - middleware: Additional middleware to add
212213
/// - timeout: Time out value for HTTP requests
213214
/// - byteBufferAllocator: byte buffer allocator used throughout AWSClient
214215
/// - options: options used by client when processing requests

Sources/SotoCore/AWSShapes/Document.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
/// Document value that can hold arbitrary data (See https://smithy.io/2.0/spec/simple-types.html#document)
15+
/// Document value that can hold arbitrary data
16+
///
17+
/// (See https://smithy.io/2.0/spec/simple-types.html#document)
1618
public enum AWSDocument: Sendable, Codable, Equatable {
1719
case string(String)
1820
case double(Double)

Sources/SotoSignerV4/signer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ public struct AWSSigner: Sendable {
294294
/// - method: http method
295295
/// - headers: original headers
296296
/// - date: date to use for signing
297+
/// - algorithm: Signing algorithm (sigV4 or sigV4a)
297298
/// - Returns: Tuple of updated headers and signing data to use in first call to `signChunk`
298299
public func startSigningChunks(
299300
url: URL,

0 commit comments

Comments
 (0)