Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fd3dd9d
Adding the sync APIs for FirebaseAuth
hiranya911 Feb 22, 2018
ac3453b
Added more tests; Added sync APIs for FirebaseMessaging
hiranya911 Feb 22, 2018
ded167e
Removing Task references from database, iid and fcm APIs
hiranya911 Feb 22, 2018
765f209
Fixing a typo
hiranya911 Feb 26, 2018
01ce79e
Minor code clean up
hiranya911 Mar 1, 2018
3913688
Merged with master (auth unit test improvements)
hiranya911 Mar 2, 2018
d5ec1c3
Updated javadocs; Renamed internal helpers of FirebaseMessaging for c…
hiranya911 Mar 8, 2018
f8f33b4
Removed the deprecated FirebaseCredential API (#149)
hiranya911 Mar 9, 2018
27eddb6
Removing the Task API (#152)
hiranya911 Mar 12, 2018
edd825e
Dropping Support for App Engine Java 7 Runtime (#153)
hiranya911 Mar 20, 2018
559ce44
Removing Deprecated LogWrapper API (#154)
hiranya911 Mar 23, 2018
3979c02
Merged with master
hiranya911 Mar 29, 2018
ef036bb
merged with master
hiranya911 Apr 14, 2018
0523bf3
Initial code for the importUsers() API
hiranya911 Apr 18, 2018
0db88c5
Added documentation and more tests
hiranya911 Apr 19, 2018
fe3cc03
Added integration tests; Scrypt hash; more documentation
hiranya911 Apr 19, 2018
46e51ab
Added more tests
hiranya911 Apr 19, 2018
5ede505
Merge branch 'master' into v6
hiranya911 Apr 19, 2018
efc9016
updated test
hiranya911 Apr 24, 2018
dbc1492
Merged with master
hiranya911 May 3, 2018
0633d37
Merged with v6
hiranya911 May 4, 2018
2514703
Adding other hash types
hiranya911 May 4, 2018
ebe905c
Added the remaining hash algorithms
hiranya911 May 4, 2018
1182576
Renamed to ImportUserRecord
hiranya911 May 4, 2018
421a86c
Updated documentation
hiranya911 May 5, 2018
7b085df
Merged with master
hiranya911 May 8, 2018
501faf8
Some minor cleanup
hiranya911 May 8, 2018
dccc454
Updated documentation
hiranya911 May 11, 2018
a4cf116
Updated documentation; Made hash required in UserImportOptions; Other…
hiranya911 May 17, 2018
9130ab2
Renamed BasicHash to RepeatableHash; Made rounds range test configurable
hiranya911 May 22, 2018
3f30183
Added javadoc comment
hiranya911 May 22, 2018
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
Prev Previous commit
Next Next commit
Minor code clean up
  • Loading branch information
hiranya911 committed Mar 1, 2018
commit 01ce79e4d4fca9ceea18f768152b608e38a29a2a
3 changes: 2 additions & 1 deletion src/main/java/com/google/firebase/FirebaseApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ public static FirebaseApp initializeApp(String name) {
try {
return initializeApp(getOptionsFromEnvironment(), name);
} catch (IOException e) {
throw new IllegalArgumentException("Failed to load settings from the environment", e);
throw new IllegalArgumentException(
"Failed to load settings from the system's environment variables", e);
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/google/firebase/auth/FirebaseAuth.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static synchronized FirebaseAuth getInstance(FirebaseApp app) {
* @return A Firebase custom token string.
* @throws IllegalArgumentException If the specified uid is null or empty, or if the app has not
* been initialized with service account credentials.
* @throws FirebaseAuthException If an error occurs while minting the custom token.
* @throws FirebaseAuthException If an error occurs while generating the custom token.
*/
public String createCustomToken(@NonNull String uid) throws FirebaseAuthException {
return createCustomToken(uid, null);
Expand All @@ -154,7 +154,7 @@ public String createCustomToken(@NonNull String uid) throws FirebaseAuthExceptio
* @return A Firebase custom token string.
* @throws IllegalArgumentException If the specified uid is null or empty, or if the app has not
* been initialized with service account credentials.
* @throws FirebaseAuthException If an error occurs while minting the custom token.
* @throws FirebaseAuthException If an error occurs while generating the custom token.
*/
public String createCustomToken(@NonNull String uid,
@Nullable Map<String, Object> developerClaims) throws FirebaseAuthException {
Expand Down Expand Up @@ -213,7 +213,8 @@ public String execute() throws FirebaseAuthException {
serviceAccount.getClientEmail(),
serviceAccount.getPrivateKey());
} catch (GeneralSecurityException | IOException e) {
throw new FirebaseAuthException(ERROR_CUSTOM_TOKEN, "Failed to mint a custom token", e);
throw new FirebaseAuthException(ERROR_CUSTOM_TOKEN,
"Failed to generate a custom token", e);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package com.google.firebase.internal;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
Expand All @@ -36,7 +38,6 @@
public class CallableOperationTest {

private static final String TEST_FIREBASE_THREAD = "test-firebase-thread";
private static final String SAME_THREAD = "same-thread";
private static final FirebaseOptions OPTIONS = new Builder()
.setCredentials(new MockGoogleCredentials())
.setThreadManager(new MockThreadManager())
Expand All @@ -50,40 +51,32 @@ public void tearDown() {
@Test
public void testCallResult() throws Exception {
FirebaseApp app = FirebaseApp.initializeApp(OPTIONS);
CallableOperation<String,Exception> operation = new CallableOperation<String, Exception>() {
CallableOperation<Boolean,Exception> operation = new CallableOperation<Boolean, Exception>() {
@Override
protected String execute() throws Exception {
protected Boolean execute() throws Exception {
String threadName = Thread.currentThread().getName();
if (TEST_FIREBASE_THREAD.equals(threadName)) {
return threadName;
}
return SAME_THREAD;
return TEST_FIREBASE_THREAD.equals(threadName);
}
};
assertEquals(SAME_THREAD, operation.call());
assertEquals(TEST_FIREBASE_THREAD, operation.callAsync(app).get());
assertFalse(operation.call());
assertTrue(operation.callAsync(app).get());
}

@Test
public void testCallException() throws Exception {
FirebaseApp app = FirebaseApp.initializeApp(OPTIONS);
CallableOperation<String,Exception> operation = new CallableOperation<String, Exception>() {
CallableOperation<Boolean,Exception> operation = new CallableOperation<Boolean, Exception>() {
@Override
protected String execute() throws Exception {
protected Boolean execute() throws Exception {
String threadName = Thread.currentThread().getName();
if (TEST_FIREBASE_THREAD.equals(threadName)) {
throw new Exception(threadName);
}
throw new Exception(SAME_THREAD);
return false;
}
};
try {
operation.call();
fail("No exception thrown");
} catch (Exception e) {
assertEquals(SAME_THREAD, e.getMessage());
}

assertFalse(operation.call());
try {
operation.callAsync(app).get();
fail("No exception thrown");
Expand Down