Skip to content

Commit

Permalink
Fix App Check documentation (#1064)
Browse files Browse the repository at this point in the history
* Expand documentation for AppCheck

* Update FirebaseAppCheck.cs
  • Loading branch information
a-maurice authored Jul 10, 2024
1 parent 159b2e8 commit a6199ee
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions app_check/src/FirebaseAppCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
namespace Firebase.AppCheck {

/// @brief Firebase App Check object.
///
/// App Check helps protect your API resources from abuse by preventing
/// unauthorized clients from accessing your backend resources.
///
/// With App Check, devices running your app will use an AppCheckProvider that
/// attests to one or both of the following:
/// * Requests originate from your authentic app
/// * Requests originate from an authentic, untampered device
public sealed class FirebaseAppCheck {
// The C++ object that this wraps.
private AppCheckInternal appCheckInternal;
Expand Down Expand Up @@ -53,15 +61,15 @@ private void ThrowIfNull() {
}

/// Gets the instance of FirebaseAppCheck associated with the default
/// {@link FirebaseApp} instance.
/// FirebaseApp instance.
public static FirebaseAppCheck DefaultInstance {
get {
return GetInstance(FirebaseApp.DefaultInstance);
}
}

/// Gets the instance of FirebaseAppCheck associated with the given
/// {@link FirebaseApp} instance.
/// FirebaseApp instance.
public static FirebaseAppCheck GetInstance(FirebaseApp app) {
FirebaseAppCheck result;
if (!appCheckMap.TryGetValue(app.Name, out result)) {
Expand All @@ -72,18 +80,14 @@ public static FirebaseAppCheck GetInstance(FirebaseApp app) {
return result;
}

/// Installs the given {@link AppCheckProviderFactory}, overwriting any that
/// were previously associated with this {@code FirebaseAppCheck} instance.
/// Any {@link AppCheckTokenListener}s attached to this
/// {@code FirebaseAppCheck} instance will be transferred from existing
/// factories to the newly installed one.
/// Installs the given IAppCheckProviderFactory, overwriting any that
/// were previously associated with this FirebaseAppCheck instance.
///
/// <p>Automatic token refreshing will only occur if the global {@code
/// isDataCollectionDefaultEnabled} flag is set to true. To allow automatic
/// token refreshing for Firebase App Check without changing the {@code
/// isDataCollectionDefaultEnabled} flag for other Firebase SDKs, call
/// {@link #setTokenAutoRefreshEnabled(bool)} after installing the {@code
/// factory}.
/// Automatic token refreshing will only occur if the global
/// isDataCollectionDefaultEnabled flag is set to true. To allow automatic
/// token refreshing for Firebase App Check without changing the
/// isDataCollectionDefaultEnabled flag for other Firebase SDKs, call
/// SetTokenAutoRefreshEnabled(bool) after installing the factory.
///
/// This method should be called before initializing the Firebase App.
public static void SetAppCheckProviderFactory(IAppCheckProviderFactory factory) {
Expand Down

0 comments on commit a6199ee

Please sign in to comment.