Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 32 additions & 68 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,32 @@ on:

permissions:
contents: read
checks: write

jobs:
build-swift:
strategy:
fail-fast: false
matrix:
swift: ['swift6', 'swift5']
swift: ['swift5.10', 'swift5-newer-compiler', 'swift6']
include:
- swift: 'swift6'
- swift: 'swift5.10'
language-mode: '5'
xcode-path: '/Applications/Xcode_15.4.app'
macos: 'macos-14'
- swift: 'swift5-newer-compiler'
language-mode: '5'
xcode-path: '/Applications/Xcode_16.2.app'
macos: 'macos-14'
- swift: 'swift5'
xcode-path: '/Applications/Xcode_15.4.app'
- swift: 'swift6'
language-mode: '6'
xcode-path: '/Applications/Xcode_16.2.app'
macos: 'macos-14'

env:
DEVELOPER_DIR: ${{ matrix.xcode-path }}

runs-on: ${{ matrix.macos }}
timeout-minutes: 15

steps:
- name: checkout
Expand All @@ -37,40 +43,24 @@ jobs:
- name: swift version
run: swift --version

- name: build
run: swift build -v
- name: build with complete concurrency checking
run: >
swift build
--target OAuth2
-Xswiftc -swift-version
-Xswiftc '${{ matrix.language-mode }}'
-Xswiftc -warnings-as-errors

- name: run unit tests
continue-on-error: true
run: |
mkdir reports
swift test --parallel --xunit-output 'reports/TestReport.xml'

- name: report unit test results
uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8
if: always()
id: results-swift-tests
with:
name: 'results-swift-tests-${{ matrix.swift }}'
path: 'reports/TestReport.xml'
reporter: swift-xunit
fail-on-error: true

- name: summary
if: always()
run: |
{
echo "# Test Summary Report"
echo ""
echo "System details"
echo ""
echo "Swift: \`${{ matrix.swift }}\` "
echo "macOS: \`${{ matrix.macos }}\` "
echo "Xcode: \`${{ matrix.xcode-path }}\` "
echo ""
echo "Unit Tests Conclusion: \`${{ steps.results-swift-tests.outputs.conclusion }}\` "
echo "Unit Tests Report: <${{ steps.results-swift-tests.outputs.url_html }}>"
} >> $GITHUB_STEP_SUMMARY
run: >
xcodebuild
-workspace '.swiftpm/xcode/package.xcworkspace'
-scheme OAuth2
-configuration Debug
-destination 'platform=macOS'
SWIFT_VERSION='${{ matrix.language-mode }}'
SWIFT_TREAT_WARNINGS_AS_ERRORS=YES
test

build-xcode:
name: 'build-xcode (${{ matrix.platform }})'
Expand All @@ -79,18 +69,10 @@ jobs:
fail-fast: false
matrix:
macos: [ 'macos-14' ]
platform: [ 'macOS', 'iOS', 'tvOS' ]
include:
- platform: 'macOS'
scheme: 'OAuth2macOS'
- platform: 'iOS'
scheme: 'OAuth2iOS'
- platform: 'tvOS'
scheme: 'OAuth2tvOS'
platform: [ 'macOS', 'iOS', 'tvOS', 'watchOS' ]

env:
DEVELOPER_DIR: '/Applications/Xcode_15.4.0.app'
TEST_RESULTS_PATH: 'OAuth2Tests_${{ matrix.platform }}_run${{ github.run_number }}.xcresult'
DEVELOPER_DIR: '/Applications/Xcode_15.4.app'

runs-on: ${{ matrix.macos }}

Expand All @@ -109,27 +91,9 @@ jobs:
- name: build
run: >
xcodebuild
-scheme '${{ matrix.scheme }}'
-workspace '.swiftpm/xcode/package.xcworkspace'
-scheme OAuth2
-configuration Debug
-destination 'platform=${{ matrix.platform }}'
-destination 'generic/platform=${{ matrix.platform }}'
-showBuildTimingSummary
build

- name: test
if: success()
continue-on-error: true
run: >
xcodebuild
-scheme '${{ matrix.scheme }}'
-configuration Debug
-destination 'platform=${{ matrix.platform }}'
-resultBundlePath ${{ env.TEST_RESULTS_PATH }}
test

