Skip to content

FIS getAuthToken implementation. #769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c54292e
FIS getAuthToken implementation.
ankitaj224 Sep 5, 2019
b4b6ba8
FIS getAuthToken implementation.
ankitaj224 Sep 5, 2019
b8bfc1a
Merge branch 'fis_auth' of github.com:firebase/firebase-android-sdk i…
ankitaj224 Sep 5, 2019
7a2a112
Merge branch 'fis_auth' of github.com:firebase/firebase-android-sdk i…
ankitaj224 Sep 5, 2019
42c20f6
Merge branch 'fis_auth' of github.com:firebase/firebase-android-sdk i…
ankitaj224 Sep 5, 2019
46d936c
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 Sep 5, 2019
48fd7fe
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 Sep 5, 2019
82fb69e
1. Addressing Ciaran's comments
ankitaj224 Sep 6, 2019
fe04e15
1. Addressing Ciaran's comments
ankitaj224 Sep 6, 2019
e91cb7e
Merge branch 'fis_auth' of github.com:firebase/firebase-android-sdk i…
ankitaj224 Sep 6, 2019
8569952
Merge branch 'fis_auth' of github.com:firebase/firebase-android-sdk i…
ankitaj224 Sep 6, 2019
b74b163
Merge branch 'fis_auth' of github.com:firebase/firebase-android-sdk i…
ankitaj224 Sep 6, 2019
58a30e3
Updated IntDef usage in firebase-installations
ankitaj224 Sep 6, 2019
96e30c2
Using CountDownLatch to await instead of executor.awaitTermination
ankitaj224 Sep 7, 2019
9e3e34d
Addressing Di's comments.
ankitaj224 Sep 10, 2019
824cb63
Addressing Di's comments.
ankitaj224 Sep 10, 2019
90673c3
Merge branch 'fis_auth' of github.com:firebase/firebase-android-sdk i…
ankitaj224 Sep 10, 2019
f5b4f8c
Addressing Ciaran's comments to replace latch with a custom listener.
ankitaj224 Sep 10, 2019
3e29941
Adding onSuccess to AwaitListener.
ankitaj224 Sep 10, 2019
75f2581
Cleaning up the code as per the ciaran's comments.
ankitaj224 Sep 11, 2019
91e49bc
Addressing Di's comments.
ankitaj224 Sep 11, 2019
4578880
1. Handling multiple calls to getAUthToken()
ankitaj224 Sep 13, 2019
7d19b50
Fixing api-information presubmit check.
ankitaj224 Sep 13, 2019
fe04884
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 Sep 13, 2019
f1d1d37
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 Sep 13, 2019
ec65040
updating api.txt for firbase-installations-interop
ankitaj224 Sep 13, 2019
396d273
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 Sep 13, 2019
81b4aeb
Addressing Ciaran's comments.
ankitaj224 Sep 13, 2019
3932d3b
Fixing check-changed - GoogleJavaFormat error.
ankitaj224 Sep 16, 2019
8d4d811
Addressing ciaran`s comments
ankitaj224 Sep 16, 2019
3f44b77
nit fixes to executor : use unblocking queue.
ankitaj224 Sep 16, 2019
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
4 changes: 2 additions & 2 deletions firebase-installations-interop/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ package com.google.firebase.installations {
ctor public InstallationTokenResult();
method @NonNull public static com.google.firebase.installations.InstallationTokenResult.Builder builder();
method @NonNull public abstract String getToken();
method @NonNull public abstract long getTokenExpirationTimestampMillis();
method @NonNull public abstract long getTokenExpirationInSecs();
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder toBuilder();
}

public abstract static class InstallationTokenResult.Builder {
ctor public InstallationTokenResult.Builder();
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult build();
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder setToken(@NonNull String);
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder setTokenExpirationTimestampMillis(@NonNull long);
method @NonNull public abstract com.google.firebase.installations.InstallationTokenResult.Builder setTokenExpirationInSecs(long);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

package com.google.firebase.installations;

import static java.lang.annotation.RetentionPolicy.SOURCE;

import androidx.annotation.IntDef;
import com.google.android.gms.tasks.Task;
import java.lang.annotation.Retention;

/**
* This is an interface of {@code FirebaseInstallations} that is only exposed to 2p via component
Expand All @@ -24,14 +28,29 @@
*/
public interface FirebaseInstallationsApi {

/** Specifies the options to get a FIS AuthToken. */
@IntDef({DO_NOT_FORCE_REFRESH, FORCE_REFRESH})
@Retention(SOURCE)
@interface AuthTokenOption {}
/**
* AuthToken is not refreshed until requested by the developer or if one doesn't exist, is expired
* or about to expire.
*/
int DO_NOT_FORCE_REFRESH = 0;
/**
* AuthToken is forcefully refreshed on calling the {@link
* FirebaseInstallationsApi#getAuthToken(int)}.
*/
int FORCE_REFRESH = 1;

/**
* Async function that returns a globally unique identifier of this Firebase app installation.
* This is a url-safe base64 string of a 128-bit integer.
*/
Task<String> getId();

/** Async function that returns a auth token(public key) of this Firebase app installation. */
Task<InstallationTokenResult> getAuthToken(boolean forceRefresh);
Task<InstallationTokenResult> getAuthToken(@AuthTokenOption int authTokenOption);

/**
* Async function that deletes this Firebase app installation from Firebase backend. This call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ public abstract class InstallationTokenResult {
@NonNull
public abstract String getToken();
/**
* The amount of time, in milliseconds, before the auth-token expires for this Firebase
* Installation.
* The amount of time, in seconds, before the auth-token expires for this Firebase Installation.
*/
@NonNull
public abstract long getTokenExpirationTimestampMillis();
public abstract long getTokenExpirationInSecs();

@NonNull
public abstract Builder toBuilder();
Expand All @@ -46,7 +45,7 @@ public abstract static class Builder {
public abstract Builder setToken(@NonNull String value);

@NonNull
public abstract Builder setTokenExpirationTimestampMillis(@NonNull long value);
public abstract Builder setTokenExpirationInSecs(long value);

@NonNull
public abstract InstallationTokenResult build();
Expand Down
2 changes: 1 addition & 1 deletion firebase-installations/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.google.firebase.installations {

public class FirebaseInstallations {
method @NonNull public Task<Void> delete();
method @NonNull public Task<InstallationTokenResult> getAuthToken(boolean);
method @NonNull public Task<InstallationTokenResult> getAuthToken(int);
method @NonNull public Task<String> getId();
method @NonNull public static com.google.firebase.installations.FirebaseInstallations getInstance();
method @NonNull public static com.google.firebase.installations.FirebaseInstallations getInstance(@NonNull FirebaseApp);
Expand Down
Loading