Skip to content

Commit f9044cc

Browse files
committed
Merge branch 'main' into cmcg/pm-13428-remove-ownership-option
# Conflicts: # BitwardenShared/UI/Vault/VaultItem/AddEditItem/__Snapshots__/AddEditItemViewTests/test_snapshot_add_identity_full_fieldsFilled_largeText.1.png # BitwardenShared/UI/Vault/VaultItem/CipherItemState.swift
2 parents c3168a4 + 956e05d commit f9044cc

File tree

799 files changed

+11101
-4600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

799 files changed

+11101
-4600
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
66

77
# Default file owners.
8-
* @bitwarden/team-ios @matt-livefront @phil-livefront @brant-livefront @ezimet-livefront
8+
* @bitwarden/team-ios @matt-livefront
99

1010
# Actions and workflow changes.
1111
.github/ @bitwarden/dept-development-mobile

.github/images/ios-dark.png

265 KB
Loading

.github/images/ios-light.png

264 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Cron / Update public suffix list
2+
on:
3+
schedule:
4+
# Run weekly on Monday at 00:00 UTC
5+
- cron: '0 0 * * 1'
6+
workflow_dispatch:
7+
8+
env:
9+
SOURCE_URL: https://publicsuffix.org/list/public_suffix_list.dat
10+
PSL_FILE: BitwardenKit/Core/Platform/Utilities/Resources/public_suffix_list.dat
11+
12+
jobs:
13+
update-psl:
14+
name: Update Public Suffix List
15+
runs-on: ubuntu-24.04
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
23+
24+
- name: Download latest PSL list
25+
run: |
26+
curl -s $SOURCE_URL -o $PSL_FILE
27+
28+
- name: Check for changes
29+
id: check-changes
30+
run: |
31+
if git diff --quiet -- $PSL_FILE; then
32+
echo "✅ No changes detected, skipping..."
33+
echo "has_changes=false" >> $GITHUB_OUTPUT
34+
exit 0
35+
fi
36+
37+
echo "has_changes=true" >> $GITHUB_OUTPUT
38+
echo "👀 Changes detected"
39+
40+
- name: Create branch and commit
41+
if: steps.check-changes.outputs.has_changes == 'true'
42+
run: |
43+
echo "📋 Committing public_suffix_list.dat..."
44+
45+
BRANCH_NAME="cron-sync-public-suffix-list/$GITHUB_RUN_NUMBER-sync"
46+
git config user.name "GitHub Actions Bot"
47+
git config user.email "actions@github.com"
48+
git checkout -b $BRANCH_NAME
49+
git add $PSL_FILE
50+
git commit -m "Update public suffix list"
51+
git push origin $BRANCH_NAME
52+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
53+
echo "🌱 Branch created: $BRANCH_NAME"
54+
55+
- name: Create Pull Request
56+
if: steps.check-changes.outputs.has_changes == 'true'
57+
env:
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
DUPLICATES_FOUND: ${{ steps.check-changes.outputs.duplicates_found }}
60+
BASE_PR_URL: ${{ github.server_url }}/${{ github.repository }}/pull/
61+
run: |
62+
PR_BODY="Updates the public suffix list with the latest data from $SOURCE_URL"
63+
64+
# Use echo -e to interpret escape sequences and pipe to gh pr create
65+
PR_URL=$(echo -e "$PR_BODY" | gh pr create \
66+
--title "Update public suffix list" \
67+
--body-file - \
68+
--base main \
69+
--head $BRANCH_NAME \
70+
--label "automated-pr" \
71+
--label "t:ci")

Authenticator/Application/Services/ErrorReporter/CrashlyticsErrorReporter.swift

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import AuthenticatorShared
2+
import BitwardenKit
23
import FirebaseCore
34
import FirebaseCrashlytics
45

@@ -30,4 +31,18 @@ final class CrashlyticsErrorReporter: ErrorReporter {
3031

3132
Crashlytics.crashlytics().record(error: error)
3233
}
34+
35+
func setRegion(_ region: String, isPreAuth: Bool) {
36+
guard isEnabled else {
37+
return
38+
}
39+
Crashlytics.crashlytics().setCustomValue(region, forKey: isPreAuth ? "PreAuthRegion" : "Region")
40+
}
41+
42+
func setUserId(_ userId: String?) {
43+
guard isEnabled else {
44+
return
45+
}
46+
Crashlytics.crashlytics().setUserID(userId)
47+
}
3348
}

Authenticator/Application/Support/Settings.bundle/Acknowledgements.plist

