Skip to content

Conversation

@maksymmalyhin
Copy link
Contributor

This is a part of #2591

  • FIRAuthAppDelegateProxy replaced by GULAppDelegateSwizzler
  • FIRAuth tests to test the App Delegate swizzling

I target it to mm/app-swizzler-apns to simplify the review. The PR should be merged to master after #2698

…public interface with no assumptions on the implementation details
Conflicts:
	Example/Messaging/Tests/FIRMessagingRemoteNotificationsProxyTest.m
…s applied to all targets. Move the hook to the top level to avoid confusion.
…etProxyOriginalDelegateOnceToken] at the beginning of each test.
@maksymmalyhin maksymmalyhin self-assigned this Apr 2, 2019
@maksymmalyhin maksymmalyhin marked this pull request as ready for review April 2, 2019 21:11
@charlotteliang charlotteliang requested a review from renkelvin April 2, 2019 21:12
#import <FirebaseCore/FIRLogger.h>
#import <FirebaseCore/FIROptions.h>
#import <GoogleUtilities/GULAppEnvironmentUtil.h>
#import <GoogleUtilities/GULAppDelegateSwizzler.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this line above #import <GoogleUtilities/GULAppEnvironmentUtil.h>.

didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
[self canHandleNotification:userInfo];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Auth can handle the notification, we want to stop passing the notification to other UIApplicationDelegate interceptors. Is it possible with GULAppDelegateSwizzler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GULAppDelegateSwizzler is a generic class that makes sure the methods are called for each interceptor as well as for the original implementation. AFAIK it would be a violation of the class design if one interceptor could affect other interceptors (e.g. prevent calling a method). @tejasd @ryanwilson please let us know if it is not true.

@renkelvin If it is an essential to call the methods on only one arbitrary instance of FIRAuth I can recover FIRAuthAppDelegateProxy and put this logic there. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GULAppDelegateSwizzler cannot currently handle this scenario.

@renkelvin Would you be able to elaborate on why that's necessary? At first glance, that seems like a dangerous thing to do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tejasd Yeah, I agree it seems dangerous. Auth uses remote notification and redirected URL to pass some sensitive information. These information are necessary but not sufficient to hack a user's account. It would be better if we can hide them if possible.

@maksymmalyhin Yeah, it's not what GULAppDelegateSwizzler should handle. I agree.

Let me double check with my team to see if we can find a better solution and get back to you guys. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi all, after further discussions, we think Auth should follow the pattern of GULAppDelegateSwizzler and we'll be more restricted to the information passed in notifications and urls.
@maksymmalyhin FIRAuthAppDelegateProxy can't fully protect the sensitive information, so let's still discard it. Thank you!

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Apr 4, 2019
@maksymmalyhin maksymmalyhin changed the base branch from mm/app-swizzler-apns to master April 4, 2019 14:14
@maksymmalyhin
Copy link
Contributor Author

It looks like GitHub could not handle retargeting the PR to master correctly. I may need to close this PR and open a new one.

@paulb777
Copy link
Member

paulb777 commented Apr 4, 2019

GitHub seems to do better with rebases than merges :(

@paulb777 paulb777 added cla: yes and removed cla: no labels Apr 5, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@maksymmalyhin maksymmalyhin merged commit cd507af into master Apr 5, 2019
@maksymmalyhin maksymmalyhin deleted the mm/auth-swizzling2 branch April 8, 2019 19:14
Corrob pushed a commit that referenced this pull request Apr 25, 2019
@firebase firebase locked and limited conversation to collaborators Oct 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants