From e78e7670f203ab0e64151c9831647436a9f0d610 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 15:32:07 -0700 Subject: [PATCH 01/32] Swift docC markdown and SwiftPackage index yaml file for building docs. --- .gitignore | 1 + .spi.yml | 5 +++ .../OAuthKit/OAuthKit.docc/GettingStarted.md | 11 +++++++ Sources/OAuthKit/OAuthKit.docc/OAuthKit.md | 31 +++++++++++++++++++ Sources/OAuthKit/OAuthKit.docc/SampleCode.md | 15 +++++++++ 5 files changed, 63 insertions(+) create mode 100644 .spi.yml create mode 100644 Sources/OAuthKit/OAuthKit.docc/GettingStarted.md create mode 100644 Sources/OAuthKit/OAuthKit.docc/OAuthKit.md create mode 100644 Sources/OAuthKit/OAuthKit.docc/SampleCode.md diff --git a/.gitignore b/.gitignore index 8300ca8..f3a5856 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ DerivedData/ .swiftpm/configuration/registries.json .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata .netrc +Package.resolved \ No newline at end of file diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 0000000..5a783d6 --- /dev/null +++ b/.spi.yml @@ -0,0 +1,5 @@ +version: 1 +builder: + configs: + - documentation_targets: + - OAuthKit diff --git a/Sources/OAuthKit/OAuthKit.docc/GettingStarted.md b/Sources/OAuthKit/OAuthKit.docc/GettingStarted.md new file mode 100644 index 0000000..fda3d91 --- /dev/null +++ b/Sources/OAuthKit/OAuthKit.docc/GettingStarted.md @@ -0,0 +1,11 @@ +# Getting Started with OAuthKit + +Create an ``OAuth`` instance and start an authorization flow. + +@Metadata { + @PageKind(article) +} + +## Overview + +Starting an ``OAuth/authorize(provider:grantType:)`` flow. diff --git a/Sources/OAuthKit/OAuthKit.docc/OAuthKit.md b/Sources/OAuthKit/OAuthKit.docc/OAuthKit.md new file mode 100644 index 0000000..736bfc4 --- /dev/null +++ b/Sources/OAuthKit/OAuthKit.docc/OAuthKit.md @@ -0,0 +1,31 @@ +# ``OAuthKit`` + +A modern and observable Swift Package for implementing OAuth 2.0 authorization flows. + +@Metadata { + @PageColor(purple) +} + +## Overview + +OAuthKit offers a robust, type-safe, and performant OAuth 2.0 implementation using the observer design pattern. This pattern allows applications to observe an ``OAuth`` object and be notified of ``OAuth/State`` changes. + +This has the advantage of avoiding direct coupling with an authorization flow, enabling highly flexible and fine-grained control when interacting with an ``OAuth/Provider``. It also allows updates across multiple observers. + +### Featured + +@Links(visualStyle: detailedGrid) { + - + - +} + +## Topics + +### Essentials + +- +- +- ``OAuth`` + +### State Observability +- ``OAuth/state`` diff --git a/Sources/OAuthKit/OAuthKit.docc/SampleCode.md b/Sources/OAuthKit/OAuthKit.docc/SampleCode.md new file mode 100644 index 0000000..030ecbd --- /dev/null +++ b/Sources/OAuthKit/OAuthKit.docc/SampleCode.md @@ -0,0 +1,15 @@ +# OAuthKit Sample: Integrating OAuthKit into an App + +Integrate OAuthKit into a multiplatform app with support for iOS, macOS, tvOS, visionOS, and watchOS. + +@Metadata { + @CallToAction( + purpose: link, + url: "https://github.com/codefiesta/OAuthSample" + ) + @PageKind(sampleCode) +} + +## Overview + +This sample creates _OAuthSample_, an app for demonstrating how to get up and running quickly with OAuthKit. From 4724200df25784040578abcd057f1afd2726aeb6 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 16:43:05 -0700 Subject: [PATCH 02/32] Beefing up the documentation --- Sources/OAuthKit/OAuth+State.swift | 39 ++++++++++++++++++- Sources/OAuthKit/OAuth.swift | 26 ++++++++++++- .../OAuthKit.docc/Extensions/OAuth.md | 16 ++++++++ Sources/OAuthKit/OAuthKit.docc/OAuthKit.md | 2 +- 4 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md diff --git a/Sources/OAuthKit/OAuth+State.swift b/Sources/OAuthKit/OAuth+State.swift index e7127b2..87031c0 100644 --- a/Sources/OAuthKit/OAuth+State.swift +++ b/Sources/OAuthKit/OAuth+State.swift @@ -9,7 +9,44 @@ import Foundation extension OAuth { - /// Holds the OAuth state that is published to subscribers via the `OAuth.state` property publisher. + /// Holds the OAuth state that is published to subscribers via the ``state`` property. + /// + /// A n example of observing the ``state`` property in SwiftUI: + /// ```swift + ///struct ContentView: View { + /// + /// @Environment(\.oauth) + /// var oauth: OAuth + /// + /// var body: some View { + /// VStack { + /// switch oauth.state { + /// case .empty: + /// providerList + /// case .authorizing(let provider, let grantType): + /// Text("Authorizing [\(provider.id)] with [\(grantType.rawValue)]") + /// case .requestingAccessToken(let provider): + /// Text("Requesting Access Token [\(provider.id)]") + /// case .requestingDeviceCode(let provider): + /// Text("Requesting Device Code [\(provider.id)]") + /// case .authorized(let provider, _): + /// Button("Authorized [\(provider.id)]") { + /// oauth.clear() + /// } + /// case .receivedDeviceCode(_, let deviceCode): + /// Text("To login, visit") + /// Text(.init("[\(deviceCode.verificationUri)](\(deviceCode.verificationUri))")) + /// .foregroundStyle(.blue) + /// Text("and enter the following code:") + /// Text(deviceCode.userCode) + /// } + /// } + /// .onChange(of: oauth.state) { oldState, newState in + /// handle(state: newState) + /// } + /// } + /// } + /// ``` public enum State: Equatable, Sendable { /// The state is empty and no authorizations or tokens have been issued. diff --git a/Sources/OAuthKit/OAuth.swift b/Sources/OAuthKit/OAuth.swift index fb6b12f..b1f44fb 100644 --- a/Sources/OAuthKit/OAuth.swift +++ b/Sources/OAuthKit/OAuth.swift @@ -29,8 +29,30 @@ public enum OAError: Error { case keychain } -/// Provides an observable OAuth 2.0 implementation. -/// See: https://datatracker.ietf.org/doc/html/rfc6749 +/// Provides an observable OAuth 2.0 implementation that emits ``OAuth/state`` changes when +/// an authorization flow is started by calling ``OAuth/authorize(provider:grantType:)``. +/// +/// You can create an observable OAuth object using the ``OAuth/init(_:options:)`` or ``OAuth/init(providers:options:)`` initializers, or +/// you can access a default OAuth object via SwiftUI ``SwiftUICore/EnvironmentValues`` via the following: +/// +/// ```swift +/// @Environment(\.oauth) +/// var oauth: OAuth +/// ``` +/// +/// An OAuth object can also be highly customized when passed a dictionary of ``Option`` values into it's iniitializers. +/// ```swift +/// let options: [OAuth.Option: Any] = [ +/// .applicationTag: "com.bundle.Idenfitier", +/// .autoRefresh: true, +/// .requireAuthenticationWithBiometricsOrCompanion: true, +/// .useNonPersistentWebDataStore: true +/// ] +/// let oauth: OAuth = .init(.module, options: options) +/// ``` +/// +/// - SeeAlso: +/// [RFC 6749](https://datatracker.ietf.org/doc/html/rfc6749) @MainActor @Observable public final class OAuth { diff --git a/Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md b/Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md new file mode 100644 index 0000000..a952a8c --- /dev/null +++ b/Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md @@ -0,0 +1,16 @@ +# ``OAuthKit/OAuth`` + +## Topics + +### Creating an Observable OAuth + +- ``init(_:options:)`` +- ``init(providers:options:)`` + +### Starting an authorization flow + +- ``authorize(provider:grantType:)`` + +### Observing an OAuth state + +- ``state`` diff --git a/Sources/OAuthKit/OAuthKit.docc/OAuthKit.md b/Sources/OAuthKit/OAuthKit.docc/OAuthKit.md index 736bfc4..89ebac4 100644 --- a/Sources/OAuthKit/OAuthKit.docc/OAuthKit.md +++ b/Sources/OAuthKit/OAuthKit.docc/OAuthKit.md @@ -1,6 +1,6 @@ # ``OAuthKit`` -A modern and observable Swift Package for implementing OAuth 2.0 authorization flows. +A modern and observable framework for implementing OAuth 2.0 authorization flows. @Metadata { @PageColor(purple) From d6dd2488ab8402a45466bc5b3845b1757ea3e9e6 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 17:03:06 -0700 Subject: [PATCH 03/32] Testing auto doc generation. --- .github/workflows/swift.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index ca3884f..4d94873 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -28,6 +28,18 @@ jobs: run: swift build -v - name: Test run: swift test --enable-code-coverage + - name: Generate Docs + uses: SwiftDocOrg/swift-doc@master + with: + inputs: Sources + module-name: OAuthKit + output: docs + - name: Upload Docs + uses: SwiftDocOrg/github-wiki-publish-action@v1 + with: + path: docs + env: + GH_PERSONAL_ACCESS_TOKEN: ${{secrets.GIST_SECRET}} - id: coverage uses: codefiesta/swift-coverage-action@0.0.4 - name: badge From 0e3d271588e706d43419ec96a1a61a8d71edf716 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 17:10:56 -0700 Subject: [PATCH 04/32] Moving docC stuff into it's own workflow --- .github/workflows/docs.yml | 24 ++++++++++++++++++++++++ .github/workflows/swift.yml | 12 ------------ 2 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..9d99d46 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,24 @@ +# This workflow generates Swift DocC documentation and publishes to Github pages +# https://github.com/marketplace/actions/swift-doc +name: Documentation + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Generate Documentation + uses: SwiftDocOrg/swift-doc@master + with: + inputs: "Sources" + module-name: OAuthKit + output: "Documentation" + - name: Upload Documentation + uses: SwiftDocOrg/github-wiki-publish-action@v1 + with: + path: "Documentation" + env: + GH_PERSONAL_ACCESS_TOKEN: ${{secrets.GIST_SECRET}} diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 4d94873..ca3884f 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -28,18 +28,6 @@ jobs: run: swift build -v - name: Test run: swift test --enable-code-coverage - - name: Generate Docs - uses: SwiftDocOrg/swift-doc@master - with: - inputs: Sources - module-name: OAuthKit - output: docs - - name: Upload Docs - uses: SwiftDocOrg/github-wiki-publish-action@v1 - with: - path: docs - env: - GH_PERSONAL_ACCESS_TOKEN: ${{secrets.GIST_SECRET}} - id: coverage uses: codefiesta/swift-coverage-action@0.0.4 - name: badge From 3e258fd09152617057f7ef13435416095ffcabe9 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 17:20:14 -0700 Subject: [PATCH 05/32] Trying a different action --- .github/workflows/docs.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9d99d46..87ae99e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,16 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Generate Documentation - uses: SwiftDocOrg/swift-doc@master + - uses: sersoft-gmbh/swifty-docs-action@v3 with: - inputs: "Sources" - module-name: OAuthKit - output: "Documentation" - - name: Upload Documentation - uses: SwiftDocOrg/github-wiki-publish-action@v1 - with: - path: "Documentation" - env: - GH_PERSONAL_ACCESS_TOKEN: ${{secrets.GIST_SECRET}} + output: docs +# - name: Upload Documentation +# uses: SwiftDocOrg/github-wiki-publish-action@v1 +# with: +# path: "Documentation" +# env: +# GH_PERSONAL_ACCESS_TOKEN: ${{secrets.GIST_SECRET}} From 99152c454e50516652468efa4ffcdb1b01e59f34 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 17:22:03 -0700 Subject: [PATCH 06/32] Trying macOS runner --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 87ae99e..b4b8c7d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,7 +6,7 @@ on: [push] jobs: build: - runs-on: ubuntu-latest + runs-on: macos-15 steps: - uses: sersoft-gmbh/swifty-docs-action@v3 From 61d84f4b887844bf71826956420f2ce59be9c97b Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 17:28:34 -0700 Subject: [PATCH 07/32] Trying again --- .github/workflows/docs.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b4b8c7d..049c063 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,16 +5,12 @@ name: Documentation on: [push] jobs: + build: runs-on: macos-15 steps: - - uses: sersoft-gmbh/swifty-docs-action@v3 - with: - output: docs -# - name: Upload Documentation -# uses: SwiftDocOrg/github-wiki-publish-action@v1 -# with: -# path: "Documentation" -# env: -# GH_PERSONAL_ACCESS_TOKEN: ${{secrets.GIST_SECRET}} + - uses: actions/checkout@v4 + - uses: sersoft-gmbh/swifty-docs-action@v3 + with: + target: OAuthKit From e5cc278dbfbdbebdfbc74cb5c0aef303e9b13a48 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 17:31:26 -0700 Subject: [PATCH 08/32] Maybe?? --- .github/workflows/docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 049c063..8662866 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,5 +12,3 @@ jobs: steps: - uses: actions/checkout@v4 - uses: sersoft-gmbh/swifty-docs-action@v3 - with: - target: OAuthKit From 8321724f56de7e88e470526c72c8dd0be5626f22 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 18:48:49 -0700 Subject: [PATCH 09/32] New approach --- .github/workflows/docc.yml | 48 ++++++++++++++++++++++++++++++++++++++ .github/workflows/docs.yml | 14 ----------- 2 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/docc.yml delete mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml new file mode 100644 index 0000000..b546dc8 --- /dev/null +++ b/.github/workflows/docc.yml @@ -0,0 +1,48 @@ +# Generates and Deploys DocC documentation to Github pages +# See: https://maxxfrazer.medium.com/deploying-docc-with-github-actions-218c5ca6cad5 +name: DocC + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + # Must be set to this for deploying to GitHub Pages + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + runs-on: macos-15 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Generate DocC + run: | + xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; + $(xcrun --find docc) process-archive \ + transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ + --hosting-base-path OAuthKit \ + --output-path docs; + echo "" > docs/index.html; + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload only docs directory + path: 'docs' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 8662866..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,14 +0,0 @@ -# This workflow generates Swift DocC documentation and publishes to Github pages -# https://github.com/marketplace/actions/swift-doc -name: Documentation - -on: [push] - -jobs: - - build: - runs-on: macos-15 - - steps: - - uses: actions/checkout@v4 - - uses: sersoft-gmbh/swifty-docs-action@v3 From 2706eb571d786552d0f26914c4beea39efdab02a Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 18:55:35 -0700 Subject: [PATCH 10/32] WIP --- .github/workflows/docc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index b546dc8..d5b4836 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -39,10 +39,10 @@ jobs: --output-path docs; echo "" > docs/index.html; - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v4 with: # Upload only docs directory path: 'docs' - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v4 From cfeba075791220fa23d9f7ea7e037e51e68230e3 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 18:58:29 -0700 Subject: [PATCH 11/32] WIP --- .github/workflows/docc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index d5b4836..64cab30 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -39,7 +39,7 @@ jobs: --output-path docs; echo "" > docs/index.html; - name: Upload artifact - uses: actions/upload-pages-artifact@v4 + uses: actions/upload-pages-artifact@v3 with: # Upload only docs directory path: 'docs' From 0c71223dc2846ba63d774892944561b67b6af407 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:07:26 -0700 Subject: [PATCH 12/32] WIP --- .github/workflows/docc.yml | 41 ++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 64cab30..be248a7 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -20,29 +20,32 @@ concurrency: cancel-in-progress: true jobs: + # Single deploy job since we're just deploying - deploy: + docc: environment: # Must be set to this for deploying to GitHub Pages name: github-pages url: ${{steps.deployment.outputs.page_url}} + XCODE_VERSION: 'Xcode_16.4' runs-on: macos-15 + steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Generate DocC - run: | - xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; - $(xcrun --find docc) process-archive \ - transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ - --hosting-base-path OAuthKit \ - --output-path docs; - echo "" > docs/index.html; - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload only docs directory - path: 'docs' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Checkout + - uses: actions/checkout@v4 + - name: Select Xcode + run: sudo xcode-select -s "/Applications/$XCODE_VERSION.app" + - name: Generate DocC + run: | + xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; + $(xcrun --find docc) process-archive \ + transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ + --hosting-base-path OAuthKit \ + --output-path docs; + echo "" > docs/index.html; + - name: Upload artifact + - uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + - name: Deploy to GitHub Pages + - uses: actions/deploy-pages@v4 From da7df15d9ff1d8c44070a95fdadd63ff7757ac75 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:09:58 -0700 Subject: [PATCH 13/32] Skipping swift build for now until I get this resolved. --- .github/workflows/swift.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index ca3884f..c9aa4f0 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -12,6 +12,10 @@ on: jobs: build: + + # Only run this action if the PR isn't a draft and it is labled as a `security` PR + if: "skip" == false + env: XCODE_VERSION: 'Xcode_16.4' runs-on: macos-15 From 6b1420b9ba6cd6b5d9cd95262688aefc1295872c Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:11:19 -0700 Subject: [PATCH 14/32] Testing --- .github/workflows/swift.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index c9aa4f0..14292b0 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -13,8 +13,7 @@ jobs: build: - # Only run this action if the PR isn't a draft and it is labled as a `security` PR - if: "skip" == false + if: "skip" == "dude" env: XCODE_VERSION: 'Xcode_16.4' From 5e5dd1a0ad5832366d73845ede3ca966393debc4 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:12:57 -0700 Subject: [PATCH 15/32] WUP --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 14292b0..59115f7 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -13,7 +13,7 @@ jobs: build: - if: "skip" == "dude" + if: contains(github.event.pull_request.labels.*.name, 'blah') env: XCODE_VERSION: 'Xcode_16.4' From f195d6b76eecdb2f686960c9733bb8bd19cd720a Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:15:55 -0700 Subject: [PATCH 16/32] WIP --- .github/workflows/docc.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index be248a7..2806a00 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -23,7 +23,8 @@ jobs: # Single deploy job since we're just deploying docc: - environment: + + env: # Must be set to this for deploying to GitHub Pages name: github-pages url: ${{steps.deployment.outputs.page_url}} From a400a008b20f2b257e7716a71ba3e44a282379ed Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:18:15 -0700 Subject: [PATCH 17/32] WIP --- .github/workflows/docc.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 2806a00..a5dad7f 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -32,7 +32,6 @@ jobs: runs-on: macos-15 steps: - - name: Checkout - uses: actions/checkout@v4 - name: Select Xcode run: sudo xcode-select -s "/Applications/$XCODE_VERSION.app" From 62540a3c0eb24f3a04234653777e32daf64b1132 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:19:46 -0700 Subject: [PATCH 18/32] WIP --- .github/workflows/docc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index a5dad7f..bac683d 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -24,17 +24,17 @@ jobs: # Single deploy job since we're just deploying docc: - env: + environment: # Must be set to this for deploying to GitHub Pages name: github-pages url: ${{steps.deployment.outputs.page_url}} - XCODE_VERSION: 'Xcode_16.4' + runs-on: macos-15 steps: - uses: actions/checkout@v4 - name: Select Xcode - run: sudo xcode-select -s "/Applications/$XCODE_VERSION.app" + run: sudo xcode-select -s "/Applications/Xcode_16.4.app" - name: Generate DocC run: | xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; From a3a4c7d46e1a2fd31f18caad56ff87b31ffeffd3 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:21:01 -0700 Subject: [PATCH 19/32] Blah --- .github/workflows/docc.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index bac683d..67b74d5 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -35,17 +35,3 @@ jobs: - uses: actions/checkout@v4 - name: Select Xcode run: sudo xcode-select -s "/Applications/Xcode_16.4.app" - - name: Generate DocC - run: | - xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; - $(xcrun --find docc) process-archive \ - transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ - --hosting-base-path OAuthKit \ - --output-path docs; - echo "" > docs/index.html; - - name: Upload artifact - - uses: actions/upload-pages-artifact@v3 - with: - path: 'docs' - - name: Deploy to GitHub Pages - - uses: actions/deploy-pages@v4 From 48419b4625014a752dc7577f03846f4b1502fad7 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:23:55 -0700 Subject: [PATCH 20/32] More Steps --- .github/workflows/docc.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 67b74d5..6a446da 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -35,3 +35,18 @@ jobs: - uses: actions/checkout@v4 - name: Select Xcode run: sudo xcode-select -s "/Applications/Xcode_16.4.app" + - name: Generate DocC + run: xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; + - name: Transform DocC + run: | + $(xcrun --find docc) process-archive \ + transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ + --hosting-base-path OAuthKit \ + --output-path docs; + echo "" > docs/index.html; + - name: Upload artifact + - uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + - name: Deploy to GitHub Pages + - uses: actions/deploy-pages@v4 From 02cb4aa51ebcbff861fa5e40cadc99c6381f9207 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:25:59 -0700 Subject: [PATCH 21/32] Breaking down steps --- .github/workflows/docc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 6a446da..db15dd4 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -38,12 +38,12 @@ jobs: - name: Generate DocC run: xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; - name: Transform DocC - run: | - $(xcrun --find docc) process-archive \ + run: $(xcrun --find docc) process-archive \ transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ --hosting-base-path OAuthKit \ --output-path docs; - echo "" > docs/index.html; + - name: Update Index + run: echo "" > docs/index.html; - name: Upload artifact - uses: actions/upload-pages-artifact@v3 with: From 11b38eafc0f71cd969dd77b30201e1562152caa3 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:26:46 -0700 Subject: [PATCH 22/32] WIP --- .github/workflows/docc.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index db15dd4..8d5cd84 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -37,16 +37,16 @@ jobs: run: sudo xcode-select -s "/Applications/Xcode_16.4.app" - name: Generate DocC run: xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; - - name: Transform DocC - run: $(xcrun --find docc) process-archive \ - transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ - --hosting-base-path OAuthKit \ - --output-path docs; - - name: Update Index - run: echo "" > docs/index.html; - - name: Upload artifact - - uses: actions/upload-pages-artifact@v3 - with: - path: 'docs' - - name: Deploy to GitHub Pages - - uses: actions/deploy-pages@v4 +# - name: Transform DocC +# run: $(xcrun --find docc) process-archive \ +# transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ +# --hosting-base-path OAuthKit \ +# --output-path docs; +# - name: Update Index +# run: echo "" > docs/index.html; +# - name: Upload artifact +# - uses: actions/upload-pages-artifact@v3 +# with: +# path: 'docs' +# - name: Deploy to GitHub Pages +# - uses: actions/deploy-pages@v4 From 3c538b7c01e3aa288c23bd184962d7917a79ff41 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:31:00 -0700 Subject: [PATCH 23/32] WIPPITY --- .github/workflows/docc.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 8d5cd84..5da2dd0 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -37,11 +37,12 @@ jobs: run: sudo xcode-select -s "/Applications/Xcode_16.4.app" - name: Generate DocC run: xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; -# - name: Transform DocC -# run: $(xcrun --find docc) process-archive \ -# transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ -# --hosting-base-path OAuthKit \ -# --output-path docs; + - name: Transform DocC + run: | + $(xcrun --find docc) process-archive \ + transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ + --hosting-base-path OAuthKit \ + --output-path docs; # - name: Update Index # run: echo "" > docs/index.html; # - name: Upload artifact From c064b8b19d0ec8c9ceea4e22835338d7b33b8869 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:34:35 -0700 Subject: [PATCH 24/32] Next step --- .github/workflows/docc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 5da2dd0..12f6691 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -43,8 +43,8 @@ jobs: transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/OAuthKit.doccarchive \ --hosting-base-path OAuthKit \ --output-path docs; -# - name: Update Index -# run: echo "" > docs/index.html; + - name: Update Index + run: echo "" > docs/index.html; # - name: Upload artifact # - uses: actions/upload-pages-artifact@v3 # with: From a120e412c03d3cd3c710e8a52a9154d751fdb973 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:37:28 -0700 Subject: [PATCH 25/32] New steps --- .github/workflows/docc.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 12f6691..75a5a39 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -45,9 +45,9 @@ jobs: --output-path docs; - name: Update Index run: echo "" > docs/index.html; -# - name: Upload artifact -# - uses: actions/upload-pages-artifact@v3 -# with: -# path: 'docs' -# - name: Deploy to GitHub Pages -# - uses: actions/deploy-pages@v4 + - name: Upload artifact + - uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + - name: Deploy to GitHub Pages + - uses: actions/deploy-pages@v4 From 35ed440a5f655e1842e0c8ccc78a70861b9dc17b Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:38:57 -0700 Subject: [PATCH 26/32] Testing 123 --- .github/workflows/docc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 75a5a39..3581132 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -45,9 +45,9 @@ jobs: --output-path docs; - name: Update Index run: echo "" > docs/index.html; - - name: Upload artifact + - name: Upload Pages Artifact - uses: actions/upload-pages-artifact@v3 with: path: 'docs' - - name: Deploy to GitHub Pages - - uses: actions/deploy-pages@v4 +# - name: Deploy to GitHub Pages +# - uses: actions/deploy-pages@v4 From c636c6a5351ce65f00c009f713820bb159baf414 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 19:40:59 -0700 Subject: [PATCH 27/32] =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 3581132..21e4188 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -46,8 +46,8 @@ jobs: - name: Update Index run: echo "" > docs/index.html; - name: Upload Pages Artifact - - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v3 with: path: 'docs' -# - name: Deploy to GitHub Pages -# - uses: actions/deploy-pages@v4 + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 From f3813f6809ce07afed761b67a527621b1fb1a482 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 20:04:38 -0700 Subject: [PATCH 28/32] WIP --- .github/workflows/docc.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 21e4188..3939e32 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -24,6 +24,9 @@ jobs: # Single deploy job since we're just deploying docc: + env: + XCODE_VERSION: 'Xcode_16.4' + environment: # Must be set to this for deploying to GitHub Pages name: github-pages @@ -34,7 +37,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Select Xcode - run: sudo xcode-select -s "/Applications/Xcode_16.4.app" + run: sudo xcode-select -s "/Applications/$XCODE_VERSION.app" - name: Generate DocC run: xcodebuild docbuild -scheme OAuthKit -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS'; - name: Transform DocC From 5967a71cfa58867241ac5da8f0d6f5b4f2ced96d Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 20:11:06 -0700 Subject: [PATCH 29/32] Updating the Swift Package Index external doc link --- .spi.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.spi.yml b/.spi.yml index 5a783d6..85d47a3 100644 --- a/.spi.yml +++ b/.spi.yml @@ -1,5 +1,3 @@ version: 1 -builder: - configs: - - documentation_targets: - - OAuthKit +external_links: + documentation: "https://codefiesta.github.io/OAuthKit/documentation/oauthkit" From 860e9b28eaa0254f273f5102e44cac8f8c574183 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 20:29:30 -0700 Subject: [PATCH 30/32] Updating GettingStarted doc --- .../OAuthKit/OAuthKit.docc/GettingStarted.md | 113 +++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/Sources/OAuthKit/OAuthKit.docc/GettingStarted.md b/Sources/OAuthKit/OAuthKit.docc/GettingStarted.md index fda3d91..f20f516 100644 --- a/Sources/OAuthKit/OAuthKit.docc/GettingStarted.md +++ b/Sources/OAuthKit/OAuthKit.docc/GettingStarted.md @@ -8,4 +8,115 @@ Create an ``OAuth`` instance and start an authorization flow. ## Overview -Starting an ``OAuth/authorize(provider:grantType:)`` flow. +OAuth 2.0 authorization flows are started by calling ``OAuth/authorize(provider:grantType:)`` with an ``OAuth/Provider`` and ``OAuth/GrantType``. + +```swift +// Create an observable OAuth object +let oauth: OAuth = .init(.main) + +// Start an authorization flow +let grantType: OAuth.GrantType = .pkce(.init()) +oauth.authorize(provider: provider, grantType: grantType) +``` + +## Observing OAuth State + +Once an OAuth 2.0 authorization flow has been started in an application, observers of an OAuth object will be notified of next step events in that flow and can react accordingly. For example: + +```swift +@main +struct OAuthApp: App { + + @Environment(\.oauth) + var oauth: OAuth + + /// Build the scene body + var body: some Scene { + + WindowGroup { + ContentView() + } + + #if canImport(WebKit) + WindowGroup(id: "oauth") { + OAWebView(oauth: oauth) + } + #endif + } +} + +struct ContentView: View { + + @Environment(\.oauth) + var oauth: OAuth + + @Environment(\.openWindow) + var openWindow + + @Environment(\.dismissWindow) + private var dismissWindow + + var body: some View { + VStack { + switch oauth.state { + case .empty: + providerList + case .authorizing(let provider, let grantType): + Text("Authorizing [\(provider.id)] with [\(grantType.rawValue)]") + case .requestingAccessToken(let provider): + Text("Requesting Access Token [\(provider.id)]") + case .requestingDeviceCode(let provider): + Text("Requesting Device Code [\(provider.id)]") + case .authorized(let provider, _): + Button("Authorized [\(provider.id)]") { + oauth.clear() + } + case .receivedDeviceCode(_, let deviceCode): + Text("To login, visit") + Text(.init("[\(deviceCode.verificationUri)](\(deviceCode.verificationUri))")) + .foregroundStyle(.blue) + Text("and enter the following code:") + Text(deviceCode.userCode) + .padding() + .border(Color.primary) + .font(.title) + } + } + .onChange(of: oauth.state) { _, state in + handle(state: state) + } + } + + /// Displays a list of oauth providers. + var providerList: some View { + List(oauth.providers) { provider in + Button(provider.id) { + authorize(provider: provider) + } + } + } + + /// Starts the authorization process for the specified provider. + /// - Parameter provider: the provider to begin authorization for + private func authorize(provider: OAuth.Provider) { + let grantType: OAuth.GrantType = .pkce(.init()) + oauth.authorize(provider: provider, grantType: grantType) + } + + /// Reacts to oauth state changes by opening or closing authorization windows. + /// - Parameter state: the published state change + private func handle(state: OAuth.State) { + #if canImport(WebKit) + switch state { + case .empty, .requestingAccessToken, .requestingDeviceCode: + break + case .authorizing, .receivedDeviceCode: + openWindow(id: "oauth") + case .authorized(_, _): + dismissWindow(id: "oauth") + } + #endif + } +} +``` + From 6257c8d4aa6525f314e5474900e4a5a6dde52a96 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 21:00:51 -0700 Subject: [PATCH 31/32] Doc updates --- Sources/OAuthKit/Network/NetworkMonitor.swift | 2 +- Sources/OAuthKit/OAuth+DeviceCode.swift | 4 ++-- Sources/OAuthKit/OAuth+Provider.swift | 2 +- Sources/OAuthKit/OAuth+Token.swift | 4 ++-- Sources/OAuthKit/OAuth.swift | 2 +- Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md | 3 ++- Sources/OAuthKit/Views/OAWebView.swift | 2 +- Sources/OAuthKit/Views/OAWebViewCoordinator.swift | 1 + 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Sources/OAuthKit/Network/NetworkMonitor.swift b/Sources/OAuthKit/Network/NetworkMonitor.swift index 37b12b7..d3ae851 100644 --- a/Sources/OAuthKit/Network/NetworkMonitor.swift +++ b/Sources/OAuthKit/Network/NetworkMonitor.swift @@ -8,7 +8,7 @@ import Network import Observation -/// A type that broadcasts network reachability via Combine event publishing. +/// An `Observable` type that publishes network reachability information. @MainActor @Observable public final class NetworkMonitor { diff --git a/Sources/OAuthKit/OAuth+DeviceCode.swift b/Sources/OAuthKit/OAuth+DeviceCode.swift index 942c43c..8a6f3a9 100644 --- a/Sources/OAuthKit/OAuth+DeviceCode.swift +++ b/Sources/OAuthKit/OAuth+DeviceCode.swift @@ -10,8 +10,8 @@ import Foundation extension OAuth { /// A codable type that holds device code information. - /// See: https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow - /// See: https://www.oauth.com/playground/device-code.html + /// - SeeAlso: + /// [Requesting a Device Code](https://www.oauth.com/playground/device-code.html) public struct DeviceCode: Codable, Equatable, Sendable { /// A constant for the oauth grant type. diff --git a/Sources/OAuthKit/OAuth+Provider.swift b/Sources/OAuthKit/OAuth+Provider.swift index 237e45c..6e83e4f 100644 --- a/Sources/OAuthKit/OAuth+Provider.swift +++ b/Sources/OAuthKit/OAuth+Provider.swift @@ -57,7 +57,7 @@ extension OAuth { case debug } - /// Public initializer + /// Public initializer. /// - Parameters: /// - id: The provider unique id /// - icon: The provider icon diff --git a/Sources/OAuthKit/OAuth+Token.swift b/Sources/OAuthKit/OAuth+Token.swift index 5094df8..7267d77 100644 --- a/Sources/OAuthKit/OAuth+Token.swift +++ b/Sources/OAuthKit/OAuth+Token.swift @@ -10,8 +10,8 @@ import Foundation extension OAuth { /// A codable type that holds oauth token information. - /// See: https://www.oauth.com/oauth2-servers/access-tokens/access-token-response/ - /// See: https://datatracker.ietf.org/doc/html/rfc6749#section-5.1 + /// - SeeAlso: + /// [Access Token Response](https://www.oauth.com/oauth2-servers/access-tokens/access-token-response/) public struct Token: Codable, Equatable, Sendable { /// The access token string as issued by the authorization server. diff --git a/Sources/OAuthKit/OAuth.swift b/Sources/OAuthKit/OAuth.swift index b1f44fb..534c5b0 100644 --- a/Sources/OAuthKit/OAuth.swift +++ b/Sources/OAuthKit/OAuth.swift @@ -29,7 +29,7 @@ public enum OAError: Error { case keychain } -/// Provides an observable OAuth 2.0 implementation that emits ``OAuth/state`` changes when +/// Provides an `Observable` OAuth 2.0 implementation that emits ``OAuth/state`` changes when /// an authorization flow is started by calling ``OAuth/authorize(provider:grantType:)``. /// /// You can create an observable OAuth object using the ``OAuth/init(_:options:)`` or ``OAuth/init(providers:options:)`` initializers, or diff --git a/Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md b/Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md index a952a8c..44206c7 100644 --- a/Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md +++ b/Sources/OAuthKit/OAuthKit.docc/Extensions/OAuth.md @@ -11,6 +11,7 @@ - ``authorize(provider:grantType:)`` -### Observing an OAuth state +### Observing an OAuth object - ``state`` +- ``providers`` diff --git a/Sources/OAuthKit/Views/OAWebView.swift b/Sources/OAuthKit/Views/OAWebView.swift index 57bfcd4..7e9069b 100644 --- a/Sources/OAuthKit/Views/OAWebView.swift +++ b/Sources/OAuthKit/Views/OAWebView.swift @@ -10,7 +10,7 @@ import SwiftUI import WebKit /// A UIViewRepresentable / NSViewRepresentable wrapper type that coordinates -/// oauth authorization flows inside a WKWebView. +/// oauth authorization flows inside a `WKWebView`. @MainActor public struct OAWebView { diff --git a/Sources/OAuthKit/Views/OAWebViewCoordinator.swift b/Sources/OAuthKit/Views/OAWebViewCoordinator.swift index cf1992e..8f23c82 100644 --- a/Sources/OAuthKit/Views/OAWebViewCoordinator.swift +++ b/Sources/OAuthKit/Views/OAWebViewCoordinator.swift @@ -9,6 +9,7 @@ import SwiftUI import WebKit +/// Coordinates ``OAuth/state-swift.property`` changes inside a ``OAWebView``. @MainActor public class OAWebViewCoordinator: NSObject { From 5e1844c405eddd3d3131e45ca024086916075da6 Mon Sep 17 00:00:00 2001 From: Kevin McKee Date: Wed, 2 Jul 2025 21:06:32 -0700 Subject: [PATCH 32/32] Applying fixes. --- .github/workflows/docc.yml | 2 -- .github/workflows/swift.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 3939e32..0b7c4d2 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -5,8 +5,6 @@ name: DocC on: push: branches: [ "main" ] - pull_request: - branches: [ "main" ] # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 59115f7..51c42f2 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -13,8 +13,6 @@ jobs: build: - if: contains(github.event.pull_request.labels.*.name, 'blah') - env: XCODE_VERSION: 'Xcode_16.4' runs-on: macos-15