@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.
Files changed (234) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/AndroidManifest.xml +6 -6
  3. package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionModule.kt +106 -41
  4. package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionProvider.kt +45 -32
  5. package/android/src/main/java/so/oxy/devicesession/OxyDeviceSessionStore.kt +22 -27
  6. package/android/src/main/java/so/oxy/identity/OxyIdentityModule.kt +89 -43
  7. package/android/src/main/java/so/oxy/security/OxyCallerPolicy.kt +97 -0
  8. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +4 -10
  9. package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +17 -18
  10. package/ios/OxyIdentityModule.swift +13 -14
  11. package/lib/commonjs/ui/boot/runProviderColdBoot.js +2 -2
  12. package/lib/commonjs/ui/components/BenefitList.js +1 -1
  13. package/lib/commonjs/ui/components/BenefitList.js.map +1 -1
  14. package/lib/commonjs/ui/components/FollowButton.js +2 -2
  15. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  16. package/lib/commonjs/ui/components/FollowTargetButton.js +2 -2
  17. package/lib/commonjs/ui/components/FollowTargetButton.js.map +1 -1
  18. package/lib/commonjs/ui/components/PeableButton.js +1 -2
  19. package/lib/commonjs/ui/components/PeableButton.js.map +1 -1
  20. package/lib/commonjs/ui/components/SurfaceHeaderAction.js +1 -1
  21. package/lib/commonjs/ui/components/SurfaceHeaderAction.js.map +1 -1
  22. package/lib/commonjs/ui/components/SurfaceScreen.js +1 -1
  23. package/lib/commonjs/ui/components/SurfaceScreen.js.map +1 -1
  24. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +1 -1
  25. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  26. package/lib/commonjs/ui/components/authChooser/primitives.js +1 -1
  27. package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
  28. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +1 -1
  29. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -1
  30. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
  31. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  32. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +2 -2
  33. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
  34. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +2 -2
  35. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
  36. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +1 -1
  37. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
  38. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
  39. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  40. package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js +1 -1
  41. package/lib/commonjs/ui/components/signIn/OxyAuthScreen.js.map +1 -1
  42. package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js +1 -1
  43. package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
  44. package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js +2 -2
  45. package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
  46. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js +2 -1
  47. package/lib/commonjs/ui/components/surfaces/ActionSheetSurface.js.map +1 -1
  48. package/lib/commonjs/ui/screens/AccountMembersScreen.js +4 -4
  49. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  50. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +1 -1
  51. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  52. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +1 -1
  53. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  54. package/lib/commonjs/ui/screens/DomainsScreen.js +1 -1
  55. package/lib/commonjs/ui/screens/DomainsScreen.js.map +1 -1
  56. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -2
  57. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  58. package/lib/commonjs/ui/screens/FileManagementScreen.js +5 -5
  59. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  60. package/lib/commonjs/ui/screens/HistoryViewScreen.js +1 -1
  61. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  62. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +1 -1
  63. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  64. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +1 -1
  65. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  66. package/lib/commonjs/ui/screens/NotificationsScreen.js +8 -8
  67. package/lib/commonjs/ui/screens/NotificationsScreen.js.map +1 -1
  68. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1 -1
  69. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  70. package/lib/commonjs/ui/screens/PreferencesScreen.js +2 -2
  71. package/lib/commonjs/ui/screens/PreferencesScreen.js.map +1 -1
  72. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +37 -37
  73. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  74. package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
  75. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  76. package/lib/commonjs/ui/screens/SearchSettingsScreen.js +5 -5
  77. package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
  78. package/lib/commonjs/ui/screens/UserListScreen.js +1 -1
  79. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  80. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +11 -11
  81. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  82. package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +1 -1
  83. package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
  84. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
  85. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  86. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +1 -1
  87. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  88. package/lib/commonjs/ui/session/tokenLossRecovery.js +1 -1
  89. package/lib/module/ui/boot/runProviderColdBoot.js +2 -2
  90. package/lib/module/ui/components/BenefitList.js +1 -1
  91. package/lib/module/ui/components/BenefitList.js.map +1 -1
  92. package/lib/module/ui/components/FollowButton.js +2 -2
  93. package/lib/module/ui/components/FollowButton.js.map +1 -1
  94. package/lib/module/ui/components/FollowTargetButton.js +2 -2
  95. package/lib/module/ui/components/FollowTargetButton.js.map +1 -1
  96. package/lib/module/ui/components/PeableButton.js +2 -3
  97. package/lib/module/ui/components/PeableButton.js.map +1 -1
  98. package/lib/module/ui/components/SurfaceHeaderAction.js +1 -1
  99. package/lib/module/ui/components/SurfaceHeaderAction.js.map +1 -1
  100. package/lib/module/ui/components/SurfaceScreen.js +1 -1
  101. package/lib/module/ui/components/SurfaceScreen.js.map +1 -1
  102. package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -1
  103. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  104. package/lib/module/ui/components/authChooser/primitives.js +1 -1
  105. package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
  106. package/lib/module/ui/components/authChooser/requestSurfaces.js +1 -1
  107. package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -1
  108. package/lib/module/ui/components/payment/PaymentDetailsStep.js +2 -2
  109. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  110. package/lib/module/ui/components/payment/PaymentMethodStep.js +2 -2
  111. package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
  112. package/lib/module/ui/components/payment/PaymentReviewStep.js +2 -2
  113. package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
  114. package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
  115. package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
  116. package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
  117. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  118. package/lib/module/ui/components/signIn/OxyAuthScreen.js +1 -1
  119. package/lib/module/ui/components/signIn/OxyAuthScreen.js.map +1 -1
  120. package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js +1 -1
  121. package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
  122. package/lib/module/ui/components/signIn/OxyPasswordPanel.js +2 -2
  123. package/lib/module/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
  124. package/lib/module/ui/components/surfaces/ActionSheetSurface.js +2 -1
  125. package/lib/module/ui/components/surfaces/ActionSheetSurface.js.map +1 -1
  126. package/lib/module/ui/screens/AccountMembersScreen.js +4 -4
  127. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  128. package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
  129. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  130. package/lib/module/ui/screens/ConnectedAppsScreen.js +1 -1
  131. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  132. package/lib/module/ui/screens/DomainsScreen.js +1 -1
  133. package/lib/module/ui/screens/DomainsScreen.js.map +1 -1
  134. package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -2
  135. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  136. package/lib/module/ui/screens/FileManagementScreen.js +5 -5
  137. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  138. package/lib/module/ui/screens/HistoryViewScreen.js +1 -1
  139. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  140. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  141. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  142. package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
  143. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  144. package/lib/module/ui/screens/NotificationsScreen.js +8 -8
  145. package/lib/module/ui/screens/NotificationsScreen.js.map +1 -1
  146. package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
  147. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  148. package/lib/module/ui/screens/PreferencesScreen.js +2 -2
  149. package/lib/module/ui/screens/PreferencesScreen.js.map +1 -1
  150. package/lib/module/ui/screens/PrivacySettingsScreen.js +37 -37
  151. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  152. package/lib/module/ui/screens/ProfileScreen.js +1 -1
  153. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  154. package/lib/module/ui/screens/SearchSettingsScreen.js +5 -5
  155. package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
  156. package/lib/module/ui/screens/UserListScreen.js +1 -1
  157. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  158. package/lib/module/ui/screens/WelcomeNewUserScreen.js +11 -11
  159. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  160. package/lib/module/ui/screens/fileManagement/UploadBar.js +1 -1
  161. package/lib/module/ui/screens/fileManagement/UploadBar.js.map +1 -1
  162. package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
  163. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  164. package/lib/module/ui/screens/trust/TrustRulesScreen.js +1 -1
  165. package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  166. package/lib/module/ui/session/tokenLossRecovery.js +1 -1
  167. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +2 -2
  168. package/lib/typescript/commonjs/ui/components/BenefitList.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/ui/components/FollowButton.d.ts +1 -1
  170. package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts +1 -1
  172. package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/ui/components/PeableButton.d.ts.map +1 -1
  174. package/lib/typescript/commonjs/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  176. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +2 -2
  177. package/lib/typescript/module/ui/components/BenefitList.d.ts.map +1 -1
  178. package/lib/typescript/module/ui/components/FollowButton.d.ts +1 -1
  179. package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
  180. package/lib/typescript/module/ui/components/FollowTargetButton.d.ts +1 -1
  181. package/lib/typescript/module/ui/components/FollowTargetButton.d.ts.map +1 -1
  182. package/lib/typescript/module/ui/components/PeableButton.d.ts.map +1 -1
  183. package/lib/typescript/module/ui/components/surfaces/ActionSheetSurface.d.ts.map +1 -1
  184. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  185. package/package.json +7 -7
  186. package/plugins/withOxySharedPermissions.js +89 -0
  187. package/plugins/withSharedDeviceSessionProvider.js +26 -71
  188. package/src/ui/boot/runProviderColdBoot.ts +2 -2
  189. package/src/ui/components/BenefitList.tsx +1 -2
  190. package/src/ui/components/FollowButton.tsx +3 -3
  191. package/src/ui/components/FollowTargetButton.tsx +3 -3
  192. package/src/ui/components/PeableButton.tsx +3 -4
  193. package/src/ui/components/SurfaceHeaderAction.tsx +1 -1
  194. package/src/ui/components/SurfaceScreen.tsx +1 -1
  195. package/src/ui/components/__tests__/followButtonAccessibility.test.tsx +9 -0
  196. package/src/ui/components/authChooser/AccountsMenuView.tsx +1 -1
  197. package/src/ui/components/authChooser/primitives.tsx +1 -1
  198. package/src/ui/components/authChooser/requestSurfaces.tsx +1 -1
  199. package/src/ui/components/payment/PaymentDetailsStep.tsx +2 -2
  200. package/src/ui/components/payment/PaymentMethodStep.tsx +2 -2
  201. package/src/ui/components/payment/PaymentReviewStep.tsx +2 -2
  202. package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
  203. package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
  204. package/src/ui/components/signIn/OxyAuthScreen.tsx +1 -1
  205. package/src/ui/components/signIn/OxyLinkCommonsPanel.tsx +1 -1
  206. package/src/ui/components/signIn/OxyPasswordPanel.tsx +1 -1
  207. package/src/ui/components/surfaces/ActionSheetSurface.tsx +2 -1
  208. package/src/ui/screens/AccountMembersScreen.tsx +4 -4
  209. package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
  210. package/src/ui/screens/ConnectedAppsScreen.tsx +1 -1
  211. package/src/ui/screens/DomainsScreen.tsx +1 -1
  212. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -2
  213. package/src/ui/screens/FileManagementScreen.tsx +5 -5
  214. package/src/ui/screens/HistoryViewScreen.tsx +1 -1
  215. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  216. package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
  217. package/src/ui/screens/NotificationsScreen.tsx +8 -8
  218. package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
  219. package/src/ui/screens/PreferencesScreen.tsx +2 -2
  220. package/src/ui/screens/PrivacySettingsScreen.tsx +21 -21
  221. package/src/ui/screens/ProfileScreen.tsx +1 -1
  222. package/src/ui/screens/SearchSettingsScreen.tsx +5 -5
  223. package/src/ui/screens/UserListScreen.tsx +1 -1
  224. package/src/ui/screens/WelcomeNewUserScreen.tsx +11 -11
  225. package/src/ui/screens/fileManagement/UploadBar.tsx +1 -1
  226. package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
  227. package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
  228. package/src/ui/session/__tests__/tokenLossRecovery.test.ts +2 -2
  229. package/src/ui/session/tokenLossRecovery.ts +1 -1
  230. package/android/src/main/java/so/oxy/identity/OxyIdentityProvider.kt +0 -77
  231. package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +0 -66
  232. package/plugins/withSharedDeviceSessionReader.js +0 -57
  233. package/plugins/withSharedIdentityProvider.js +0 -83
  234. 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
- };