-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Encrypt device info on auth flows (#2948)
<!-- Note: This checklist is a reminder of our shared engineering expectations. The items in Bold are required If your PR involves UI changes: 1. Upload screenshots or screencasts that illustrate the changes before / after 2. Add them under the UI changes section (feel free to add more columns if needed) 3. Make sure these changes are tested in API 23 and API 26 If your PR does not involve UI changes, you can remove the **UI changes** section --> Task/Issue URL: https://app.asana.com/0/1201493110486074/1203835825731590/f ### Description Encrypts device info (name and type) on all auth flows. Also changes QR format to follow b64 encoding ### Steps to test this PR (you will need 2 devices to test some of the auth flows) _create account and login_ - [x] install app on device A and device B - [x] device A(unauthenticated): go to settings -> sync -> create account - [x] device A(authenticated): show QR code - [x] device B(unauthenticated): go to settings -> sync - [x] device B: read QR code - [x] device B: scan QR code from device A - [x] device B(authenticated): ensure login success _connect_ (device B should have a camera) - [x] install app on device A and device B (both need to be unauthenticated, go to settings -> sync -> reset button) - [x] device A(unauthenticated): go to settings -> sync - [x] device A: click on "connect (show QR)" (it will start polling data) - [x] device B(unauthenticated, with camera!): go to settings -> sync - [x] device B: click on "connect (read QR)" - [x] device B: scan QR code from device A - [x] device B(authenticated): ensure an account is created (account data will appear at the top) - [x] device A: ensure it joins the same account (can take 7 seconds) (account data will appear at the top)
- Loading branch information
1 parent
43a7e05
commit eb5b05e
Showing
10 changed files
with
228 additions
and
79 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
sync/sync-impl/src/main/java/com/duckduckgo/sync/impl/EncodingExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2023 DuckDuckGo | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.duckduckgo.sync.impl | ||
|
||
import android.util.Base64 | ||
|
||
internal fun String.encodeB64(): String { | ||
return Base64.encodeToString(this.toByteArray(), Base64.DEFAULT) | ||
} | ||
|
||
internal fun String.decodeB64(): String { | ||
return String(Base64.decode(this, Base64.DEFAULT)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.