Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
139 changes: 139 additions & 0 deletions FirebaseVertexAI/Sample/Frameworks/AppCheckCore.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>watchos-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>watchos-arm64_arm64_32</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>arm64_32</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/Versions/A/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AppCheckCore.framework/Versions/A/AppCheckCore</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>AppCheckCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif

#import "AppCheckCore.h"
#import "GACAppAttestProvider.h"
#import "GACAppCheck.h"
#import "GACAppCheckAvailability.h"
#import "GACAppCheckDebugProvider.h"
#import "GACAppCheckErrors.h"
#import "GACAppCheckLogger.h"
#import "GACAppCheckProvider.h"
#import "GACAppCheckSettings.h"
#import "GACAppCheckToken.h"
#import "GACAppCheckTokenDelegate.h"
#import "GACAppCheckTokenResult.h"
#import "GACDeviceCheckProvider.h"

FOUNDATION_EXPORT double AppCheckCoreVersionNumber;
FOUNDATION_EXPORT const unsigned char AppCheckCoreVersionString[];

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import "GACAppCheck.h"
#import "GACAppCheckErrors.h"
#import "GACAppCheckLogger.h"
#import "GACAppCheckProvider.h"
#import "GACAppCheckSettings.h"
#import "GACAppCheckToken.h"
#import "GACAppCheckTokenDelegate.h"
#import "GACAppCheckTokenResult.h"

// Debug provider
#import "GACAppCheckDebugProvider.h"

// DeviceCheck provider
#import "GACDeviceCheckProvider.h"

// App Attest provider.
#import "GACAppAttestProvider.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <Foundation/Foundation.h>

#import "GACAppCheckProvider.h"

#import "GACAppCheckAvailability.h"

NS_ASSUME_NONNULL_BEGIN

/// Firebase App Check provider that verifies app integrity using the
/// [DeviceCheck](https://developer.apple.com/documentation/devicecheck/dcappattestservice) API.
/// This class is available on all platforms for select OS versions. See
/// https://firebase.google.com/docs/ios/learn-more for more details.
GAC_APP_ATTEST_PROVIDER_AVAILABILITY
NS_SWIFT_NAME(AppCheckCoreAppAttestProvider)
@interface GACAppAttestProvider : NSObject <GACAppCheckProvider>

- (instancetype)init NS_UNAVAILABLE;

/// The default initializer.
/// @param serviceName A unique identifier to differentiate storage keys corresponding to the same
/// `resourceName`; may be a Firebase App Name or an SDK name.
/// @param resourceName The name of the resource protected by App Check; for a Firebase App this is
/// "projects/{project_id}/apps/{app_id}".
/// @param baseURL The base URL for the App Check service; defaults to
/// `https://firebaseappcheck.googleapis.com/v1` if nil.
/// @param APIKey The Google Cloud Platform API key, if needed, or nil.
/// @param accessGroup The Keychain Access Group.
/// @param requestHooks Hooks that will be invoked on requests through this service.
/// @return An instance of `AppAttestProvider`.
- (instancetype)initWithServiceName:(NSString *)serviceName
resourceName:(NSString *)resourceName
baseURL:(nullable NSString *)baseURL
APIKey:(nullable NSString *)APIKey
keychainAccessGroup:(nullable NSString *)accessGroup
requestHooks:(nullable NSArray<GACAppCheckAPIRequestHook> *)requestHooks;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#import <Foundation/Foundation.h>

@protocol GACAppCheckProvider;
@protocol GACAppCheckSettingsProtocol;
@protocol GACAppCheckTokenDelegate;
@class GACAppCheckToken;
@class GACAppCheckTokenResult;

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(AppCheckCoreProtocol) @protocol GACAppCheckProtocol

/// Requests an App Check token.
///
/// @param forcingRefresh If `YES`, a new Firebase app check token is requested and the token
/// cache is ignored. If `NO`, the cached token is used if it exists and has not expired yet. In
/// most cases, `NO` should be used. `YES` should only be used if the server explicitly returns an
/// error, indicating a revoked token.
/// @param handler The completion handler to call when the token fetch request completes. The
/// `result` parameter includes the App Check token if the request succeeds, or a placeholder token
/// and an error if the request fails.
- (void)tokenForcingRefresh:(BOOL)forcingRefresh
completion:(void (^)(GACAppCheckTokenResult *result))handler
NS_SWIFT_NAME(token(forcingRefresh:completion:));

/// Retrieve a new limited-use App Check token
///
/// This method does not affect the token generation behavior of the
/// ``tokenForcingRefresh()`` method.
///
/// @param handler The completion handler to call when the token fetch request completes. The
/// `result` parameter includes the App Check token if the request succeeds, or a placeholder token
/// and an error if the request fails.
- (void)limitedUseTokenWithCompletion:(void (^)(GACAppCheckTokenResult *result))handler;

@end

/// A class used to manage App Check tokens for a given resource.
NS_SWIFT_NAME(AppCheckCore)
@interface GACAppCheck : NSObject <GACAppCheckProtocol>

- (instancetype)init NS_UNAVAILABLE;

/// Returns an instance of `AppCheck` for an application.
/// @param serviceName A unique identifier for the App Check instance, may be a Firebase App Name
/// or an SDK name.
/// @param resourceName The name of the resource protected by App Check; for a Firebase App this is
/// "projects/{project_id}/apps/{app_id}".
/// @param appCheckProvider An object that provides App Check tokens.
/// @param settings An object that provides App Check settings.
/// @param tokenDelegate A delegate that receives token update notifications.
/// @param accessGroup The identifier for a keychain group that the app shares items with; if
/// provided, requires the Keychain Access Groups Entitlement.
/// @return An instance of `AppCheckCore` with the specified token provider.
- (instancetype)initWithServiceName:(NSString *)serviceName
resourceName:(NSString *)resourceName
appCheckProvider:(id<GACAppCheckProvider>)appCheckProvider
settings:(id<GACAppCheckSettingsProtocol>)settings
tokenDelegate:(nullable id<GACAppCheckTokenDelegate>)tokenDelegate
keychainAccessGroup:(nullable NSString *)accessGroup;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Availability conditions for different App Check SDK components.

#import <Foundation/Foundation.h>
#import <TargetConditionals.h>

#pragma mark - DeviceCheck

// `DeviceCheckProvider` availability.
#define GAC_DEVICE_CHECK_PROVIDER_AVAILABILITY \
API_AVAILABLE(ios(11.0), macos(10.15), macCatalyst(13.0), tvos(11.0), watchos(9.0))

#pragma mark - App Attest

// `AppAttestProvider` availability annotations
#define GAC_APP_ATTEST_PROVIDER_AVAILABILITY \
API_AVAILABLE(ios(14.0), macos(11.3), macCatalyst(14.5), tvos(15.0), watchos(9.0))
Loading
Loading