@ankhorage/expo-runtime 2.4.0 → 2.5.1
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/oauthBrowserRuntime.d.ts +4 -0
- package/dist/oauthBrowserRuntime.d.ts.map +1 -0
- package/dist/oauthBrowserRuntime.js +10 -0
- package/dist/oauthBrowserRuntime.js.map +1 -0
- package/dist/oauthBrowserRuntimeCore.d.ts +14 -0
- package/dist/oauthBrowserRuntimeCore.d.ts.map +1 -0
- package/dist/oauthBrowserRuntimeCore.js +11 -0
- package/dist/oauthBrowserRuntimeCore.js.map +1 -0
- package/package.json +13 -1
- package/src/oauthBrowserRuntime.test.ts +60 -0
- package/src/oauthBrowserRuntime.ts +16 -0
- package/src/oauthBrowserRuntimeCore.ts +28 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/expo-runtime
|
|
2
2
|
|
|
3
|
+
## 2.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f616cdf: Fix brokered OAuth host detection so custom native, development-client, and standalone builds are not misclassified as Expo Go.
|
|
8
|
+
|
|
9
|
+
## 2.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- b6541d8: Add runtime readiness detection that rejects Expo Go for brokered native OAuth and requires a custom development or standalone build with the configured app scheme.
|
|
14
|
+
|
|
3
15
|
## 2.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# EXPO-RUNTIME
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters
|
|
9
9
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';
|
|
2
|
+
export type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';
|
|
3
|
+
export declare function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness;
|
|
4
|
+
//# sourceMappingURL=oauthBrowserRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthBrowserRuntime.d.ts","sourceRoot":"","sources":["../src/oauthBrowserRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gCAAgC,EAEtC,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAElF,wBAAgB,uCAAuC,IAAI,gCAAgC,CAM1F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Constants from 'expo-constants';
|
|
2
|
+
import { resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment, } from './oauthBrowserRuntimeCore';
|
|
3
|
+
export function resolveExpoOAuthBrowserRuntimeReadiness() {
|
|
4
|
+
return resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
|
|
5
|
+
appOwnership: Constants.appOwnership,
|
|
6
|
+
executionEnvironment: Constants.executionEnvironment,
|
|
7
|
+
expoGoConfig: Constants.expoGoConfig,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=oauthBrowserRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthBrowserRuntime.js","sourceRoot":"","sources":["../src/oauthBrowserRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAEL,sDAAsD,GACvD,MAAM,2BAA2B,CAAC;AAInC,MAAM,UAAU,uCAAuC;IACrD,OAAO,sDAAsD,CAAC;QAC5D,YAAY,EAAE,SAAS,CAAC,YAAY;QACpC,oBAAoB,EAAE,SAAS,CAAC,oBAAoB;QACpD,YAAY,EAAE,SAAS,CAAC,YAAY;KACrC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import Constants from 'expo-constants';\n\nimport {\n type ExpoOAuthBrowserRuntimeReadiness,\n resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment,\n} from './oauthBrowserRuntimeCore';\n\nexport type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';\n\nexport function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness {\n return resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({\n appOwnership: Constants.appOwnership,\n executionEnvironment: Constants.executionEnvironment,\n expoGoConfig: Constants.expoGoConfig,\n });\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ExpoOAuthBrowserRuntimeReadiness = {
|
|
2
|
+
readonly status: 'ready';
|
|
3
|
+
} | {
|
|
4
|
+
readonly status: 'unsupported';
|
|
5
|
+
readonly reason: 'expo-go';
|
|
6
|
+
readonly message: string;
|
|
7
|
+
};
|
|
8
|
+
export interface ExpoOAuthBrowserRuntimeEnvironment {
|
|
9
|
+
readonly appOwnership: unknown;
|
|
10
|
+
readonly executionEnvironment: unknown;
|
|
11
|
+
readonly expoGoConfig: unknown;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(environment: ExpoOAuthBrowserRuntimeEnvironment): ExpoOAuthBrowserRuntimeReadiness;
|
|
14
|
+
//# sourceMappingURL=oauthBrowserRuntimeCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthBrowserRuntimeCore.d.ts","sourceRoot":"","sources":["../src/oauthBrowserRuntimeCore.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gCAAgC,GACxC;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC5B;IACE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IACvC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,sDAAsD,CACpE,WAAW,EAAE,kCAAkC,GAC9C,gCAAgC,CAWlC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(environment) {
|
|
2
|
+
if (environment.appOwnership !== 'expo') {
|
|
3
|
+
return { status: 'ready' };
|
|
4
|
+
}
|
|
5
|
+
return {
|
|
6
|
+
status: 'unsupported',
|
|
7
|
+
reason: 'expo-go',
|
|
8
|
+
message: 'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=oauthBrowserRuntimeCore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthBrowserRuntimeCore.js","sourceRoot":"","sources":["../src/oauthBrowserRuntimeCore.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,sDAAsD,CACpE,WAA+C;IAE/C,IAAI,WAAW,CAAC,YAAY,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,SAAS;QACjB,OAAO,EACL,kJAAkJ;KACrJ,CAAC;AACJ,CAAC","sourcesContent":["export type ExpoOAuthBrowserRuntimeReadiness =\n | { readonly status: 'ready' }\n | {\n readonly status: 'unsupported';\n readonly reason: 'expo-go';\n readonly message: string;\n };\n\nexport interface ExpoOAuthBrowserRuntimeEnvironment {\n readonly appOwnership: unknown;\n readonly executionEnvironment: unknown;\n readonly expoGoConfig: unknown;\n}\n\nexport function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(\n environment: ExpoOAuthBrowserRuntimeEnvironment,\n): ExpoOAuthBrowserRuntimeReadiness {\n if (environment.appOwnership !== 'expo') {\n return { status: 'ready' };\n }\n\n return {\n status: 'unsupported',\n reason: 'expo-go',\n message:\n 'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/expo-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.1",
|
|
5
5
|
"description": "Declarative runtime integration for Expo apps: maps app capabilities to permissions, packages, config plugins, providers, and adapters",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/expo-runtime#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -55,6 +55,13 @@
|
|
|
55
55
|
"import": "./dist/oauthBrowserTransport.js",
|
|
56
56
|
"default": "./dist/oauthBrowserTransport.js"
|
|
57
57
|
},
|
|
58
|
+
"./oauth-browser-runtime": {
|
|
59
|
+
"react-native": "./src/oauthBrowserRuntime.ts",
|
|
60
|
+
"browser": "./src/oauthBrowserRuntime.ts",
|
|
61
|
+
"types": "./src/oauthBrowserRuntime.ts",
|
|
62
|
+
"import": "./dist/oauthBrowserRuntime.js",
|
|
63
|
+
"default": "./dist/oauthBrowserRuntime.js"
|
|
64
|
+
},
|
|
58
65
|
"./media-picker": {
|
|
59
66
|
"react-native": "./src/mediaPicker/index.ts",
|
|
60
67
|
"browser": "./src/mediaPicker/index.ts",
|
|
@@ -92,6 +99,7 @@
|
|
|
92
99
|
"@ankhorage/zora": "^2.8.7",
|
|
93
100
|
"expo": "~54.0.34",
|
|
94
101
|
"expo-camera": "~17.0.10",
|
|
102
|
+
"expo-constants": "~18.0.13",
|
|
95
103
|
"expo-document-picker": "~14.0.8",
|
|
96
104
|
"expo-file-system": "~19.0.23",
|
|
97
105
|
"expo-image-picker": "~17.0.11",
|
|
@@ -99,6 +107,9 @@
|
|
|
99
107
|
"react-native": "0.81.5"
|
|
100
108
|
},
|
|
101
109
|
"peerDependenciesMeta": {
|
|
110
|
+
"expo-constants": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
102
113
|
"expo-document-picker": {
|
|
103
114
|
"optional": true
|
|
104
115
|
},
|
|
@@ -119,6 +130,7 @@
|
|
|
119
130
|
"@types/react": "^19.2.14",
|
|
120
131
|
"expo": "~54.0.34",
|
|
121
132
|
"expo-camera": "~17.0.10",
|
|
133
|
+
"expo-constants": "~18.0.13",
|
|
122
134
|
"expo-document-picker": "~14.0.8",
|
|
123
135
|
"expo-file-system": "~19.0.23",
|
|
124
136
|
"expo-image-picker": "~17.0.11",
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment } from './oauthBrowserRuntimeCore';
|
|
4
|
+
|
|
5
|
+
describe('Expo OAuth browser runtime readiness', () => {
|
|
6
|
+
test('allows an SDK 54 custom native build with an embedded Expo config', () => {
|
|
7
|
+
expect(
|
|
8
|
+
resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
|
|
9
|
+
appOwnership: null,
|
|
10
|
+
executionEnvironment: 'bare',
|
|
11
|
+
expoGoConfig: { name: 'Auth5 Native OAuth Smoke' },
|
|
12
|
+
}),
|
|
13
|
+
).toEqual({ status: 'ready' });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('allows a development client store-client runtime', () => {
|
|
17
|
+
expect(
|
|
18
|
+
resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
|
|
19
|
+
appOwnership: null,
|
|
20
|
+
executionEnvironment: 'storeClient',
|
|
21
|
+
expoGoConfig: null,
|
|
22
|
+
}),
|
|
23
|
+
).toEqual({ status: 'ready' });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('allows a standalone runtime', () => {
|
|
27
|
+
expect(
|
|
28
|
+
resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
|
|
29
|
+
appOwnership: null,
|
|
30
|
+
executionEnvironment: 'standalone',
|
|
31
|
+
expoGoConfig: null,
|
|
32
|
+
}),
|
|
33
|
+
).toEqual({ status: 'ready' });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('rejects Expo Go with an actionable development-build requirement', () => {
|
|
37
|
+
expect(
|
|
38
|
+
resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
|
|
39
|
+
appOwnership: 'expo',
|
|
40
|
+
executionEnvironment: 'storeClient',
|
|
41
|
+
expoGoConfig: { debuggerHost: '127.0.0.1:8081' },
|
|
42
|
+
}),
|
|
43
|
+
).toEqual({
|
|
44
|
+
status: 'unsupported',
|
|
45
|
+
reason: 'expo-go',
|
|
46
|
+
message:
|
|
47
|
+
'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test('does not serialize Expo runtime configuration into readiness output', () => {
|
|
52
|
+
const readiness = resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
|
|
53
|
+
appOwnership: 'expo',
|
|
54
|
+
executionEnvironment: 'storeClient',
|
|
55
|
+
expoGoConfig: { secretLikeValue: 'do-not-echo' },
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
expect(JSON.stringify(readiness)).not.toContain('do-not-echo');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Constants from 'expo-constants';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ExpoOAuthBrowserRuntimeReadiness,
|
|
5
|
+
resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment,
|
|
6
|
+
} from './oauthBrowserRuntimeCore';
|
|
7
|
+
|
|
8
|
+
export type { ExpoOAuthBrowserRuntimeReadiness } from './oauthBrowserRuntimeCore';
|
|
9
|
+
|
|
10
|
+
export function resolveExpoOAuthBrowserRuntimeReadiness(): ExpoOAuthBrowserRuntimeReadiness {
|
|
11
|
+
return resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment({
|
|
12
|
+
appOwnership: Constants.appOwnership,
|
|
13
|
+
executionEnvironment: Constants.executionEnvironment,
|
|
14
|
+
expoGoConfig: Constants.expoGoConfig,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type ExpoOAuthBrowserRuntimeReadiness =
|
|
2
|
+
| { readonly status: 'ready' }
|
|
3
|
+
| {
|
|
4
|
+
readonly status: 'unsupported';
|
|
5
|
+
readonly reason: 'expo-go';
|
|
6
|
+
readonly message: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface ExpoOAuthBrowserRuntimeEnvironment {
|
|
10
|
+
readonly appOwnership: unknown;
|
|
11
|
+
readonly executionEnvironment: unknown;
|
|
12
|
+
readonly expoGoConfig: unknown;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function resolveExpoOAuthBrowserRuntimeReadinessFromEnvironment(
|
|
16
|
+
environment: ExpoOAuthBrowserRuntimeEnvironment,
|
|
17
|
+
): ExpoOAuthBrowserRuntimeReadiness {
|
|
18
|
+
if (environment.appOwnership !== 'expo') {
|
|
19
|
+
return { status: 'ready' };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
status: 'unsupported',
|
|
24
|
+
reason: 'expo-go',
|
|
25
|
+
message:
|
|
26
|
+
'Brokered OAuth requires a development or standalone build with the configured app scheme; Expo Go cannot provide a stable OAuth callback scheme.',
|
|
27
|
+
};
|
|
28
|
+
}
|