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
Lazy OAuth via interceptor in Swift client, drop sync semaphore
Adds BarcodeAuthInterceptor to the AsposeBarcodeCloudClient template:
the client installs it on its per-instance apiConfiguration so the
URLSession pipeline lazily fetches and injects the bearer token on
first use, deduplicating concurrent token fetches. Drops apply() and
the blocking authorize() throws (DispatchSemaphore) variant; adds an
async authorize() async throws overload for explicit warm-up.
Updates the AsposeBarcodeCloudClient and README mustache templates
and bumps the Swift submodule pointer to the regenerated SDK.
Copy file name to clipboardExpand all lines: codegen/Templates/swift/README.mustache
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,12 @@ let client = AsposeBarcodeCloudClient(
33
33
clientId: "your-client-id",
34
34
clientSecret: "your-client-secret"
35
35
)
36
+
```
37
+
38
+
The OAuth access token is fetched lazily on the first API call. To warm it up at app start, await the explicit method:
36
39
37
-
try client.authorize()
40
+
```swift
41
+
_ = try await client.authorize()
38
42
```
39
43
40
44
If you already have an access token, configure the SDK directly:
@@ -43,7 +47,7 @@ If you already have an access token, configure the SDK directly:
43
47
let client = AsposeBarcodeCloudClient(accessToken: "your-access-token")
44
48
```
45
49
46
-
`AsposeBarcodeCloudClient` owns a per-instance `apiConfiguration` and sets `Authorization`, `x-aspose-client`, and `x-aspose-client-version` headers on it. Pass `client.apiConfiguration` to each API call so the headers are applied.
50
+
`AsposeBarcodeCloudClient` owns a per-instance `apiConfiguration` and sets `x-aspose-client` and `x-aspose-client-version` headers on it. The bundled `BarcodeAuthInterceptor` injects the `Authorization` header on each authenticated request. Pass `client.apiConfiguration` to each API call so the headers are applied.
0 commit comments