@oxy.so/services 14.12.0 → 14.13.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.
@@ -1,4 +1,7 @@
1
1
  import ExpoModulesCore
2
+ #if !os(tvOS)
3
+ import LocalAuthentication
4
+ #endif
2
5
  import Security
3
6
 
4
7
  /**
@@ -134,6 +137,51 @@ public class OxyIdentityModule: Module {
134
137
  return group
135
138
  }
136
139
 
140
+ /// Read one `expo-secure-store` item WITHOUT user interaction (round-5
141
+ /// review R5-9). expo-secure-store's own read tries `<service>:no-auth`,
142
+ /// then `<service>:auth` (an item stored with `requireAuthentication`,
143
+ /// which prompts for Face ID or the passcode), then the legacy `<service>`.
144
+ /// Any app in a shared access group can plant an `:auth` copy there, so
145
+ /// `@oxy.so/core` reads the shared group through this instead: the
146
+ /// `:no-auth` and legacy copies only, with an `LAContext` that refuses
147
+ /// interaction, so an item that needs the user answers `nil` and no prompt
148
+ /// is ever shown. The query matches expo-secure-store's (service, generic
149
+ /// and account attributes). "Not found" and "interaction not allowed"
150
+ /// answer `nil`; any other status throws.
151
+ AsyncFunction("readKeychainItemWithoutInteraction") {
152
+ (_ key: String, _ service: String?, _ accessGroup: String) throws -> String? in
153
+ let base = service ?? "app"
154
+ let encodedKey = Data(key.utf8)
155
+ for itemService in ["\(base):no-auth", base] {
156
+ var query: [String: Any] = [
157
+ kSecClass as String: kSecClassGenericPassword,
158
+ kSecAttrService as String: itemService,
159
+ kSecAttrGeneric as String: encodedKey,
160
+ kSecAttrAccount as String: encodedKey,
161
+ kSecAttrAccessGroup as String: accessGroup,
162
+ kSecMatchLimit as String: kSecMatchLimitOne,
163
+ kSecReturnData as String: true,
164
+ ]
165
+ #if !os(tvOS)
166
+ let context = LAContext()
167
+ context.interactionNotAllowed = true
168
+ query[kSecUseAuthenticationContext as String] = context
169
+ #endif
170
+ var item: CFTypeRef?
171
+ let status = SecItemCopyMatching(query as CFDictionary, &item)
172
+ switch status {
173
+ case errSecSuccess:
174
+ guard let data = item as? Data else { return nil }
175
+ return String(data: data, encoding: .utf8)
176
+ case errSecItemNotFound, errSecInteractionNotAllowed, errSecAuthFailed:
177
+ continue
178
+ default:
179
+ throw KeychainProbeException(status)
180
+ }
181
+ }
182
+ return nil
183
+ }
184
+
137
185
  // Retired keys (Commons protocol 4): iOS reads them from the wallet group
138
186
  // directly, like the current key.
139
187
  AsyncFunction("listRetiredKeys") { (_ accountId: String?) -> [String: Any]? in
@@ -152,6 +200,6 @@ public class OxyIdentityModule: Module {
152
200
 
153
201
  internal final class KeychainProbeException: GenericException<OSStatus> {
154
202
  override var reason: String {
155
- "The keychain refused the access-group probe (OSStatus \(param))"
203
+ "The keychain refused the request (OSStatus \(param))"
156
204
  }
157
205
  }
@@ -24,8 +24,10 @@ export declare const loadIdentityCrypto: () => Promise<{
24
24
  listOrganizationKeys: typeof import("@oxy.so/core/crypto").listOrganizationKeys;
25
25
  deleteOrganizationKey: typeof import("@oxy.so/core/crypto").deleteOrganizationKey;
26
26
  syncOrganizationKeys: typeof import("@oxy.so/core/crypto").syncOrganizationKeys;
27
+ adoptOrganizationKeyFromRing: typeof import("@oxy.so/core/crypto").adoptOrganizationKeyFromRing;
27
28
  isOrganizationAccountId: typeof import("@oxy.so/core/crypto").isOrganizationAccountId;
28
29
  isHealthyOrganizationKeyPair: typeof import("@oxy.so/core/crypto").isHealthyOrganizationKeyPair;
30
+ OrganizationKeyIndexUnreadableError: typeof import("@oxy.so/core/crypto").OrganizationKeyIndexUnreadableError;
29
31
  KEYCHAIN_ACCESS_GROUPS: {
30
32
  readonly identity: "so.oxy.identity";
31
33
  readonly wallet: "so.oxy.wallet";
@@ -57,6 +59,9 @@ export declare const loadIdentityCrypto: () => Promise<{
57
59
  exportRetiredIdentityKeys: typeof import("@oxy.so/core/crypto").exportRetiredIdentityKeys;
58
60
  claimRetiredIdentityKeys: typeof import("@oxy.so/core/crypto").claimRetiredIdentityKeys;
59
61
  countQuarantinedRetiredKeys: typeof import("@oxy.so/core/crypto").countQuarantinedRetiredKeys;
62
+ claimRetiredOrganizationKeys: typeof import("@oxy.so/core/crypto").claimRetiredOrganizationKeys;
63
+ listQuarantinedOrganizationKeys: typeof import("@oxy.so/core/crypto").listQuarantinedOrganizationKeys;
64
+ holdsRetiredRing: typeof import("@oxy.so/core/crypto").holdsRetiredRing;
60
65
  unmirrorPersonalRetiredKeys: typeof import("@oxy.so/core/crypto").unmirrorPersonalRetiredKeys;
61
66
  RetiredKeyRingUnreadableError: typeof import("@oxy.so/core/crypto").RetiredKeyRingUnreadableError;
62
67
  SignatureService: typeof import("@oxy.so/core/crypto").SignatureService;
@@ -1 +1 @@
1
- {"version":3,"file":"identityCrypto.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/identityCrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
1
+ {"version":3,"file":"identityCrypto.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/identityCrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
@@ -24,8 +24,10 @@ export declare const loadIdentityCrypto: () => Promise<{
24
24
  listOrganizationKeys: typeof import("@oxy.so/core/crypto").listOrganizationKeys;
25
25
  deleteOrganizationKey: typeof import("@oxy.so/core/crypto").deleteOrganizationKey;
26
26
  syncOrganizationKeys: typeof import("@oxy.so/core/crypto").syncOrganizationKeys;
27
+ adoptOrganizationKeyFromRing: typeof import("@oxy.so/core/crypto").adoptOrganizationKeyFromRing;
27
28
  isOrganizationAccountId: typeof import("@oxy.so/core/crypto").isOrganizationAccountId;
28
29
  isHealthyOrganizationKeyPair: typeof import("@oxy.so/core/crypto").isHealthyOrganizationKeyPair;
30
+ OrganizationKeyIndexUnreadableError: typeof import("@oxy.so/core/crypto").OrganizationKeyIndexUnreadableError;
29
31
  KEYCHAIN_ACCESS_GROUPS: {
30
32
  readonly identity: "so.oxy.identity";
31
33
  readonly wallet: "so.oxy.wallet";
@@ -57,6 +59,9 @@ export declare const loadIdentityCrypto: () => Promise<{
57
59
  exportRetiredIdentityKeys: typeof import("@oxy.so/core/crypto").exportRetiredIdentityKeys;
58
60
  claimRetiredIdentityKeys: typeof import("@oxy.so/core/crypto").claimRetiredIdentityKeys;
59
61
  countQuarantinedRetiredKeys: typeof import("@oxy.so/core/crypto").countQuarantinedRetiredKeys;
62
+ claimRetiredOrganizationKeys: typeof import("@oxy.so/core/crypto").claimRetiredOrganizationKeys;
63
+ listQuarantinedOrganizationKeys: typeof import("@oxy.so/core/crypto").listQuarantinedOrganizationKeys;
64
+ holdsRetiredRing: typeof import("@oxy.so/core/crypto").holdsRetiredRing;
60
65
  unmirrorPersonalRetiredKeys: typeof import("@oxy.so/core/crypto").unmirrorPersonalRetiredKeys;
61
66
  RetiredKeyRingUnreadableError: typeof import("@oxy.so/core/crypto").RetiredKeyRingUnreadableError;
62
67
  SignatureService: typeof import("@oxy.so/core/crypto").SignatureService;
@@ -1 +1 @@
1
- {"version":3,"file":"identityCrypto.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/identityCrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
1
+ {"version":3,"file":"identityCrypto.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/identityCrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/services",
3
- "version": "14.12.0",
3
+ "version": "14.13.0",
4
4
  "description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -176,14 +176,14 @@
176
176
  "delete-dts.js": "find ./lib/commonjs ./lib/module \\( -name '*.d.js*' -o -name '*.d.ts' \\) -delete"
177
177
  },
178
178
  "dependencies": {
179
- "@oxy.so/contracts": "^6.12.0",
179
+ "@oxy.so/contracts": "^6.13.0",
180
180
  "color": "^5.0.3",
181
181
  "@peable.to/sdk": "^4.0.0"
182
182
  },
183
183
  "devDependencies": {
184
184
  "@expo/app-integrity": "~58.0.2",
185
185
  "@expo/vector-icons": "^15.1.1",
186
- "@oxy.so/core": "7.35.0",
186
+ "@oxy.so/core": "7.36.0",
187
187
  "@react-native-async-storage/async-storage": "^3.1.1",
188
188
  "@react-native-community/netinfo": "^12.0.1",
189
189
  "@react-native/babel-preset": "^0.88.1",
@@ -236,7 +236,7 @@
236
236
  "@expo/app-integrity": ">=0.1.10 <59.0.0",
237
237
  "@expo/vector-icons": "^15.0.3",
238
238
  "@oxy.so/bloom": ">=17.15.0",
239
- "@oxy.so/core": "^7.34.0",
239
+ "@oxy.so/core": "^7.36.0",
240
240
  "@react-native-async-storage/async-storage": ">=2.0.0 <4.0.0",
241
241
  "@react-native-community/netinfo": ">=11.4.1 <13.0.0",
242
242
  "@tanstack/query-async-storage-persister": "^5.101",