@atlasauth/capacitor 0.1.0 → 0.2.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/CHANGELOG.md +43 -0
- package/dist/index.d.ts +27 -3
- package/dist/index.js +97 -12
- package/dist/index.js.map +1 -1
- package/dist/native-session.d.ts +9 -1
- package/dist/native-session.js +18 -2
- package/dist/native-session.js.map +1 -1
- package/dist/token-store.d.ts +14 -0
- package/dist/token-store.js +25 -0
- package/dist/token-store.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @atlasauth/capacitor changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- **`signOut(options?: SignOutOptions)` now resolves `Promise<SignOutResult>`** (`{ revoked: boolean; activeSessionId?: string }`)
|
|
7
|
+
instead of `Promise<void>`, and revokes the session on the Frontend API (it used to only clear local state). Existing
|
|
8
|
+
`await atlas.signOut()` call sites keep working. The revoke is authenticated as the session being dropped, retried once,
|
|
9
|
+
then re-tried in the background (a 401 from an expired JWT rotates it once with the refresh token). `{ strict: true }`
|
|
10
|
+
rejects with `SignOutError` (`code: 'SIGN_OUT_REVOKE_FAILED'`, `sessionId`, `status`) after the local sign-out.
|
|
11
|
+
`activeSessionId` (a server-promoted session) is reported but not adopted: the bearer revoke never returns a credential
|
|
12
|
+
for it.
|
|
13
|
+
- **A signed-out session is never re-adopted.** Its id is remembered (a tombstone, via `SignOutGuard` from
|
|
14
|
+
`@atlasauth/js`) in the platform store before the revoke; the next app start refuses a stored session that is tombstoned
|
|
15
|
+
(and clears it), and a refresh still in flight at sign-out can no longer write the session back or resurrect it in
|
|
16
|
+
memory. A refused session's revoke is re-tried in the background and its tombstone dropped once the server confirms.
|
|
17
|
+
- `getToken()` / `authHeaders()` return no bearer for a session signed out while a refresh was in flight; `onChange()`
|
|
18
|
+
listeners are not called for a signed-out session.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- `CreateAtlasCapacitorConfig.tombstoneStore?: TombstoneStore` (default: `@capacitor/preferences` when present, else the
|
|
22
|
+
WebView's `localStorage`) and `CreateAtlasCapacitorConfig.signOutRetryDelaysMs?: number[]`.
|
|
23
|
+
- `createPreferencesTombstoneStore(preferences)` and `tombstoneStoreFromTokenStore(store)` adapters.
|
|
24
|
+
- `NativeSessionConfig.refuse?: (session: NativeSession) => boolean` on `createNativeSessionManager()`.
|
|
25
|
+
- Re-exports `SignOutError`, `SignOutOptions`, `SignOutResult` and `TombstoneStore` from `@atlasauth/js`.
|
|
26
|
+
|
|
27
|
+
## 0.1.1
|
|
28
|
+
- **`frontendApi` is validated at `createAtlasCapacitor()`.** A missing, empty or malformed value now throws an
|
|
29
|
+
`AtlasConfigError` (from `@atlasauth/js`; `code: 'FRONTEND_API_REQUIRED'` or `'FRONTEND_API_INVALID'`)
|
|
30
|
+
instead of silently sending requests to relative URLs on the app's own origin. Accepted: an absolute
|
|
31
|
+
`https:` URL (`http:` only for localhost / local development hosts). Native apps have no origin of their own, so `"same-origin"` is refused. A trailing slash is now normalised away.
|
|
32
|
+
|
|
33
|
+
## 0.1.0
|
|
34
|
+
|
|
35
|
+
First published release.
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- `createAtlasCapacitor()` sets up native sign-in for Capacitor / Ionic apps on iOS, Android and web.
|
|
39
|
+
- System-browser sign-in with deep-link callback and PKCE: `signInWithBrowser()`, `completeRedirectSignIn()`, `buildAuthorizeUrl()`, `parseAuthCallback()`, `redeemAuthorizationCode()`, `exchangeAuthCode()`.
|
|
40
|
+
- Cookie-free native session that auto-refreshes and persists: `createNativeSessionManager()`, `clearNativeSession()`, plus re-exported `NativeSessionManager`, `exchangeForSession`, `refreshNativeSession`.
|
|
41
|
+
- Token stores: `createPreferencesTokenStore()` (backed by `@capacitor/preferences`) and `createInMemoryTokenStore()`.
|
|
42
|
+
- PKCE helpers `createPkcePair()` and `createState()`.
|
|
43
|
+
- `loadCapacitorPlugins()` / `isNativePlatform()`; all `@capacitor/*` plugins are optional peers with graceful fallback.
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* (the sign-in flow, the token store, the PKCE helpers) is exposed for apps that
|
|
17
17
|
* want to drive the pieces themselves.
|
|
18
18
|
*/
|
|
19
|
-
import type
|
|
19
|
+
import { NativeSessionManager, type NativeSession, type SignOutOptions, type SignOutResult, type TombstoneStore } from '@atlasauth/js';
|
|
20
20
|
import { type CapacitorPlugins } from './plugins';
|
|
21
21
|
import { type SignInOutcome } from './sign-in';
|
|
22
22
|
import { type TokenStore } from './token-store';
|
|
@@ -40,6 +40,19 @@ export interface CreateAtlasCapacitorConfig {
|
|
|
40
40
|
storage?: TokenStore;
|
|
41
41
|
/** Where the transient PKCE material is stashed on the WEB redirect path. */
|
|
42
42
|
pkceStore?: TokenStore;
|
|
43
|
+
/**
|
|
44
|
+
* Where the ids of sessions this app signed out of are kept, so a restart
|
|
45
|
+
* never re-adopts one (even when the revoke never reached the server).
|
|
46
|
+
* Defaults to `@capacitor/preferences` when present, else the WebView's
|
|
47
|
+
* `localStorage`. Adapt a secure-storage {@link TokenStore} with
|
|
48
|
+
* `tombstoneStoreFromTokenStore()` (give it its own slot).
|
|
49
|
+
*/
|
|
50
|
+
tombstoneStore?: TombstoneStore;
|
|
51
|
+
/**
|
|
52
|
+
* Delays (ms) between background re-tries of a revoke `signOut()` could not
|
|
53
|
+
* complete. @default `[15_000, 60_000, 300_000]`
|
|
54
|
+
*/
|
|
55
|
+
signOutRetryDelaysMs?: number[];
|
|
43
56
|
/** Inject the Capacitor plugins (tests). Defaults to a lazy, guarded load. */
|
|
44
57
|
plugins?: CapacitorPlugins;
|
|
45
58
|
/** Injectable for tests; defaults to the platform `fetch`. */
|
|
@@ -75,8 +88,18 @@ export interface AtlasCapacitor {
|
|
|
75
88
|
* (or null when there is nothing to complete).
|
|
76
89
|
*/
|
|
77
90
|
handleRedirectCallback(url?: string): Promise<NativeSession | null>;
|
|
78
|
-
/**
|
|
79
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Sign out: remember the session id (so nothing re-adopts it — not a refresh
|
|
93
|
+
* in flight, not the next app start), revoke it on the Frontend API (retried
|
|
94
|
+
* once, then in the background, authenticated as the dropped session), and
|
|
95
|
+
* forget it locally. Resolves `{ revoked }` — `false` when the server could
|
|
96
|
+
* not be reached (the app is signed out regardless). With `{ strict: true }`
|
|
97
|
+
* it rejects with a `SignOutError` instead, after the local sign-out.
|
|
98
|
+
*
|
|
99
|
+
* A bearer client never gets a server-promoted session's credential back from
|
|
100
|
+
* the revoke, so `activeSessionId` is reported (when present) but not adopted.
|
|
101
|
+
*/
|
|
102
|
+
signOut(options?: SignOutOptions): Promise<SignOutResult>;
|
|
80
103
|
/** The current session JWT, auto-refreshed near expiry; null when signed out. */
|
|
81
104
|
getToken(): Promise<string | null>;
|
|
82
105
|
/** The headers an authenticated `/v1/client/me/*` call needs (bearer + pk). */
|
|
@@ -109,6 +132,7 @@ export interface AtlasCapacitor {
|
|
|
109
132
|
* ```
|
|
110
133
|
*/
|
|
111
134
|
export declare function createAtlasCapacitor(config: CreateAtlasCapacitorConfig): Promise<AtlasCapacitor>;
|
|
135
|
+
export { SignOutError, type SignOutOptions, type SignOutResult, type TombstoneStore, } from '@atlasauth/js';
|
|
112
136
|
export * from './plugins';
|
|
113
137
|
export * from './pkce';
|
|
114
138
|
export * from './token-store';
|
package/dist/index.js
CHANGED
|
@@ -32,8 +32,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
32
32
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.refreshNativeSession = exports.exchangeForSession = exports.NativeSessionManager = exports.clearNativeSession = exports.createNativeSessionManager = void 0;
|
|
35
|
+
exports.refreshNativeSession = exports.exchangeForSession = exports.NativeSessionManager = exports.clearNativeSession = exports.createNativeSessionManager = exports.SignOutError = void 0;
|
|
36
36
|
exports.createAtlasCapacitor = createAtlasCapacitor;
|
|
37
|
+
const js_1 = require("@atlasauth/js");
|
|
37
38
|
const plugins_1 = require("./plugins");
|
|
38
39
|
const sign_in_1 = require("./sign-in");
|
|
39
40
|
const token_store_1 = require("./token-store");
|
|
@@ -59,6 +60,14 @@ const native_session_1 = require("./native-session");
|
|
|
59
60
|
* ```
|
|
60
61
|
*/
|
|
61
62
|
async function createAtlasCapacitor(config) {
|
|
63
|
+
// Validated (and normalised — no trailing slash) before anything else: a
|
|
64
|
+
// missing value, "same-origin" or a bare path throws an `AtlasConfigError`.
|
|
65
|
+
// The OAuth URLs below are built from it, and a native app has no origin of
|
|
66
|
+
// its own to resolve a relative one against.
|
|
67
|
+
const frontendApi = (0, js_1.resolveFrontendApi)(config.frontendApi, {
|
|
68
|
+
component: 'createAtlasCapacitor()',
|
|
69
|
+
allowSameOrigin: false,
|
|
70
|
+
});
|
|
62
71
|
const plugins = config.plugins ?? (await (0, plugins_1.loadCapacitorPlugins)());
|
|
63
72
|
const storage = config.storage ??
|
|
64
73
|
(plugins.Preferences
|
|
@@ -68,14 +77,68 @@ async function createAtlasCapacitor(config) {
|
|
|
68
77
|
(plugins.Preferences
|
|
69
78
|
? (0, token_store_1.createPreferencesTokenStore)(plugins.Preferences, sign_in_1.PKCE_STASH_KEY)
|
|
70
79
|
: (0, token_store_1.createInMemoryTokenStore)());
|
|
80
|
+
const doFetch = config.fetchImpl ?? ((input, init) => fetch(input, init));
|
|
81
|
+
/**
|
|
82
|
+
* A Frontend API request authenticated as `session` — and only it. Holds its
|
|
83
|
+
* own copy (never persisted), so a revoke re-tried after sign-out dropped the
|
|
84
|
+
* session can still authenticate: a 401 (the short-lived JWT expired) rotates
|
|
85
|
+
* it once with the refresh token and tries again.
|
|
86
|
+
*/
|
|
87
|
+
const sessionBoundRequest = (session) => {
|
|
88
|
+
const holder = new js_1.NativeSessionManager({
|
|
89
|
+
baseUrl: frontendApi,
|
|
90
|
+
publishableKey: config.publishableKey,
|
|
91
|
+
initial: session,
|
|
92
|
+
fetchImpl: config.fetchImpl,
|
|
93
|
+
now: config.now,
|
|
94
|
+
});
|
|
95
|
+
return async (path, init) => {
|
|
96
|
+
const send = async () => doFetch(`${frontendApi}${path}`, {
|
|
97
|
+
...init,
|
|
98
|
+
headers: { ...(await holder.authHeaders()), ...init?.headers },
|
|
99
|
+
});
|
|
100
|
+
const response = await send();
|
|
101
|
+
if (response.status !== 401 || !(await holder.refresh()))
|
|
102
|
+
return response;
|
|
103
|
+
return send();
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
// The sessions this app signed out of, kept in the platform store so a
|
|
107
|
+
// restart never re-adopts one. Loaded before the stored session is trusted.
|
|
108
|
+
const tombstoneStore = config.tombstoneStore ??
|
|
109
|
+
(plugins.Preferences ? (0, token_store_1.createPreferencesTombstoneStore)(plugins.Preferences) : undefined);
|
|
110
|
+
const guard = new js_1.SignOutGuard({
|
|
111
|
+
// Every revoke passes its own session-bound request; this one carries none.
|
|
112
|
+
request: (path, init) => doFetch(`${frontendApi}${path}`, {
|
|
113
|
+
...init,
|
|
114
|
+
headers: { 'x-publishable-key': config.publishableKey, ...init?.headers },
|
|
115
|
+
}),
|
|
116
|
+
frontendApi,
|
|
117
|
+
...(tombstoneStore ? { store: tombstoneStore } : {}),
|
|
118
|
+
...(config.signOutRetryDelaysMs ? { retryDelaysMs: config.signOutRetryDelaysMs } : {}),
|
|
119
|
+
});
|
|
120
|
+
await guard.ready;
|
|
71
121
|
const manager = await (0, native_session_1.createNativeSessionManager)({
|
|
72
|
-
frontendApi
|
|
122
|
+
frontendApi,
|
|
73
123
|
publishableKey: config.publishableKey,
|
|
74
124
|
clientId: config.clientId,
|
|
75
125
|
storage,
|
|
76
126
|
fetchImpl: config.fetchImpl,
|
|
77
127
|
now: config.now,
|
|
128
|
+
// Never adopt (nor write back) a session this app signed out of; a stored
|
|
129
|
+
// one is revoked again in the background, as itself.
|
|
130
|
+
refuse: (session) => guard.isSignedOut(session.sessionId) && guard.refuse(session.sessionId, sessionBoundRequest(session)),
|
|
78
131
|
});
|
|
132
|
+
// A refresh still in flight at sign-out must not put the session back in memory.
|
|
133
|
+
manager.onChange((session) => {
|
|
134
|
+
if (guard.isSignedOut(session.sessionId))
|
|
135
|
+
manager.clear();
|
|
136
|
+
});
|
|
137
|
+
const getToken = async () => {
|
|
138
|
+
const token = await manager.getToken();
|
|
139
|
+
// Signed out while a refresh was in flight: the rotated token is not ours.
|
|
140
|
+
return token && manager.current ? token : null;
|
|
141
|
+
};
|
|
79
142
|
const requireString = (value, name) => {
|
|
80
143
|
if (!value)
|
|
81
144
|
throw new Error(`Atlas: \`${name}\` is required to sign in.`);
|
|
@@ -87,7 +150,7 @@ async function createAtlasCapacitor(config) {
|
|
|
87
150
|
const clientId = requireString(options.clientId ?? config.clientId, 'clientId');
|
|
88
151
|
const redirectUri = requireString(options.redirectUri ?? config.redirectUri, 'redirectUri');
|
|
89
152
|
const outcome = await (0, sign_in_1.signInWithBrowser)({
|
|
90
|
-
frontendApi
|
|
153
|
+
frontendApi,
|
|
91
154
|
clientId,
|
|
92
155
|
redirectUri,
|
|
93
156
|
scope: options.scope ?? config.scope,
|
|
@@ -112,7 +175,7 @@ async function createAtlasCapacitor(config) {
|
|
|
112
175
|
const clientId = requireString(config.clientId, 'clientId');
|
|
113
176
|
const redirectUri = requireString(config.redirectUri, 'redirectUri');
|
|
114
177
|
const session = await (0, sign_in_1.completeRedirectSignIn)({
|
|
115
|
-
frontendApi
|
|
178
|
+
frontendApi,
|
|
116
179
|
clientId,
|
|
117
180
|
redirectUri,
|
|
118
181
|
url: landingUrl,
|
|
@@ -123,25 +186,47 @@ async function createAtlasCapacitor(config) {
|
|
|
123
186
|
manager.setSession(session);
|
|
124
187
|
return session;
|
|
125
188
|
},
|
|
126
|
-
async signOut() {
|
|
189
|
+
async signOut(options = {}) {
|
|
190
|
+
const session = manager.current;
|
|
191
|
+
// Tombstones the session synchronously, before anything below can yield;
|
|
192
|
+
// the revoke itself rides on the session being dropped.
|
|
193
|
+
const pending = session
|
|
194
|
+
? guard.revoke(session.sessionId, { ...options, request: sessionBoundRequest(session) })
|
|
195
|
+
: null;
|
|
127
196
|
manager.clear();
|
|
128
|
-
|
|
197
|
+
// The tombstone already keeps a restart from re-adopting a session this
|
|
198
|
+
// clear fails to remove, so a store error does not fail the sign-out.
|
|
199
|
+
await Promise.resolve()
|
|
200
|
+
.then(() => (0, native_session_1.clearNativeSession)(storage))
|
|
201
|
+
.catch(() => undefined);
|
|
202
|
+
// Nothing to revoke when signed out (a bearer client has no cookie to find one by).
|
|
203
|
+
const attempt = pending ? await pending : { sessionId: null, outcome: { revoked: true, status: 200 } };
|
|
204
|
+
// A promoted session (`activeSessionId`) comes with cookies only — the
|
|
205
|
+
// bearer revoke never hands this client a credential for it — so it is
|
|
206
|
+
// reported, not adopted.
|
|
207
|
+
return guard.settle(attempt, options);
|
|
129
208
|
},
|
|
130
|
-
getToken
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
209
|
+
getToken,
|
|
210
|
+
async authHeaders() {
|
|
211
|
+
const token = await getToken();
|
|
212
|
+
return token
|
|
213
|
+
? { Authorization: `Bearer ${token}`, 'x-publishable-key': config.publishableKey }
|
|
214
|
+
: { 'x-publishable-key': config.publishableKey };
|
|
135
215
|
},
|
|
136
216
|
getSession() {
|
|
137
217
|
return manager.current;
|
|
138
218
|
},
|
|
139
219
|
onChange(listener) {
|
|
140
|
-
return manager.onChange(
|
|
220
|
+
return manager.onChange((session) => {
|
|
221
|
+
if (!guard.isSignedOut(session.sessionId))
|
|
222
|
+
listener(session);
|
|
223
|
+
});
|
|
141
224
|
},
|
|
142
225
|
};
|
|
143
226
|
}
|
|
144
227
|
// ── Re-exports: the pieces, for apps that drive the flow themselves ──────────
|
|
228
|
+
var js_2 = require("@atlasauth/js");
|
|
229
|
+
Object.defineProperty(exports, "SignOutError", { enumerable: true, get: function () { return js_2.SignOutError; } });
|
|
145
230
|
__exportStar(require("./plugins"), exports);
|
|
146
231
|
__exportStar(require("./pkce"), exports);
|
|
147
232
|
__exportStar(require("./token-store"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;;AAkJH,oDAqLC;AArUD,sCASuB;AACvB,uCAImB;AACnB,uCAKmB;AACnB,+CAMuB;AACvB,qDAAkF;AAgGlF;;;;;;;;;;;;;;;;;;;GAmBG;AACI,KAAK,UAAU,oBAAoB,CACxC,MAAkC;IAElC,yEAAyE;IACzE,4EAA4E;IAC5E,4EAA4E;IAC5E,6CAA6C;IAC7C,MAAM,WAAW,GAAG,IAAA,uBAAkB,EAAC,MAAM,CAAC,WAAW,EAAE;QACzD,SAAS,EAAE,wBAAwB;QACnC,eAAe,EAAE,KAAK;KACvB,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,IAAA,8BAAoB,GAAE,CAAC,CAAC;IAEjE,MAAM,OAAO,GACX,MAAM,CAAC,OAAO;QACd,CAAC,OAAO,CAAC,WAAW;YAClB,CAAC,CAAC,IAAA,yCAA2B,EAAC,OAAO,CAAC,WAAW,EAAE,iCAAmB,CAAC;YACvE,CAAC,CAAC,IAAA,sCAAwB,GAAE,CAAC,CAAC;IAElC,MAAM,SAAS,GACb,MAAM,CAAC,SAAS;QAChB,CAAC,OAAO,CAAC,WAAW;YAClB,CAAC,CA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A;AAC1B,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA;AACpB,oHAAA,kBAAkB,OAAA;AAClB,sHAAA,oBAAoB,OAAA"}
|
package/dist/native-session.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* session id the refresh call needs and the current JWT. Give the native session
|
|
13
13
|
* its OWN store/key, separate from any other value the app keeps.
|
|
14
14
|
*/
|
|
15
|
-
import { NativeSessionManager } from '@atlasauth/js';
|
|
15
|
+
import { NativeSessionManager, type NativeSession } from '@atlasauth/js';
|
|
16
16
|
import { type TokenStore } from './token-store';
|
|
17
17
|
export interface NativeSessionConfig {
|
|
18
18
|
/** The instance's FAPI origin, e.g. `https://fapi.acme.atlasauth.net`. */
|
|
@@ -31,6 +31,14 @@ export interface NativeSessionConfig {
|
|
|
31
31
|
fetchImpl?: typeof fetch;
|
|
32
32
|
/** Injectable clock, epoch ms. Defaults to `Date.now`. */
|
|
33
33
|
now?: () => number;
|
|
34
|
+
/**
|
|
35
|
+
* Asked before a session is adopted from the store on boot, and before a
|
|
36
|
+
* (rotated) session is persisted. Return true for a session the app signed
|
|
37
|
+
* out of: it is not seeded (and is cleared from the store), nor written back
|
|
38
|
+
* by a refresh that was still in flight at sign-out. `createAtlasCapacitor`
|
|
39
|
+
* wires this to its `SignOutGuard`.
|
|
40
|
+
*/
|
|
41
|
+
refuse?: (session: NativeSession) => boolean;
|
|
34
42
|
}
|
|
35
43
|
/**
|
|
36
44
|
* Build a {@link NativeSessionManager} wired to a Capacitor token store.
|
package/dist/native-session.js
CHANGED
|
@@ -28,10 +28,24 @@ const token_store_1 = require("./token-store");
|
|
|
28
28
|
* store via the manager's `persist` hook.
|
|
29
29
|
*/
|
|
30
30
|
async function createNativeSessionManager(config) {
|
|
31
|
+
// A native app has no origin of its own, so "same-origin" / a bare path is
|
|
32
|
+
// refused along with a missing value.
|
|
33
|
+
const baseUrl = (0, js_1.resolveFrontendApi)(config.frontendApi, {
|
|
34
|
+
component: 'createNativeSessionManager()',
|
|
35
|
+
allowSameOrigin: false,
|
|
36
|
+
});
|
|
31
37
|
const storage = config.storage ?? (0, token_store_1.createInMemoryTokenStore)();
|
|
32
|
-
|
|
38
|
+
let initial = (0, js_1.parseNativeSession)(await storage.getToken()) ?? undefined;
|
|
39
|
+
if (initial && config.refuse?.(initial)) {
|
|
40
|
+
// A session this app signed out of (the clear never landed, or a refresh
|
|
41
|
+
// in flight at sign-out wrote it back): boot signed out.
|
|
42
|
+
initial = undefined;
|
|
43
|
+
await Promise.resolve()
|
|
44
|
+
.then(() => storage.clearToken())
|
|
45
|
+
.catch(() => undefined);
|
|
46
|
+
}
|
|
33
47
|
return new js_1.NativeSessionManager({
|
|
34
|
-
baseUrl
|
|
48
|
+
baseUrl,
|
|
35
49
|
publishableKey: config.publishableKey,
|
|
36
50
|
clientId: config.clientId,
|
|
37
51
|
initial,
|
|
@@ -41,6 +55,8 @@ async function createNativeSessionManager(config) {
|
|
|
41
55
|
// the rotated refresh token survives an app restart. Fire-and-forget — the
|
|
42
56
|
// store may be async, and a write failure must not break the live session.
|
|
43
57
|
persist: (session) => {
|
|
58
|
+
if (config.refuse?.(session))
|
|
59
|
+
return;
|
|
44
60
|
void Promise.resolve(storage.setToken((0, js_1.serializeNativeSession)(session))).catch(() => undefined);
|
|
45
61
|
},
|
|
46
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-session.js","sourceRoot":"","sources":["../src/native-session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;
|
|
1
|
+
{"version":3,"file":"native-session.js","sourceRoot":"","sources":["../src/native-session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AA8CH,gEAqCC;AAGD,gDAEC;AAtFD,sCAMuB;AACvB,+CAA0E;AA6B1E;;;;;;;GAOG;AACI,KAAK,UAAU,0BAA0B,CAC9C,MAA2B;IAE3B,2EAA2E;IAC3E,sCAAsC;IACtC,MAAM,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,OAAO,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC;AAED,oCAKuB;AAJrB,0GAAA,oBAAoB,OAAA;AACpB,wGAAA,kBAAkB,OAAA;AAClB,0GAAA,oBAAoB,OAAA"}
|
package/dist/token-store.d.ts
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* `capacitor-secure-storage-plugin` — behind this same {@link TokenStore}
|
|
21
21
|
* interface. See {@link createPreferencesTokenStore} for the drop-in shape.
|
|
22
22
|
*/
|
|
23
|
+
import type { TombstoneStore } from '@atlasauth/js';
|
|
23
24
|
import type { PreferencesPlugin } from './plugins';
|
|
24
25
|
/**
|
|
25
26
|
* A single-slot token store: read, write, clear one string value. This is the
|
|
@@ -61,3 +62,16 @@ export declare function createPreferencesTokenStore(preferences: PreferencesPlug
|
|
|
61
62
|
* adapter) in production.
|
|
62
63
|
*/
|
|
63
64
|
export declare function createInMemoryTokenStore(): TokenStore;
|
|
65
|
+
/**
|
|
66
|
+
* A {@link TombstoneStore} over `@capacitor/preferences` — where the ids of the
|
|
67
|
+
* sessions this app signed out of are kept, so a restart never re-adopts one
|
|
68
|
+
* (see `SignOutGuard` in `@atlasauth/js`). The default when the plugin is
|
|
69
|
+
* present. Tombstones are session ids, never credentials, so plaintext is fine.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createPreferencesTombstoneStore(preferences: PreferencesPlugin): TombstoneStore;
|
|
72
|
+
/**
|
|
73
|
+
* Adapt a single-slot {@link TokenStore} (e.g. a secure-storage-backed one) to
|
|
74
|
+
* a {@link TombstoneStore}. Give it its OWN slot — never the session's: the
|
|
75
|
+
* key `SignOutGuard` asks for is ignored, every read and write hits that slot.
|
|
76
|
+
*/
|
|
77
|
+
export declare function tombstoneStoreFromTokenStore(store: TokenStore): TombstoneStore;
|
package/dist/token-store.js
CHANGED
|
@@ -25,6 +25,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.DEFAULT_SESSION_KEY = void 0;
|
|
26
26
|
exports.createPreferencesTokenStore = createPreferencesTokenStore;
|
|
27
27
|
exports.createInMemoryTokenStore = createInMemoryTokenStore;
|
|
28
|
+
exports.createPreferencesTombstoneStore = createPreferencesTombstoneStore;
|
|
29
|
+
exports.tombstoneStoreFromTokenStore = tombstoneStoreFromTokenStore;
|
|
28
30
|
/** The default key the serialized native session is stored under. */
|
|
29
31
|
exports.DEFAULT_SESSION_KEY = 'atlas.native_session';
|
|
30
32
|
/**
|
|
@@ -67,4 +69,27 @@ function createInMemoryTokenStore() {
|
|
|
67
69
|
},
|
|
68
70
|
};
|
|
69
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* A {@link TombstoneStore} over `@capacitor/preferences` — where the ids of the
|
|
74
|
+
* sessions this app signed out of are kept, so a restart never re-adopts one
|
|
75
|
+
* (see `SignOutGuard` in `@atlasauth/js`). The default when the plugin is
|
|
76
|
+
* present. Tombstones are session ids, never credentials, so plaintext is fine.
|
|
77
|
+
*/
|
|
78
|
+
function createPreferencesTombstoneStore(preferences) {
|
|
79
|
+
return {
|
|
80
|
+
getItem: async (key) => (await preferences.get({ key })).value ?? null,
|
|
81
|
+
setItem: (key, value) => preferences.set({ key, value }),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Adapt a single-slot {@link TokenStore} (e.g. a secure-storage-backed one) to
|
|
86
|
+
* a {@link TombstoneStore}. Give it its OWN slot — never the session's: the
|
|
87
|
+
* key `SignOutGuard` asks for is ignored, every read and write hits that slot.
|
|
88
|
+
*/
|
|
89
|
+
function tombstoneStoreFromTokenStore(store) {
|
|
90
|
+
return {
|
|
91
|
+
getItem: () => store.getToken(),
|
|
92
|
+
setItem: (_key, value) => store.setToken(value),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
70
95
|
//# sourceMappingURL=token-store.js.map
|
package/dist/token-store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-store.js","sourceRoot":"","sources":["../src/token-store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,IAAI;QACtE,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;KACzD,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,4BAA4B,CAAC,KAAiB;IAC5D,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE;QAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;KAChD,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/capacitor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./package.json": "./package.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@atlasauth/js": "0.
|
|
14
|
+
"@atlasauth/js": "0.8.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@capacitor/core": ">=6",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
48
|
"dist",
|
|
49
|
-
"README.md"
|
|
49
|
+
"README.md",
|
|
50
|
+
"CHANGELOG.md"
|
|
50
51
|
],
|
|
51
52
|
"scripts": {
|
|
52
53
|
"build": "tsc -p tsconfig.build.json",
|