fix(appcheck): clearer fac debug token logging#16197
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
| // Print only locally generated token to avoid a valid token leak on CI. | ||
| FIRLogWarning(kFIRLoggerAppCheck, kFIRLoggerAppCheckMessageCodeDebugToken, | ||
| @"Firebase App Check debug token: '%@'.", [provider localDebugToken]); |
There was a problem hiding this comment.
I'd need to run it to verify but I think we may just want to delete lines 29-31. This functionality should ideally live, IMHO, only in AppCheckCore since Google Sign-In integrates directly with it.
There was a problem hiding this comment.
It seems like AppCheckCore is behaving correctly in terms of when to log the token. I just forgot to remove it here when splitting it off.
There was a problem hiding this comment.
I scoped it down in eeb69f8 but I think it's reasonable to fix this by just removing it entirely.
Would need to also update example snippet in docs:
There was a problem hiding this comment.
Ah, we can remove it but do need to update the debug log snippet in https://firebase.devsite.corp.google.com/docs/app-check/ios/debug-provider
And consider how to fit in the pointer to the debug token registration on the Firebase console. Either in token log and/or catching exchangeDebugToken failure.
When a debug token is provided to FirebaseAppCheck via environment variable, the locally generated one is still printed, despite it being unused. This is confusing.
This PR doesn't stop the locally generated token from being generated and stored, but it no longer logs it when the env var token is set.
A subsequent run without the env var set will log the token.
cc: @rizafran