Skip to content

Commit 5728580

Browse files
FIS API docs: use term "installation auth token" consistently. (#6014)
* FIS API docs: use term "Installation auth token" consistently. * Changelog * Capitalize * Use lowercase * SHA1 usage explanation * missed upper case * a -> an
1 parent 885b07b commit 5728580

File tree

9 files changed

+27
-19
lines changed

9 files changed

+27
-19
lines changed

FirebaseAppDistribution/Sources/FIRFADApiService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ FOUNDATION_EXPORT NSString *const kFIRFADApiErrorDomain;
5656
// Fetch releases from the AppDistribution Tester API
5757
+ (void)fetchReleasesWithCompletion:(FIRFADFetchReleasesCompletion)completion;
5858

59-
// Generate a Installation Auth Token and fetch the installation id
59+
// Generate an installation auth token and fetch the installation id
6060
+ (void)generateAuthTokenWithCompletion:(FIRFADGenerateAuthTokenCompletion)completion;
6161

6262
@end

FirebaseAppDistribution/Sources/FIRFADApiService.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ + (void)generateAuthTokenWithCompletion:(FIRFADGenerateAuthTokenCompletion)compl
3939
FIRInstallationsAuthTokenResult *_Nullable authTokenResult,
4040
NSError *_Nullable error) {
4141
if ([self handleError:&error
42-
description:@"Failed to generate Firebase Installation Auth Token."
42+
description:@"Failed to generate Firebase installation auth token."
4343
code:FIRFADApiTokenGenerationFailure]) {
4444
FIRFADErrorLog(@"Error getting fresh auth tokens. Error: %@", [error localizedDescription]);
4545

FirebaseInstallations/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [changed] Removed the `FIR` prefix from `FIRInstallationIDDidChange` and renamed
88
`kFIRInstallationIDDidChangeNotificationAppNameKey` to `InstallationIDDidChangeAppNameKey`
99
in Swift.
10+
- [changed] API docs updated to use term "installation auth token" consistently. (#6014)
1011

1112
# v1.7.1 -- M81
1213
- [changed] Additional `FIRInstallationsItem` validation to catch potential storage issues. (#6570)

FirebaseInstallations/Source/Library/IIDMigration/FIRInstallationsIIDStore.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ - (NSString *)IIDWithPublicKeyData:(NSData *)publicKeyData {
8383
return [self base64URLEncodedStringWithData:data];
8484
}
8585

86+
/** FirebaseInstallations SDK uses the SHA1 hash for backwards compatibility with the legacy
87+
* FirebaseInstanceID SDK. The SHA1 hash is used to access Instance IDs stored on the device and not
88+
* for any security-relevant process. This is a one-time step that allows migration of old client
89+
* identifiers. Cryptographic security is not needed here, so potential hash collisions are not a
90+
* problem.
91+
*/
8692
- (NSData *)sha1WithData:(NSData *)data {
8793
unsigned char output[CC_SHA1_DIGEST_LENGTH];
8894
unsigned int length = (unsigned int)[data length];

FirebaseInstallations/Source/Library/InstallationsAPI/FIRInstallationsItem+RegisterInstallationAPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
2626
* Parses and validates the Register Installation API response and returns a corresponding
2727
* `FIRInstallationsItem` instance on success.
2828
* @param JSONData The data with JSON encoded API response.
29-
* @param date The Auth Token expiration date will be calculated as `date` +
29+
* @param date The installation auth token expiration date will be calculated as `date` +
3030
* `response.authToken.expiresIn`. For most of the cases `[NSDate date]` should be passed there. A
3131
* different value may be passed e.g. for unit tests.
3232
* @param outError A pointer to assign a specific `NSError` instance in case of failure. No error is

FirebaseInstallations/Source/Library/InstallationsStore/FIRInstallationsStoredAuthToken.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ typedef NS_ENUM(NSInteger, FIRInstallationsAuthTokenStatus) {
4545
@interface FIRInstallationsStoredAuthToken : NSObject <NSSecureCoding, NSCopying>
4646
@property FIRInstallationsAuthTokenStatus status;
4747

48-
/// The token that can be used to authorize requests to Firebase backend.
48+
/// The installation auth token string that can be used to authorize requests to Firebase backend.
4949
@property(nullable, copy) NSString *token;
50-
/// The date when the auth token expires.
50+
/// The installation auth token expiration date.
5151
@property(nullable, copy) NSDate *expirationDate;
5252

5353
/// The version of local storage.

FirebaseInstallations/Source/Library/InstallationsStore/FIRInstallationsStoredItem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
3535

3636
/// A stable identifier that uniquely identifies the app instance.
3737
@property(nonatomic, copy, nullable) NSString *firebaseInstallationID;
38-
/// The `refreshToken` is used to authorize the auth token requests.
38+
/// The `refreshToken` is used to authorize the installation auth token requests.
3939
@property(nonatomic, copy, nullable) NSString *refreshToken;
4040

4141
@property(nonatomic, nullable) FIRInstallationsStoredAuthToken *authToken;

FirebaseInstallations/Source/Library/Public/FirebaseInstallations/FIRInstallations.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,24 @@ NS_SWIFT_NAME(Installations)
8585
- (void)installationIDWithCompletion:(FIRInstallationsIDHandler)completion;
8686

8787
/**
88-
* Retrieves (locally if it exists or from the server) a valid authorization token. An existing
89-
* token may be invalidated or expired, so it is recommended to fetch the auth token before each
90-
* server request. The method does the same as `Installations.authTokenForcingRefresh(:,
88+
* Retrieves (locally if it exists or from the server) a valid installation auth token. An existing
89+
* token may be invalidated or expired, so it is recommended to fetch the installation auth token
90+
* before each server request. The method does the same as `Installations.authTokenForcingRefresh(:,
9191
* completion:)` with forcing refresh `NO`.
9292
* @param completion A completion handler which is invoked when the operation completes. See
9393
* `InstallationsTokenHandler` for additional details.
9494
*/
9595
- (void)authTokenWithCompletion:(FIRInstallationsTokenHandler)completion;
9696

9797
/**
98-
* Retrieves (locally or from the server depending on `forceRefresh` value) a valid authorization
99-
* token. An existing token may be invalidated or expire, so it is recommended to fetch the auth
100-
* token before each server request. This method should be used with `forceRefresh == YES` when e.g.
101-
* a request with the previously fetched auth token failed with "Not Authorized" error.
102-
* @param forceRefresh If `YES` then the locally cached auth token will be ignored and a new one
103-
* will be requested from the server. If `NO`, then the locally cached auth token will be returned
104-
* if exists and has not expired yet.
98+
* Retrieves (locally or from the server depending on `forceRefresh` value) a valid installation
99+
* auth token. An existing token may be invalidated or expire, so it is recommended to fetch the
100+
* installation auth token before each server request. This method should be used with `forceRefresh
101+
* == YES` when e.g. a request with the previously fetched installation auth token failed with "Not
102+
* Authorized" error.
103+
* @param forceRefresh If `YES` then the locally cached installation auth token will be ignored and
104+
* a new one will be requested from the server. If `NO`, then the locally cached installation auth
105+
* token will be returned if exists and has not expired yet.
105106
* @param completion A completion handler which is invoked when the operation completes. See
106107
* `InstallationsTokenHandler` for additional details.
107108
*/

FirebaseInstallations/Source/Library/Public/FirebaseInstallations/FIRInstallationsAuthTokenResult.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818

1919
NS_ASSUME_NONNULL_BEGIN
2020

21-
/** The class represents a result of the auth token request. */
21+
/** The class represents a result of the installation auth token request. */
2222
NS_SWIFT_NAME(InstallationsAuthTokenResult)
2323
@interface FIRInstallationsAuthTokenResult : NSObject
2424

25-
/** The authorization token string. */
25+
/** The installation auth token string. */
2626
@property(nonatomic, readonly) NSString *authToken;
2727

28-
/** The auth token expiration date. */
28+
/** The installation auth token expiration date. */
2929
@property(nonatomic, readonly) NSDate *expirationDate;
3030

3131
@end

0 commit comments

Comments
 (0)