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
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: unit_tests

Check warning on line 1 in .github/workflows/unit_tests.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

unit_tests.yml:1: overly broad permissions: default permissions used due to no permissions: block

on:
push:
Expand All @@ -9,7 +9,7 @@

jobs:

pod-lib-lint:

Check warning on line 12 in .github/workflows/unit_tests.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

unit_tests.yml:12: overly broad permissions: default permissions used due to no permissions: block
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -24,7 +24,7 @@
- podspec: GoogleSignInSwiftSupport.podspec
includePodspecFlag: "--include-podspecs='GoogleSignIn.podspec'"
steps:
- uses: actions/checkout@v6

Check failure on line 27 in .github/workflows/unit_tests.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 27 in .github/workflows/unit_tests.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

unit_tests.yml:27: unpinned action reference: action is not pinned to a hash (required by blanket policy)
- name: Update Bundler
run: bundle update --bundler
- name: Install Ruby gems with Bundler
Expand All @@ -33,8 +33,8 @@
# See #400 (https://github.com/google/GoogleSignIn-iOS/issues/400)
run: |
pod lib lint ${{ matrix.podspec }} --verbose \
${{ matrix.includePodspecFlag }} ${{ matrix.flag }}
${{ matrix.includePodspecFlag }} ${{ matrix.flag }} --sources=https://github.com/firebase/SpecsDev.git,https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/
spm-build-test:

Check warning on line 37 in .github/workflows/unit_tests.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

unit_tests.yml:37: overly broad permissions: default permissions used due to no permissions: block
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -47,7 +47,7 @@
- sdk: 'iphonesimulator'
destination: '"platform=iOS Simulator,name=iPhone 16,OS=18.6"'
steps:
- uses: actions/checkout@v6

Check failure on line 50 in .github/workflows/unit_tests.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 50 in .github/workflows/unit_tests.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

unit_tests.yml:50: unpinned action reference: action is not pinned to a hash (required by blanket policy)
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
- name: Build unit test target
Expand Down
4 changes: 2 additions & 2 deletions GoogleSignIn.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Google Sign-In SDK allows users to sign in with their Google account from th
:tag => s.version.to_s
}
s.swift_version = '4.0'
ios_deployment_target = '12.0'
ios_deployment_target = '13.0'
osx_deployment_target = '10.15'
s.ios.deployment_target = ios_deployment_target
s.osx.deployment_target = osx_deployment_target
Expand All @@ -33,7 +33,7 @@ The Google Sign-In SDK allows users to sign in with their Google account from th
]
s.ios.framework = 'UIKit'
s.osx.framework = 'AppKit'
s.dependency 'AppCheckCore', '~> 11.0'
s.dependency 'AppCheckCore', '~> 12.0'
s.dependency 'AppAuth', '~> 2.1'
s.dependency 'GTMAppAuth', '~> 5.0'
s.dependency 'GTMSessionFetcher/Core', '~> 3.3'
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;

@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
16 changes: 3 additions & 13 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 @@ -117,13 +113,7 @@ - (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 @@ -143,7 +133,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
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ - (void)viewDidLoad {
// Medium gray with transparency
self.view.backgroundColor = [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:0.25];

UIActivityIndicatorViewStyle style;
if (@available(iOS 13.0, *)) {
style = UIActivityIndicatorViewStyleLarge;
} else {
style = UIActivityIndicatorViewStyleGray;
}
UIActivityIndicatorViewStyle style = UIActivityIndicatorViewStyleLarge;
_activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:style];
_activityIndicator.color = UIColor.whiteColor;
self.activityIndicator.translatesAutoresizingMaskIntoConstraints = NO;
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 @@ -425,8 +425,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
9 changes: 5 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let package = Package(
defaultLocalization: "en",
platforms: [
.macOS(.v10_15),
.iOS(.v12)
.iOS(.v13)
],
products: [
.library(
Expand All @@ -44,9 +44,10 @@ let package = Package(
.package(
url: "https://github.com/openid/AppAuth-iOS.git",
from: "2.1.0"),
.package(
url: "https://github.com/google/app-check.git",
from: "11.0.0"),
// .package(
// url: "https://github.com/google/app-check.git",
// from: "11.0.0"),
.package(url: "https://github.com/google/app-check.git", branch: "pb-swift"),
.package(
url: "https://github.com/google/GTMAppAuth.git",
from: "5.0.0"),
Expand Down
Loading