Skip to content
Open
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
36 changes: 36 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,42 @@ jobs:
-scheme GoogleSignIn-Package \
-destination "platform=OS X"

spm-app-check-11:
# Package.swift accepts app-check 11.x and 12.x, but Package.resolved is gitignored, so
# spm-build-test always gets the newest (12.x). Pin the latest 11.x (what Firebase 12
# apps resolve) to keep SPM + AppCheckCore 11 covered. iOS only: all App Check code is
# behind TARGET_OS_IOS && !TARGET_OS_MACCATALYST.
runs-on: macos-15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
- name: Pin app-check to the latest 11.x
run: |
version=$(git ls-remote --tags --refs https://github.com/google/app-check.git '11.*' \
| sed 's|.*refs/tags/||' | sort -V | tail -1)
echo "Pinning app-check $version"
# `resolve <name> --version` can only re-pin an already-resolved dependency.
swift package resolve
swift package resolve app-check --version "$version"
- name: Build unit test target
run: |
xcodebuild \
-scheme GoogleSignIn-Package \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 16" \
-onlyUsePackageVersionsFromResolvedFile \
build-for-testing
- name: Run unit test target
run: |
xcodebuild \
-scheme GoogleSignIn-Package \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 16,OS=18.5" \
-onlyUsePackageVersionsFromResolvedFile \
test-without-building


xcode-27-preview-archive:
# Archive every supported platform against the Xcode 27 preview image. The
# image is preview, so this job does not block merges.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased
- Fix a crash when a server error response carries a non-string value under its `error` key. The EMM error handler sent `-hasPrefix:` to whatever value was present, raising an unrecognized selector exception on a number, array or object.
- Fix a custom `nonce` and requested token `claims` being dropped when a sign-in is continued after a Device Policy app restart.
- Add Swift Package Manager support for AppCheckCore 12.x, enabling compatibility with Firebase 13. CocoaPods installations remain restricted to AppCheckCore 11.x

# 10.0.0
- **BREAKING**: Update to AppAuth 3.0.0 and GTMAppAuth 6.0.0, which raises the minimum deployment targets to iOS 15.0 and macOS 12.0, widens the `GTMSessionFetcher` dependency to allow 4.x and 5.x, and renames the version-specific Swift Package Manager manifest to `Package@swift-5.7.swift`. Projects that must keep supporting earlier OS versions should stay on GoogleSignIn 9.2.0. ([#628](https://github.com/google/GoogleSignIn-iOS/pull/628))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#import <Foundation/Foundation.h>

#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
#import <AppCheckCore/GACAppCheckProvider.h>
@import AppCheckCore;
Comment thread
paulb777 marked this conversation as resolved.

@class GACAppCheckToken;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST

#import <AppCheckCore/GACAppCheckToken.h>
@import AppCheckCore;

NSUInteger const kGIDAppCheckProviderFakeError = 1;

Expand Down
19 changes: 4 additions & 15 deletions GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@

#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST

#import <AppCheckCore/GACAppCheck.h>
#import <AppCheckCore/GACAppCheckSettings.h>
#import <AppCheckCore/GACAppCheckTokenResult.h>
#import <AppCheckCore/GACAppAttestProvider.h>
#import <AppCheckCore/GACAppCheckDebugProvider.h>
@import AppCheckCore;

#import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h"
#import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDAppCheckError.h"
Expand Down Expand Up @@ -115,15 +111,8 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion)
}

[self.appCheck limitedUseTokenWithCompletion:^(GACAppCheckTokenResult * _Nonnull result) {
NSError * __block maybeError = result.error;
@synchronized (self) {
if (!result.token && !result.error) {
maybeError = [NSError errorWithDomain:kGIDAppCheckErrorDomain
code:kGIDAppCheckUnexpectedError
userInfo:nil];
}

if (result.token) {
if (!result.error) {
[self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey];
}

Expand All @@ -134,7 +123,7 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion)


for (GIDAppCheckPrepareCompletion savedCompletion in callbacks) {
savedCompletion(maybeError);
savedCompletion(result.error);
}
}];
});
Expand All @@ -143,7 +132,7 @@ - (void)prepareForAppCheckWithCompletion:(nullable GIDAppCheckPrepareCompletion)
- (void)getLimitedUseTokenWithCompletion:(nullable GIDAppCheckTokenCompletion)completion {
dispatch_async(self.workerQueue, ^{
[self.appCheck limitedUseTokenWithCompletion:^(GACAppCheckTokenResult * _Nonnull result) {
if (result.token) {
if (!result.error) {
[self.userDefaults setBool:YES forKey:kGIDAppCheckPreparedKey];
}
if (completion) {
Expand Down
2 changes: 1 addition & 1 deletion GoogleSignIn/Sources/GIDSignIn.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#import "GoogleSignIn/Sources/GIDSignInCallbackSchemes.h"
#import "GoogleSignIn/Sources/GIDClaimsInternalOptions.h"
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
#import <AppCheckCore/GACAppCheckToken.h>
@import AppCheckCore;
#import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h"
#import "GoogleSignIn/Sources/GIDAppCheck/UI/GIDActivityIndicatorViewController.h"
#import "GoogleSignIn/Sources/GIDEMMErrorHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion GoogleSignIn/Tests/Unit/GIDAppCheckTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST

#import <XCTest/XCTest.h>
#import <AppCheckCore/GACAppCheckToken.h>
@import AppCheckCore;
#import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h"
#import "GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h"
#import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDAppCheckError.h"
Expand Down
7 changes: 5 additions & 2 deletions GoogleSignIn/Tests/Unit/GIDSignInTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#import "GoogleSignIn/Sources/GIDClaimsInternalOptions.h"

#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
#import <AppCheckCore/GACAppCheckToken.h>
@import AppCheckCore;
#import "GoogleSignIn/Sources/GIDAppCheck/Implementations/GIDAppCheck.h"
#import "GoogleSignIn/Sources/GIDAppCheck/Implementations/Fake/GIDAppCheckProviderFake.h"
#import "GoogleSignIn/Sources/GIDEMMErrorHandler.h"
Expand Down Expand Up @@ -426,8 +426,11 @@ - (void)testConfigureFailsNoTokenOrError {
XCTestExpectation *configureFailsExpecation =
[self expectationWithDescription:@"Configure fails expectation"];

NSError *expectedError = [NSError errorWithDomain:kGIDAppCheckErrorDomain
code:kGIDAppCheckUnexpectedError
userInfo:nil];
GIDAppCheckProviderFake *fakeProvider =
[[GIDAppCheckProviderFake alloc] initWithAppCheckToken:nil error:nil];
[[GIDAppCheckProviderFake alloc] initWithAppCheckToken:nil error:expectedError];
GIDAppCheck *appCheck =
[[GIDAppCheck alloc] initWithAppCheckProvider:fakeProvider
userDefaults:_testUserDefaults];
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let package = Package(
from: "3.0.0"),
.package(
url: "https://github.com/google/app-check.git",
from: "11.0.0"),
"11.0.0" ..< "13.0.0"),
.package(
url: "https://github.com/google/GTMAppAuth.git",
from: "6.0.0"),
Expand Down
Loading