- name: run xcresulttool
uses: slidoapp/xcresulttool@v2.0.0
if: always()
with:
title: 'results-xcode-tests-${{ matrix.platform }}'
path: ${{ env.TEST_RESULTS_PATH }}
upload-bundles: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
build
.build
DerivedData/
reports/
105 changes: 44 additions & 61 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,55 @@ github_url: https://github.com/p2/OAuth2

theme: fullwidth
readme: README.md
exclude: "**/Keychain.swift"

custom_categories:
- name: Flows
- name: Client
children:
- OAuth2CodeGrant
- OAuth2CodeGrantBasicAuth
- OAuth2CodeGrantAzure
- OAuth2CodeGrantFacebook
- OAuth2CodeGrantLinkedIn
- OAuth2CodeGrantNoTokenType
- OAuth2ClientCredentials
- OAuth2ClientCredentialsReddit
- OAuth2ImplicitGrant
- OAuth2PasswordGrant
- OAuth2PasswordGrantDelegate

- name: Errors & Types
children:
- OAuth2Error
- OAuth2JSON
- OAuth2StringDict

- name: Requests
children:
- OAuth2DataLoader
- OAuth2DataRequest
- OAuth2AuthRequest
- OAuth2RequestPerformer
- OAuth2DataTaskRequestPerformer
- OAuth2Response
- OAuth2Headers
- OAuth2RequestParams
- OAuth2HTTPMethod
- OAuth2HTTPContentType
- OAuth2EndpointAuthMethod

- name: Dyn Reg
- OAuth2Client
- OAuth2ResourceClient

- name: Configuration and Credentials
children:
- OAuth2DynReg

- name: Basics
- OAuth2ClientConfiguration
- OAuth2ClientAuthentication
- OAuth2ClientCredentials
- OAuth2CredentialRecord
- OAuth2KeychainConfiguration
- OAuth2KeychainCredentialStore
- InMemoryOAuth2CredentialStore

- name: Tokens and Registration
children:
- OAuth2
- OAuth2Base
- OAuth2Requestable
- OAuth2Securable
- OAuth2AuthConfig
- OAuth2ClientConfig

- name: Logging & Debugging
- OAuth2TokenSet
- OAuth2TokenSnapshot
- OAuth2TokenResponse
- OAuth2TokenResponseFormat
- OAuth2ClientRegistration
- OAuth2ClientRegistrationResponse
- OAuth2DeviceAuthorization
- JSONValue

- name: Concurrency Boundaries
children:
- OAuth2Logger
- OAuth2DebugLogger
- OAuth2LogLevel
- OAuth2DebugURLSessionDelegate

- name: Internals
- OAuth2Transport
- URLSessionOAuth2Transport
- OAuth2CredentialStore
- OAuth2Clock
- SystemOAuth2Clock
- OAuth2Sleeper
- SystemOAuth2Sleeper
- OAuth2Randomness
- SystemOAuth2Randomness

- name: Interactive Authorization
children:
- OAuth2AuthorizerUI
- OAuth2Authorizer
- OAuth2CustomAuthorizerUI
- OAuth2CustomAuthorizer
- OAuth2ContextStore
- OAuth2KeychainAccount
- OAuth2WebViewController
- OAuth2DataLoaderSessionTaskDelegate
- OAuth2AuthorizationPresenter
- OAuth2AuthorizationPresentationRequest
- OAuth2AuthenticationSessionPresenter
- OAuth2ImplicitResponseLocation


- name: HTTP and Errors
children:
- OAuth2HTTPResponse
- OAuth2ClientError
- OAuth2KeychainError
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5.3
5.10
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Changelog
Version numbering represents the Swift version, plus a running number representing updates, fixes and new features at the same time.
You can also refer to commit logs to get details on what was implemented, fixed and improved.

#### Unreleased — PS-22014

- Require Swift 5.10 and complete strict-concurrency checking.
- Replace the callback and subclass API with the async/await `OAuth2Client` actor and `OAuth2ResourceClient`.
- Isolate interactive authorization to `MainActor` while keeping token, persistence, and resource work background-safe.
- Add cancellation-aware single-flight refresh and authorization, serialized rotating token mutations, and revision-aware 401 recovery.
- Replace `SwiftKeychain` with a queue-isolated Security framework credential store and remove the semaphore and logging dependencies.
- Make Swift Package Manager the only supported package definition and continuously test Swift 5 and Swift 6 language modes.

#### 5.4.0-slido
- Add the device authorization grant flow [PS-17876](https://sli-do.atlassian.net/browse/PS-17876)

Expand Down
Loading
Loading