Skip to content

Commit

Permalink
[BITAU-118] [BITAU-159] Setup New Shared App Group Entitlements and F…
Browse files Browse the repository at this point in the history
…eature Flag (#910)
  • Loading branch information
brant-livefront committed Sep 10, 2024
1 parent 1cd82f5 commit 0b73095
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions Bitwarden/Application/Support/Bitwarden.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<key>com.apple.security.application-groups</key>
<array>
<string>group.$(BASE_BUNDLE_ID)</string>
<string>$(SHARED_APP_GROUP_IDENTIFIER)</string>
</array>
<key>keychain-access-groups</key>
<array>
Expand Down
2 changes: 2 additions & 0 deletions Bitwarden/Application/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,7 @@
</array>
<key>XSAppIconAssets</key>
<string>Resources/Assets.xcassets/AppIcons.appiconset</string>
<key>BitwardenAuthenticatorSharedAppGroup</key>
<string>${SHARED_APP_GROUP_IDENTIFIER}</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ extension Bundle {
var keychainAccessGroup: String {
infoDictionary?["BitwardenKeychainAccessGroup"] as? String ?? appIdentifier
}

/// Return's the shared app group identifier. This App Group is shared between the
/// main Bitwarden app and the Authenticator app.
var sharedAppGroupIdentifier: String {
infoDictionary?["BitwardenAuthenticatorSharedAppGroup"] as? String ?? groupIdentifier
}
}
6 changes: 5 additions & 1 deletion BitwardenShared/Core/Platform/Models/Enum/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import Foundation
/// An enum to represent a feature flag sent by the server
///
enum FeatureFlag: String, Codable {
/// Flag to enable/disable the ability to sync TOTP codes with the Authenticator app.
case authenticatorSyncEnabled = "authenticator-sync-enabled"

/// Flag to enable/disable email verification during registration
/// This flag introduces a new flow for account creation
case emailVerification = "email-verification"
Expand All @@ -28,7 +31,8 @@ enum FeatureFlag: String, Codable {
/// Whether this feature can be enabled remotely.
var isRemotelyConfigured: Bool {
switch self {
case .nativeCarouselFlow,
case .authenticatorSyncEnabled,
.nativeCarouselFlow,
.nativeCreateAccountFlow,
.testLocalFeatureFlag:
false
Expand Down
2 changes: 2 additions & 0 deletions Configs/Common.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CODE_SIGN_STYLE = Automatic
DEVELOPMENT_TEAM = LTZ2PFU5D6
ORGANIZATION_IDENTIFIER = com.8bit
SHARED_APP_GROUP_IDENTIFIER = group.com.bitwarden.bitwarden-authenticator
BASE_BUNDLE_ID = $(ORGANIZATION_IDENTIFIER).bitwarden
APPICON_NAME = AppIcon

Expand All @@ -11,6 +12,7 @@ APPICON_NAME = AppIcon
//
// DEVELOPMENT_TEAM = <Your team ID>
// ORGANIZATION_IDENTIFIER = <Your reversed domain name>
// SHARED_APP_GROUP_IDENTIFIER = <Group identifier for your reversed domain name>
// BASE_BUNDLE_ID = <Your bundle ID>
// APPICON_NAME = <Your App Icon's Name in the asset catalogue>
// PROVISIONING_PROFILE_SPECIFIER = <Optional provisioning profile specifier for the main app>
Expand Down
3 changes: 3 additions & 0 deletions Scripts/select_variant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ export_options_file="Configs/export_options.plist"
case $variant in
Production)
ios_bundle_id='com.8bit.bitwarden'
shared_app_group_id='group.com.bitwarden.bitwarden-authenticator'
profile_prefix="Dist:"
app_icon="AppIcon"
;;
Beta)
ios_bundle_id='com.8bit.bitwarden.beta'
shared_app_group_id='group.com.bitwarden.bitwarden-authenticator.beta'
profile_prefix="Dist: Beta"
app_icon="AppIcon-Beta"
;;
Expand All @@ -43,6 +45,7 @@ CODE_SIGN_IDENTITY = Apple Distribution
DEVELOPMENT_TEAM = LTZ2PFU5D6
ORGANIZATION_IDENTIFIER = com.8bit
BASE_BUNDLE_ID = ${ios_bundle_id}
SHARED_APP_GROUP_IDENTIFIER = ${shared_app_group_id}
APPICON_NAME = ${app_icon}
PROVISIONING_PROFILE_SPECIFIER = ${profile_prefix} Bitwarden
PROVISIONING_PROFILE_SPECIFIER_ACTION_EXTENSION = ${profile_prefix} Extension
Expand Down

0 comments on commit 0b73095

Please sign in to comment.