-
Notifications
You must be signed in to change notification settings - Fork 98
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
Jimin/dev5 key #1123
Jimin/dev5 key #1123
Conversation
…into jimin/dev5_key
…into jimin/dev5_key
...zure/android/communication/chat/implementation/notifications/fcm/PushNotificationClient.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/PushNotificationClient.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/PushNotificationClient.java
Outdated
Show resolved
Hide resolved
...e/android/communication/chat/implementation/notifications/fcm/RegistrationRenewalWorker.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/PushNotificationClient.java
Show resolved
Hide resolved
.../azure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyStore.java
Outdated
Show resolved
Hide resolved
.../azure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyStore.java
Outdated
Show resolved
Hide resolved
.../azure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyStore.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments in general and a couple about the use of KeyStore
.
.../azure/android/communication/chat/implementation/notifications/fcm/KeyCreationTimeStore.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Show resolved
Hide resolved
|
||
private boolean lastExecutionSucceeded = true; | ||
|
||
//The duration we persist keys in key-store | ||
public static final int EXPIRATION_TIME_MINUTES = 45; | ||
public static final int EXPIRATION_TIME_MINUTES = 25; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember the previous expiry time was 45, was this changed on the server side as well or is there a particular reason it got client-side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I'm opposed to rotating keys earlier, I was simply curious.
@@ -56,6 +82,10 @@ public static RegistrationKeyManager instance() { | |||
return registrationKeyManager; | |||
} | |||
|
|||
private char[] getKeyStorePassword() { | |||
return "com.azure.android.communication.chat.android".toCharArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using a hard-coded value as a password? Is this standard practice for KeyStore
? I would be very surprised if that's the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The password field is actually optional. I am adding it here to slightly increase the difficulty of hack the system. Having a password that keeps changing is challenging to implement. Which way do you suggest? 1. Adding some transform function to make this password complex 2. Skipping the password 3. Alternative ways that I am not aware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on offline discussion. The password field will be empty/null. I am investigating changing keystore type from default "AES" to "AndroidKeyStore"
Log.i("RenewRegistration", "crypto alias: " + crypAlias + ", crypto string: " + crypStr + ", time: " + timeDiff); | ||
Log.i("RenewRegistration", "auth alias: " + auAlias + ", auth string: " + aKeyStr + ", time: " + timeDiff); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to log using ClientLogger
. Maybe this was left off from manual testing?
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a suggestion for the new exception added for when the push notification configuration is incorrect.
|
||
public RegistrationRenewalWorker(@NonNull Context context, @NonNull WorkerParameters workerParameters) { | ||
super(context, workerParameters); | ||
throw new RuntimeException("Missing worker manager configurations. Please follow quick-start guidance to properly set it up: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-android"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw new RuntimeException("Missing worker manager configurations. Please follow quick-start guidance to properly set it up: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-android"); | |
throw clientLogger.logExceptionAsError(new RuntimeException("Missing worker manager configuration for enabling push notifications. Please follow quick-start guidance to properly set it up: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-android")); |
.../com/azure/android/communication/chat/implementation/notifications/fcm/KeyMetaDataStore.java
Outdated
Show resolved
Hide resolved
.../com/azure/android/communication/chat/implementation/notifications/fcm/KeyMetaDataStore.java
Outdated
Show resolved
Hide resolved
.../com/azure/android/communication/chat/implementation/notifications/fcm/KeyMetaDataStore.java
Outdated
Show resolved
Hide resolved
.../com/azure/android/communication/chat/implementation/notifications/fcm/KeyMetaDataStore.java
Outdated
Show resolved
Hide resolved
...e/android/communication/chat/implementation/notifications/fcm/RegistrationRenewalWorker.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Outdated
Show resolved
Hide resolved
...zure/android/communication/chat/implementation/notifications/fcm/RegistrationKeyManager.java
Show resolved
Hide resolved
/check-enforer evaluate |
/check-enforcer override. |
/check-enforcer override |
task:
Related PR: #1097
This PR tries to
More specific changes:
Gradle: inject worker related dependency
For Contoso. Configuration changes are required to use the WorkerManager.