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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GoogleUtilities.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ other Google CocoaPods. They're not intended for direct public usage.
s.subspec 'Environment' do |es|
es.source_files = 'GoogleUtilities/Environment/**/*.[mh]'
es.public_header_files = 'GoogleUtilities/Environment/**/*.h'
es.private_header_files = 'GoogleUtilities/Environment/**/*.h'
# es.private_header_files = 'GoogleUtilities/Environment/**/*.h'

es.dependency 'PromisesObjC', '~> 1.2'
end
Expand Down
26 changes: 13 additions & 13 deletions GoogleUtilities/Environment/SecureStorage/GULKeychainStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ - (instancetype)initWithService:(NSString *)service cache:(NSCache *)cache {
_inMemoryCacheQueue =
dispatch_queue_create("com.gul.KeychainStorage.InMemoryCache", DISPATCH_QUEUE_SERIAL);
_service = [service copy];
_inMemoryCache = cache;
// _inMemoryCache = cache;
}
return self;
}
Expand All @@ -60,22 +60,22 @@ - (instancetype)initWithService:(NSString *)service cache:(NSCache *)cache {
- (FBLPromise<id<NSSecureCoding>> *)getObjectForKey:(NSString *)key
objectClass:(Class)objectClass
accessGroup:(nullable NSString *)accessGroup {
return [FBLPromise onQueue:self.inMemoryCacheQueue
do:^id _Nullable {
// Return cached object or fail otherwise.
id object = [self.inMemoryCache objectForKey:key];
return object
?: [[NSError alloc]
initWithDomain:FBLPromiseErrorDomain
code:FBLPromiseErrorCodeValidationFailure
userInfo:nil];
}]
.recover(^id _Nullable(NSError *error) {
// return [FBLPromise onQueue:self.inMemoryCacheQueue
// do:^id _Nullable {
// // Return cached object or fail otherwise.
// id object = [self.inMemoryCache objectForKey:key];
// return object
// ?: [[NSError alloc]
// initWithDomain:FBLPromiseErrorDomain
// code:FBLPromiseErrorCodeValidationFailure
// userInfo:nil];
// }]
// .recover(^id _Nullable(NSError *error) {
// Look for the object in the keychain.
return [self getObjectFromKeychainForKey:key
objectClass:objectClass
accessGroup:accessGroup];
});
// });
}

- (FBLPromise<NSNull *> *)setObject:(id<NSSecureCoding>)object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ + (BOOL)setItem:(NSData *)item

NSMutableDictionary *mutableQuery = [query mutableCopy];
mutableQuery[(__bridge id)kSecAttrAccessible] =
(__bridge id)kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly;
(__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly;

OSStatus status;
if (!existingItem) {
Expand Down
Loading