+16
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@
114114
<key>Type</key>
115115
<string>PSChildPaneSpecifier</string>
116116
</dict>
117+
<dict>
118+
<key>File</key>
119+
<string>Acknowledgements/swift-custom-dump</string>
120+
<key>Title</key>
121+
<string>swift-custom-dump</string>
122+
<key>Type</key>
123+
<string>PSChildPaneSpecifier</string>
124+
</dict>
117125
<dict>
118126
<key>File</key>
119127
<string>Acknowledgements/swift-protobuf</string>
@@ -186,6 +194,14 @@
186194
<key>Type</key>
187195
<string>PSChildPaneSpecifier</string>
188196
</dict>
197+
<dict>
198+
<key>File</key>
199+
<string>Acknowledgements/xctest-dynamic-overlay</string>
200+
<key>Title</key>
201+
<string>xctest-dynamic-overlay</string>
202+
<key>Type</key>
203+
<string>PSChildPaneSpecifier</string>
204+
</dict>
189205
</array>
190206
</dict>
191207
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreferenceSpecifiers</key>
6+
<array>
7+
<dict>
8+
<key>FooterText</key>
9+
<string>MIT License
10+
11+
Copyright (c) 2021 Point-Free, Inc.
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a copy
14+
of this software and associated documentation files (the "Software"), to deal
15+
in the Software without restriction, including without limitation the rights
16+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17+
copies of the Software, and to permit persons to whom the Software is
18+
furnished to do so, subject to the following conditions:
19+
20+
The above copyright notice and this permission notice shall be included in all
21+
copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29+
SOFTWARE.
30+
</string>
31+
<key>License</key>
32+
<string>MIT</string>
33+
<key>Type</key>
34+
<string>PSGroupSpecifier</string>
35+
</dict>
36+
</array>
37+
</dict>
38+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreferenceSpecifiers</key>
6+
<array>
7+
<dict>
8+
<key>FooterText</key>
9+
<string>MIT License
10+
11+
Copyright (c) 2021 Point-Free, Inc.
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a copy
14+
of this software and associated documentation files (the "Software"), to deal
15+
in the Software without restriction, including without limitation the rights
16+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17+
copies of the Software, and to permit persons to whom the Software is
18+
furnished to do so, subject to the following conditions:
19+
20+
The above copyright notice and this permission notice shall be included in all
21+
copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29+
SOFTWARE.
30+
</string>
31+
<key>License</key>
32+
<string>MIT</string>
33+
<key>Type</key>
34+
<string>PSGroupSpecifier</string>
35+
</dict>
36+
</array>
37+
</dict>
38+
</plist>

AuthenticatorBridgeKit/AuthenticatorBridgeDataStore.swift

+24-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BitwardenKit
12
import CoreData
23

34
// MARK: - AuthenticatorStoreType
@@ -15,9 +16,29 @@ public enum AuthenticatorBridgeStoreType {
1516

1617
// MARK: - AuthenticatorDataStore
1718

19+
/// The CoreData model name used within `AuthenticatorBridgeDataStore`.
20+
private let authenticatorBridgeModelName = "Bitwarden-Authenticator"
21+
1822
/// A data store that manages persisting data across app launches in Core Data.
1923
///
2024
public class AuthenticatorBridgeDataStore {
25+
// MARK: Type Properties
26+
27+
/// The managed object model representing the entities in the database schema. CoreData throws
28+
/// warnings if this is instantiated multiple times (e.g. in tests), which is fixed by making
29+
/// it static.
30+
private static let managedObjectModel: NSManagedObjectModel = {
31+
#if SWIFT_PACKAGE
32+
let bundle = Bundle.module
33+
#else
34+
let bundle = Bundle(for: AuthenticatorBridgeDataStore.self)
35+
#endif
36+
37+
let modelURL = bundle.url(forResource: authenticatorBridgeModelName, withExtension: "momd")!
38+
let managedObjectModel = NSManagedObjectModel(contentsOf: modelURL)!
39+
return managedObjectModel
40+
}()
41+
2142
// MARK: Properties
2243

2344
/// A managed object context which executes on a background queue.
@@ -30,9 +51,6 @@ public class AuthenticatorBridgeDataStore {
3051
/// The service used by the application to report non-fatal errors.
3152
let errorReporter: ErrorReporter
3253

33-
/// The CoreData model name.
34-
private let modelName = "Bitwarden-Authenticator"
35-
3654
/// The Core Data persistent container.
3755
public let persistentContainer: NSPersistentContainer
3856

@@ -52,17 +70,9 @@ public class AuthenticatorBridgeDataStore {
5270
) {
5371
self.errorReporter = errorReporter
5472

55-
#if SWIFT_PACKAGE
56-
let bundle = Bundle.module
57-
#else
58-
let bundle = Bundle(for: type(of: self))
59-
#endif
60-
61-
let modelURL = bundle.url(forResource: modelName, withExtension: "momd")!
62-
let managedObjectModel = NSManagedObjectModel(contentsOf: modelURL)!
6373
persistentContainer = NSPersistentContainer(
64-
name: modelName,
65-
managedObjectModel: managedObjectModel
74+
name: authenticatorBridgeModelName,
75+
managedObjectModel: Self.managedObjectModel
6676
)
6777
let storeDescription: NSPersistentStoreDescription
6878
switch storeType {
@@ -71,7 +81,7 @@ public class AuthenticatorBridgeDataStore {
7181
case .persisted:
7282
let storeURL = FileManager.default
7383
.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)!
74-
.appendingPathComponent("\(modelName).sqlite")
84+
.appendingPathComponent("\(authenticatorBridgeModelName).sqlite")
7585
storeDescription = NSPersistentStoreDescription(url: storeURL)
7686
}
7787
persistentContainer.persistentStoreDescriptions = [storeDescription]

AuthenticatorBridgeKit/ErrorReporter.swift

-16
This file was deleted.

AuthenticatorBridgeKit/Tests/AuthenticatorBridgeItemDataTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import BitwardenKit
2+
import BitwardenKitMocks
13
import Foundation
24
import XCTest
35

AuthenticatorBridgeKit/Tests/AuthenticatorBridgeItemServiceTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import BitwardenKit
2+
import BitwardenKitMocks
13
import Foundation
24
import XCTest
35

AuthenticatorBridgeKit/Tests/TestHelpers/MockErrorReporter.swift

-20
This file was deleted.

AuthenticatorShared/Core/Auth/Models/Response/ErrorResponseModel.swift

-36
This file was deleted.

AuthenticatorShared/Core/Auth/Models/Response/ErrorResponseModelTests.swift

-23
This file was deleted.

0 commit comments

Comments
 (0)