Skip to content

Commit 0a63d01

Browse files
committed
Fix docs and formating
1 parent de71bc1 commit 0a63d01

6 files changed

Lines changed: 48 additions & 38 deletions

File tree

app_check/src/desktop/app_check_desktop.cc

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -186,26 +186,27 @@ Future<std::string> AppCheckInternal::GetAppCheckTokenStringInternal() {
186186
return MakeFuture(future(), handle);
187187
}
188188

189-
Future<std::string> AppCheckInternal::GetLimitedUseAppCheckTokenStringInternal() {
190-
auto handle =
191-
future()->SafeAlloc<std::string>(kAppCheckFnGetLimitedUseAppCheckStringInternal);
189+
Future<std::string>
190+
AppCheckInternal::GetLimitedUseAppCheckTokenStringInternal() {
191+
auto handle = future()->SafeAlloc<std::string>(
192+
kAppCheckFnGetLimitedUseAppCheckStringInternal);
192193

193194
AppCheckProvider* provider = GetProvider();
194195
if (provider != nullptr) {
195-
auto token_callback{
196-
[this, handle](firebase::app_check::AppCheckToken token,
197-
int error_code, const std::string& error_message) {
198-
if (error_code == firebase::app_check::kAppCheckErrorNone) {
199-
future()->CompleteWithResult(handle, 0, token.token);
200-
} else {
201-
future()->Complete(handle, error_code, error_message.c_str());
202-
}
203-
}};
196+
auto token_callback{[this, handle](firebase::app_check::AppCheckToken token,
197+
int error_code,
198+
const std::string& error_message) {
199+
if (error_code == firebase::app_check::kAppCheckErrorNone) {
200+
future()->CompleteWithResult(handle, 0, token.token);
201+
} else {
202+
future()->Complete(handle, error_code, error_message.c_str());
203+
}
204+
}};
204205
provider->GetLimitedUseToken(token_callback);
205206
} else {
206-
future()->Complete(
207-
handle, firebase::app_check::kAppCheckErrorInvalidConfiguration,
208-
"No AppCheckProvider installed.");
207+
future()->Complete(handle,
208+
firebase::app_check::kAppCheckErrorInvalidConfiguration,
209+
"No AppCheckProvider installed.");
209210
}
210211
return MakeFuture(future(), handle);
211212
}
@@ -280,9 +281,8 @@ bool AppCheckInternal::GetAppCheckTokenAsyncForRegistry(App* app,
280281
}
281282

282283
// static
283-
bool AppCheckInternal::GetLimitedUseAppCheckTokenAsyncForRegistry(App* app,
284-
void* /*unused*/,
285-
void* out) {
284+
bool AppCheckInternal::GetLimitedUseAppCheckTokenAsyncForRegistry(
285+
App* app, void* /*unused*/, void* out) {
286286
Future<std::string>* out_future = static_cast<Future<std::string>*>(out);
287287
if (!app || !out_future) {
288288
return false;

app_check/src/desktop/app_check_desktop.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ class AppCheckInternal {
104104
static bool GetAppCheckTokenAsyncForRegistry(App* app, void* /*unused*/,
105105
void* out_future);
106106

107-
static bool GetLimitedUseAppCheckTokenAsyncForRegistry(App* app, void* /*unused*/,
107+
static bool GetLimitedUseAppCheckTokenAsyncForRegistry(App* app,
108+
void* /*unused*/,
108109
void* out_future);
109110

110111
static bool AddAppCheckListenerForRegistry(App* app, void* callback,

functions/src/android/functions_android.cc

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,14 @@ HttpsCallableReferenceInternal* FunctionsInternal::GetHttpsCallable(
220220
JNIEnv* env = app_->GetJNIEnv();
221221

222222
// Create HttpsCallableOptions
223-
jobject builder = env->NewObject(
224-
callable_options_builder::GetClass(),
225-
callable_options_builder::GetMethodId(callable_options_builder::kBuilderConstructor));
223+
jobject builder =
224+
env->NewObject(callable_options_builder::GetClass(),
225+
callable_options_builder::GetMethodId(
226+
callable_options_builder::kBuilderConstructor));
226227
jobject builder2 = env->CallObjectMethod(
227228
builder,
228-
callable_options_builder::GetMethodId(callable_options_builder::kSetLimitedUseAppCheckTokens),
229+
callable_options_builder::GetMethodId(
230+
callable_options_builder::kSetLimitedUseAppCheckTokens),
229231
options.limited_use_app_check_token);
230232
env->DeleteLocalRef(builder);
231233
builder = builder2;
@@ -237,7 +239,8 @@ HttpsCallableReferenceInternal* FunctionsInternal::GetHttpsCallable(
237239
jobject name_string = env->NewStringUTF(name);
238240
jobject callable_reference_obj = env->CallObjectMethod(
239241
obj_,
240-
firebase_functions::GetMethodId(firebase_functions::kGetHttpsCallableWithOptions),
242+
firebase_functions::GetMethodId(
243+
firebase_functions::kGetHttpsCallableWithOptions),
241244
name_string, java_options);
242245
env->DeleteLocalRef(name_string);
243246
env->DeleteLocalRef(java_options);
@@ -265,12 +268,14 @@ HttpsCallableReferenceInternal* FunctionsInternal::GetHttpsCallableFromURL(
265268
JNIEnv* env = app_->GetJNIEnv();
266269

267270
// Create HttpsCallableOptions
268-
jobject builder = env->NewObject(
269-
callable_options_builder::GetClass(),
270-
callable_options_builder::GetMethodId(callable_options_builder::kBuilderConstructor));
271+
jobject builder =
272+
env->NewObject(callable_options_builder::GetClass(),
273+
callable_options_builder::GetMethodId(
274+
callable_options_builder::kBuilderConstructor));
271275
jobject builder2 = env->CallObjectMethod(
272276
builder,
273-
callable_options_builder::GetMethodId(callable_options_builder::kSetLimitedUseAppCheckTokens),
277+
callable_options_builder::GetMethodId(
278+
callable_options_builder::kSetLimitedUseAppCheckTokens),
274279
options.limited_use_app_check_token);
275280
env->DeleteLocalRef(builder);
276281
builder = builder2;
@@ -280,11 +285,11 @@ HttpsCallableReferenceInternal* FunctionsInternal::GetHttpsCallableFromURL(
280285
env->DeleteLocalRef(builder);
281286

282287
jobject url_object = util::CharsToURL(env, url);
283-
jobject callable_reference_obj =
284-
env->CallObjectMethod(obj_,
285-
firebase_functions::GetMethodId(
286-
firebase_functions::kGetHttpsCallableFromURLWithOptions),
287-
url_object, java_options);
288+
jobject callable_reference_obj = env->CallObjectMethod(
289+
obj_,
290+
firebase_functions::GetMethodId(
291+
firebase_functions::kGetHttpsCallableFromURLWithOptions),
292+
url_object, java_options);
288293
env->DeleteLocalRef(url_object);
289294
env->DeleteLocalRef(java_options);
290295

functions/src/common/functions.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ HttpsCallableReference Functions::GetHttpsCallableFromURL(
162162
HttpsCallableReference Functions::GetHttpsCallableFromURL(
163163
const char* url, const HttpsCallableOptions& options) const {
164164
if (!internal_) return HttpsCallableReference();
165-
return HttpsCallableReference(internal_->GetHttpsCallableFromURL(url, options));
165+
return HttpsCallableReference(
166+
internal_->GetHttpsCallableFromURL(url, options));
166167
}
167168

168169
void Functions::UseFunctionsEmulator(const char* origin) {

functions/src/include/firebase/functions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class Functions {
9292

9393
/// @brief Get a FunctionsReference for the specified path with the given
9494
/// options.
95-
HttpsCallableReference GetHttpsCallable(const char* name,
96-
const HttpsCallableOptions& options) const;
95+
HttpsCallableReference GetHttpsCallable(
96+
const char* name, const HttpsCallableOptions& options) const;
9797

9898
/// @brief Get a FunctionsReference for the specified URL.
9999
HttpsCallableReference GetHttpsCallableFromURL(const char* url) const;

functions/src/include/firebase/functions/callable_reference.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ class HttpsCallableReferenceInternal;
3434
} // namespace internal
3535
/// @endcond
3636

37+
/// @brief Options for configuring the callable function.
38+
/// These properties are immutable once a callable function reference is
39+
/// instantiated.
3740
struct HttpsCallableOptions {
38-
// Whether to request a limited-use App Check token for this request.
39-
// This is useful for replay protection.
41+
/// @brief Whether to request a limited-use App Check token for this request.
42+
/// This is useful for replay protection.
4043
bool limited_use_app_check_token;
4144

4245
HttpsCallableOptions() : limited_use_app_check_token(false) {}

0 commit comments

Comments
 (0)