Skip to content
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

[Gekidou] Get all existing server credentials on init #5468

Merged
merged 4 commits into from
Jun 21, 2021

Conversation

migbot
Copy link
Contributor

@migbot migbot commented Jun 18, 2021

Summary

Gets all existing server credentials on init for use with initializing the DatabaseManager and the NetworkClientManager. The keychain library on the iOS side needed patching to support extracting all server URLs from internet credential entries.

Release Note

NONE

@migbot migbot added the 2: Dev Review Requires review by a core commiter label Jun 18, 2021
app/init/credentials.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just not sure why Podfile.lock updated

@@ -106,7 +149,7 @@ export const getServerCredentials = async (serverUrl: string): Promise<ServerCre

// TODO: Create client and set token / CSRF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do in the PR that brings in the network lib

- libwebp/mux (= 1.1.0)
- libwebp/webp (= 1.1.0)
- libwebp/demux (1.1.0):
- libwebp (1.2.0):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this changing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure :/

diff --git a/node_modules/react-native-keychain/RNKeychainManager/RNKeychainManager.m b/node_modules/react-native-keychain/RNKeychainManager/RNKeychainManager.m
index 38ccdf3..2875032 100644
--- a/node_modules/react-native-keychain/RNKeychainManager/RNKeychainManager.m
+++ b/node_modules/react-native-keychain/RNKeychainManager/RNKeychainManager.m
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to submit this patch upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, just gotta fix the patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@migbot migbot requested a review from enahum June 18, 2021 22:44
@@ -4,16 +4,56 @@
import {Platform} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When sorting imports, the @react-native-community/async-storage should be treated as the character a and sorted amongst the first modules.

Copy link
Contributor

@avinashlng1080 avinashlng1080 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


setServerCredentials(serverUrl, credentials!.userId, credentials!.token);

const normalizedServerUrl = normalizeServerUrl(serverUrl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having my doubts about normalizing.. let's chat about this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed normalization. We're now OK with the the server URL containing the protocol in both the keychain and in the db. If we want to match against a deeplink URL, we can always use a LIKE query or replace the deeplink protocol prior to querying.

@migbot migbot changed the title Get all existing server credentials on init [Gekidou] Get all existing server credentials on init Jun 21, 2021
@enahum enahum added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Jun 21, 2021
@migbot migbot merged commit 3b9fd5c into gekidou Jun 21, 2021
@migbot migbot deleted the gekidou-init-credentials branch June 21, 2021 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants