@oxy.so/services 9.2.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/android/src/main/AndroidManifest.xml +6 -6
- package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionModule.kt +106 -41
- package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionProvider.kt +45 -32
- package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionStore.kt +22 -27
- package/android/src/main/java/so/oxy/identity/OxyIdentityModule.kt +89 -43
- package/android/src/main/java/so/oxy/security/OxyCallerPolicy.kt +97 -0
- package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +4 -10
- package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +17 -18
- package/ios/OxyIdentityModule.swift +13 -14
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +2 -2
- package/lib/commonjs/ui/components/BenefitList.js +1 -1
- package/lib/commonjs/ui/components/BenefitList.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +2 -2
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FollowTargetButton.js +2 -2
- package/lib/commonjs/ui/components/FollowTargetButton.js.map +1 -1
- package/lib/commonjs/ui/components/PeableButton.js +1 -2
- package/lib/commonjs/ui/components/PeableButton.js.map +1 -1
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js +1 -1
- package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -1
- package/lib/commonjs/ui/components/SurfaceScreen.js +1 -1
- package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +1 -1
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js +1 -1
- package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js +1 -1
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js +2 -2
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +2 -1
- package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +4 -4
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DomainsScreen.js +1 -1
- package/lib/commonjs/ui/screens/DomainsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -2
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +5 -5
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/NotificationsScreen.js +8 -8
- package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PreferencesScreen.js +2 -2
- package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +37 -37
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +5 -5
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +11 -11
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +1 -1
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/session/tokenLossRecovery.js +1 -1
- package/lib/module/ui/boot/runProviderColdBoot.js +2 -2
- package/lib/module/ui/components/BenefitList.js +1 -1
- package/lib/module/ui/components/BenefitList.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +2 -2
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FollowTargetButton.js +2 -2
- package/lib/module/ui/components/FollowTargetButton.js.map +1 -1
- package/lib/module/ui/components/PeableButton.js +2 -3
- package/lib/module/ui/components/PeableButton.js.map +1 -1
- package/lib/module/ui/components/SurfaceHeaderAction.js +1 -1
- package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -1
- package/lib/module/ui/components/SurfaceScreen.js +1 -1
- package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/primitives.js +1 -1
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/module/ui/components/authChooser/requestSurfaces.js +1 -1
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +2 -2
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js +2 -2
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +2 -2
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyAuthScreen.js +1 -1
- package/lib/module/ui/components/signIn/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js +1 -1
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js +2 -2
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js +2 -1
- package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js +4 -4
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/DomainsScreen.js +1 -1
- package/lib/module/ui/screens/DomainsScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -2
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +5 -5
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/NotificationsScreen.js +8 -8
- package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PreferencesScreen.js +2 -2
- package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +37 -37
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +1 -1
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +5 -5
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +1 -1
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +11 -11
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.js +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
- package/lib/module/ui/session/tokenLossRecovery.js +1 -1
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/BenefitList.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/PeableButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +2 -2
- package/lib/typescript/module/ui/components/BenefitList.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowTargetButton.d.ts +1 -1
- package/lib/typescript/module/ui/components/FollowTargetButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/PeableButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/package.json +7 -7
- package/plugins/withOxySharedPermissions.js +89 -0
- package/plugins/withSharedDeviceSessionProvider.js +26 -71
- package/src/ui/boot/runProviderColdBoot.ts +2 -2
- package/src/ui/components/BenefitList.tsx +1 -2
- package/src/ui/components/FollowButton.tsx +3 -3
- package/src/ui/components/FollowTargetButton.tsx +3 -3
- package/src/ui/components/PeableButton.tsx +3 -4
- package/src/ui/components/SurfaceHeaderAction.tsx +1 -1
- package/src/ui/components/SurfaceScreen.tsx +1 -1
- package/src/ui/components/__tests__/followButtonAccessibility.test.tsx +9 -0
- package/src/ui/components/authChooser/AccountsMenuView.tsx +1 -1
- package/src/ui/components/authChooser/primitives.tsx +1 -1
- package/src/ui/components/authChooser/requestSurfaces.tsx +1 -1
- package/src/ui/components/payment/PaymentDetailsStep.tsx +2 -2
- package/src/ui/components/payment/PaymentMethodStep.tsx +2 -2
- package/src/ui/components/payment/PaymentReviewStep.tsx +2 -2
- package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
- package/src/ui/components/signIn/OxyAuthScreen.tsx +1 -1
- package/src/ui/components/signIn/OxyLinkCommonsPanel.tsx +1 -1
- package/src/ui/components/signIn/OxyPasswordPanel.tsx +1 -1
- package/src/ui/components/surfaces/ActionSheetSurface.tsx +2 -1
- package/src/ui/screens/AccountMembersScreen.tsx +4 -4
- package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
- package/src/ui/screens/ConnectedAppsScreen.tsx +1 -1
- package/src/ui/screens/DomainsScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -2
- package/src/ui/screens/FileManagementScreen.tsx +5 -5
- package/src/ui/screens/HistoryViewScreen.tsx +1 -1
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
- package/src/ui/screens/NotificationsScreen.tsx +8 -8
- package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
- package/src/ui/screens/PreferencesScreen.tsx +2 -2
- package/src/ui/screens/PrivacySettingsScreen.tsx +21 -21
- package/src/ui/screens/ProfileScreen.tsx +1 -1
- package/src/ui/screens/SearchSettingsScreen.tsx +5 -5
- package/src/ui/screens/UserListScreen.tsx +1 -1
- package/src/ui/screens/WelcomeNewUserScreen.tsx +11 -11
- package/src/ui/screens/fileManagement/UploadBar.tsx +1 -1
- package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
- package/src/ui/session/__tests__/tokenLossRecovery.test.ts +2 -2
- package/src/ui/session/tokenLossRecovery.ts +1 -1
- package/android/src/main/java/so/oxy/identity/OxyIdentityProvider.kt +0 -77
- package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +0 -66
- package/plugins/withSharedDeviceSessionReader.js +0 -57
- package/plugins/withSharedIdentityProvider.js +0 -83
- package/plugins/withSharedIdentityReader.js +0 -46
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config plugin: withSharedDeviceSessionReader (every other official Oxy app).
|
|
3
|
-
*
|
|
4
|
-
* A reader app JOINS the device's existing session — it adopts the shared
|
|
5
|
-
* `deviceId` + `deviceSecret` a hub app published, so it lands signed in with no
|
|
6
|
-
* QR and, crucially, without ever asking for Commons's private identity key.
|
|
7
|
-
* This plugin wires the minimal Android side of `@oxy.so/services`:
|
|
8
|
-
*
|
|
9
|
-
* - Requests the `signature`-level permission
|
|
10
|
-
* `so.oxy.shared.permission.READ_DEVICE_SESSION` (defined by the hub apps).
|
|
11
|
-
* Because it is `signature`, it is granted only when this app is signed with
|
|
12
|
-
* the SAME certificate as the hub — that is the entire trust boundary, and it
|
|
13
|
-
* is what makes an incorrectly-signed app unable to read the slot.
|
|
14
|
-
* - Adds `<queries>` entries for the hub authorities so package-visibility
|
|
15
|
-
* filtering (Android 11+) never hides them from `ContentResolver.call`.
|
|
16
|
-
*
|
|
17
|
-
* The provider itself is declared only by the hub apps
|
|
18
|
-
* (`withSharedDeviceSessionProvider`) — see the note there about why hosting is
|
|
19
|
-
* restricted to apps inside the `so.oxy.shared` UID.
|
|
20
|
-
*
|
|
21
|
-
* Keep this list identical to `PROVIDER_AUTHORITIES` in
|
|
22
|
-
* `android/src/main/java/so/oxy/devicesession/OxyDeviceSessionModule.kt`.
|
|
23
|
-
*/
|
|
24
|
-
const { withAndroidManifest } = require('@expo/config-plugins');
|
|
25
|
-
|
|
26
|
-
const READ_DEVICE_SESSION_PERMISSION = 'so.oxy.shared.permission.READ_DEVICE_SESSION';
|
|
27
|
-
const PROVIDER_AUTHORITIES = [
|
|
28
|
-
'so.oxy.accounts.devicesession',
|
|
29
|
-
'so.oxy.accounts.dev.devicesession',
|
|
30
|
-
'so.oxy.commons.devicesession',
|
|
31
|
-
'so.oxy.commons.dev.devicesession',
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
module.exports = function withSharedDeviceSessionReader(config) {
|
|
35
|
-
return withAndroidManifest(config, (modConfig) => {
|
|
36
|
-
const manifest = modConfig.modResults.manifest;
|
|
37
|
-
|
|
38
|
-
manifest['uses-permission'] = manifest['uses-permission'] ?? [];
|
|
39
|
-
if (!manifest['uses-permission'].some((p) => p.$['android:name'] === READ_DEVICE_SESSION_PERMISSION)) {
|
|
40
|
-
manifest['uses-permission'].push({ $: { 'android:name': READ_DEVICE_SESSION_PERMISSION } });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
manifest['queries'] = manifest['queries'] ?? [];
|
|
44
|
-
if (manifest['queries'].length === 0) {
|
|
45
|
-
manifest['queries'].push({});
|
|
46
|
-
}
|
|
47
|
-
const queries = manifest['queries'][0];
|
|
48
|
-
queries.provider = queries.provider ?? [];
|
|
49
|
-
for (const authority of PROVIDER_AUTHORITIES) {
|
|
50
|
-
if (!queries.provider.some((p) => p.$['android:authorities'] === authority)) {
|
|
51
|
-
queries.provider.push({ $: { 'android:authorities': authority } });
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return modConfig;
|
|
56
|
-
});
|
|
57
|
-
};
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config plugin: withSharedIdentityProvider (Commons only).
|
|
3
|
-
*
|
|
4
|
-
* Commons is the identity vault — the ONE app that HOSTS the cross-app shared
|
|
5
|
-
* identity. This plugin wires the Android side of `@oxy.so/services`:
|
|
6
|
-
*
|
|
7
|
-
* - Defines a `signature`-level permission `so.oxy.shared.permission.READ_IDENTITY`.
|
|
8
|
-
* `signature` means only apps signed with the SAME certificate (the shared
|
|
9
|
-
* Oxy release keystore) can hold it — the trust boundary is the signing key,
|
|
10
|
-
* not the deprecated `sharedUserId`.
|
|
11
|
-
* - Requests that same permission (`<uses-permission>`) so Commons can also
|
|
12
|
-
* read cross-authority (e.g. prod ⇆ dev variant) through the provider.
|
|
13
|
-
* - Declares the `OxyIdentityProvider` at authority `${applicationId}.identity`
|
|
14
|
-
* (AGP substitutes `${applicationId}` at build → `so.oxy.commons.identity`,
|
|
15
|
-
* or `so.oxy.commons.dev.identity` for the dev variant), guarded by that
|
|
16
|
-
* permission.
|
|
17
|
-
* - Adds a `<queries>` entry for the provider authorities so package-visibility
|
|
18
|
-
* filtering (Android 11+) never hides the sibling provider from the resolver.
|
|
19
|
-
*
|
|
20
|
-
* Reader apps (accounts, Mention, …) use the companion `withSharedIdentityReader`
|
|
21
|
-
* plugin, which only requests the permission + queries — they never host the
|
|
22
|
-
* provider.
|
|
23
|
-
*/
|
|
24
|
-
const { withAndroidManifest } = require('@expo/config-plugins');
|
|
25
|
-
|
|
26
|
-
const READ_IDENTITY_PERMISSION = 'so.oxy.shared.permission.READ_IDENTITY';
|
|
27
|
-
const PROVIDER_CLASS = 'so.oxy.identity.OxyIdentityProvider';
|
|
28
|
-
const PROVIDER_AUTHORITIES = ['so.oxy.commons.identity', 'so.oxy.commons.dev.identity'];
|
|
29
|
-
|
|
30
|
-
module.exports = function withSharedIdentityProvider(config) {
|
|
31
|
-
return withAndroidManifest(config, (modConfig) => {
|
|
32
|
-
const manifest = modConfig.modResults.manifest;
|
|
33
|
-
|
|
34
|
-
// 1. Define the signature-level permission.
|
|
35
|
-
manifest['permission'] = manifest['permission'] ?? [];
|
|
36
|
-
if (!manifest['permission'].some((p) => p.$['android:name'] === READ_IDENTITY_PERMISSION)) {
|
|
37
|
-
manifest['permission'].push({
|
|
38
|
-
$: {
|
|
39
|
-
'android:name': READ_IDENTITY_PERMISSION,
|
|
40
|
-
'android:protectionLevel': 'signature',
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// 2. Request it (Commons reads cross-authority too).
|
|
46
|
-
manifest['uses-permission'] = manifest['uses-permission'] ?? [];
|
|
47
|
-
if (!manifest['uses-permission'].some((p) => p.$['android:name'] === READ_IDENTITY_PERMISSION)) {
|
|
48
|
-
manifest['uses-permission'].push({ $: { 'android:name': READ_IDENTITY_PERMISSION } });
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 3. Make the sibling provider authorities visible under package filtering.
|
|
52
|
-
manifest['queries'] = manifest['queries'] ?? [];
|
|
53
|
-
if (manifest['queries'].length === 0) {
|
|
54
|
-
manifest['queries'].push({});
|
|
55
|
-
}
|
|
56
|
-
const queries = manifest['queries'][0];
|
|
57
|
-
queries.provider = queries.provider ?? [];
|
|
58
|
-
for (const authority of PROVIDER_AUTHORITIES) {
|
|
59
|
-
if (!queries.provider.some((p) => p.$['android:authorities'] === authority)) {
|
|
60
|
-
queries.provider.push({ $: { 'android:authorities': authority } });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// 4. Host the provider.
|
|
65
|
-
const app = manifest.application?.[0];
|
|
66
|
-
if (!app) {
|
|
67
|
-
throw new Error('withSharedIdentityProvider: AndroidManifest has no <application>');
|
|
68
|
-
}
|
|
69
|
-
app.provider = app.provider ?? [];
|
|
70
|
-
if (!app.provider.some((p) => p.$['android:name'] === PROVIDER_CLASS)) {
|
|
71
|
-
app.provider.push({
|
|
72
|
-
$: {
|
|
73
|
-
'android:name': PROVIDER_CLASS,
|
|
74
|
-
'android:authorities': '${applicationId}.identity',
|
|
75
|
-
'android:exported': 'true',
|
|
76
|
-
'android:permission': READ_IDENTITY_PERMISSION,
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return modConfig;
|
|
82
|
-
});
|
|
83
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config plugin: withSharedIdentityReader (reader RPs — accounts, etc.).
|
|
3
|
-
*
|
|
4
|
-
* Reader apps do NOT host the shared identity — they only READ it from the
|
|
5
|
-
* Commons-hosted `OxyIdentityProvider` to enable silent "Sign in with Oxy".
|
|
6
|
-
* This plugin wires the minimal Android side of `@oxy.so/services`:
|
|
7
|
-
*
|
|
8
|
-
* - Requests the `signature`-level permission `so.oxy.shared.permission.READ_IDENTITY`
|
|
9
|
-
* (defined by Commons). Because it is `signature`, it is only granted when
|
|
10
|
-
* this app is signed with the SAME certificate as Commons (the shared Oxy
|
|
11
|
-
* release keystore) — that is the entire trust boundary.
|
|
12
|
-
* - Adds a `<queries>` entry for the Commons provider authorities so
|
|
13
|
-
* package-visibility filtering (Android 11+) never hides the provider from
|
|
14
|
-
* `ContentResolver.call`.
|
|
15
|
-
*
|
|
16
|
-
* The provider itself is declared only in Commons (`withSharedIdentityProvider`).
|
|
17
|
-
*/
|
|
18
|
-
const { withAndroidManifest } = require('@expo/config-plugins');
|
|
19
|
-
|
|
20
|
-
const READ_IDENTITY_PERMISSION = 'so.oxy.shared.permission.READ_IDENTITY';
|
|
21
|
-
const PROVIDER_AUTHORITIES = ['so.oxy.commons.identity', 'so.oxy.commons.dev.identity'];
|
|
22
|
-
|
|
23
|
-
module.exports = function withSharedIdentityReader(config) {
|
|
24
|
-
return withAndroidManifest(config, (modConfig) => {
|
|
25
|
-
const manifest = modConfig.modResults.manifest;
|
|
26
|
-
|
|
27
|
-
manifest['uses-permission'] = manifest['uses-permission'] ?? [];
|
|
28
|
-
if (!manifest['uses-permission'].some((p) => p.$['android:name'] === READ_IDENTITY_PERMISSION)) {
|
|
29
|
-
manifest['uses-permission'].push({ $: { 'android:name': READ_IDENTITY_PERMISSION } });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
manifest['queries'] = manifest['queries'] ?? [];
|
|
33
|
-
if (manifest['queries'].length === 0) {
|
|
34
|
-
manifest['queries'].push({});
|
|
35
|
-
}
|
|
36
|
-
const queries = manifest['queries'][0];
|
|
37
|
-
queries.provider = queries.provider ?? [];
|
|
38
|
-
for (const authority of PROVIDER_AUTHORITIES) {
|
|
39
|
-
if (!queries.provider.some((p) => p.$['android:authorities'] === authority)) {
|
|
40
|
-
queries.provider.push({ $: { 'android:authorities': authority } });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return modConfig;
|
|
45
|
-
});
|
|
46
|
-
};
|