-
Notifications
You must be signed in to change notification settings - Fork 263
Add Signal API implementation (RP Side) #175
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @neelanshsahai, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the Credential Manager Signal API into the application, significantly enhancing its ability to manage and communicate credential states with the Android system. It introduces new user-facing features for updating profile information and more granular control over passkey management, aiming to provide a more robust and user-friendly authentication experience. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces the Signal API from the Credential Manager, which is a great addition. The implementation is mostly well-done, but there are several critical issues that need to be addressed, primarily unresolved merge conflicts in multiple files. Additionally, I've found a duplicated UI element, potential null-handling issues when constructing JSON objects, and a confusing variable name. Once these issues are resolved, the pull request will be in good shape.
Shrine/app/src/main/java/com/authentication/shrine/repository/AuthRepository.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/ui/PasskeyManagementScreen.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/ui/PasskeyManagementScreen.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/ui/common/ShrineTextField.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/ui/AuthenticationScreen.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/CredentialManagerUtils.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/CredentialManagerUtils.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/CredentialManagerUtils.kt
Outdated
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/ui/UpdateProfileScreen.kt
Outdated
Show resolved
Hide resolved
/gemini review |
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.
Code Review
This pull request implements the Credential Manager Signal API, which includes signaling unknown, accepted, and updated user credentials. It also adds a new screen for updating user profiles and refactors some UI components.
My review focuses on improving code maintainability by reducing duplication, enhancing clarity by using appropriate variable names, and correcting the state management in the new UpdateProfileViewModel
to ensure the UI behaves as expected. Overall, the implementation of the Signal API is well done, but there are opportunities for refinement in the new UI and ViewModel code.
Shrine/app/src/main/java/com/authentication/shrine/CredentialManagerUtils.kt
Show resolved
Hide resolved
Shrine/app/src/main/java/com/authentication/shrine/ui/UpdateProfileScreen.kt
Outdated
Show resolved
Hide resolved
private val _uiState = MutableStateFlow(UpdateProfileState()) | ||
val uiState = _uiState.asStateFlow() | ||
|
||
init { | ||
viewModelScope.launch { | ||
_uiState.update { | ||
UpdateProfileState( | ||
userId = dataStore.read(USER_ID_KEY) ?: "", | ||
rpId = dataStore.read(RP_ID_KEY) ?: "", | ||
credentialId = dataStore.read(CRED_ID) ?: "", | ||
) | ||
} | ||
} | ||
} |
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 _uiState
is initialized and populated in the init
block, but it's never collected or used by the UpdateProfileScreen
. The screen uses its own local state, which starts empty. This means the user has to re-enter their information instead of editing it.
The ViewModel should expose the current username
and displayName
(e.g., by fetching them from AuthRepository
), and the UpdateProfileScreen
should collect this state to pre-populate the text fields. The current implementation of UpdateProfileState
and the init
block seems to be unused.
0f73254
to
203298f
Compare
Can we have a better title? It's unclear from the current one what this PR is supposed to be doing |
No description provided.