@chipmobilesdk/rn-auth 0.2.0 → 0.2.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/package.json +10 -9
- package/skills/sdk-rn-auth/SKILL.md +63 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipmobilesdk/rn-auth",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"private": false,
|
|
5
|
-
"license": "UNLICENSED",
|
|
6
|
-
"main": "src/index.ts",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
7
|
"types": "src/index.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"src/access",
|
|
22
22
|
"src/diagnostics",
|
|
23
23
|
"src/react",
|
|
24
|
+
"skills",
|
|
24
25
|
"README.md",
|
|
25
26
|
"CHANGELOG.md"
|
|
26
27
|
],
|
|
@@ -46,8 +47,8 @@
|
|
|
46
47
|
"engines": {
|
|
47
48
|
"node": ">=22.11.0"
|
|
48
49
|
},
|
|
49
|
-
"publishConfig": {
|
|
50
|
-
"access": "public",
|
|
51
|
-
"registry": "https://registry.npmjs.org/"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sdk-rn-auth
|
|
3
|
+
description: "Authentication via @chipmobilesdk/rn-auth: OIDC/AppAuth login, keychain token storage, access tiers, auth error handling. Use when wiring sign-in, storing tokens securely, gating features by tier, or configuring a tenant/provider."
|
|
4
|
+
metadata:
|
|
5
|
+
package: "@chipmobilesdk/rn-auth"
|
|
6
|
+
packageVersion: "0.2.0"
|
|
7
|
+
user-invocable: true
|
|
8
|
+
disable-model-invocation: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# @chipmobilesdk/rn-auth
|
|
12
|
+
|
|
13
|
+
OIDC authentication with secure token storage and an access-tier model for
|
|
14
|
+
feature gating.
|
|
15
|
+
|
|
16
|
+
## Use this when
|
|
17
|
+
|
|
18
|
+
- Wiring sign-in / sign-out
|
|
19
|
+
- Persisting tokens (must be keychain, never plain storage)
|
|
20
|
+
- Gating a feature on the user's access tier
|
|
21
|
+
- Mapping an auth failure to a user-facing message
|
|
22
|
+
- Onboarding a new tenant or identity provider
|
|
23
|
+
|
|
24
|
+
## Configuration is a contract, not options
|
|
25
|
+
|
|
26
|
+
Tenant and provider setup has prerequisites that fail at runtime, not at build time.
|
|
27
|
+
Before configuring anything, walk `## Configuration contract (LIB-010)` and
|
|
28
|
+
`## Tenant / provider prerequisite checklist (LIB-018)` in the README. Skipping the
|
|
29
|
+
checklist is the usual cause of "login works locally, fails in the new environment".
|
|
30
|
+
|
|
31
|
+
## Fail closed
|
|
32
|
+
|
|
33
|
+
`failClosedTier` exists because an unknown tier must deny access, not grant it. When
|
|
34
|
+
tier evaluation is unavailable, deny. Never default an unresolved tier to a permissive
|
|
35
|
+
value.
|
|
36
|
+
|
|
37
|
+
## Public API (v0.2.0)
|
|
38
|
+
|
|
39
|
+
Runtime:
|
|
40
|
+
|
|
41
|
+
- `createAppAuthClient(...)` — the OIDC client
|
|
42
|
+
- `createKeychainSecureStore(...)` — token persistence; `AUTH_STORAGE_KEY`
|
|
43
|
+
- `evaluateAccessTier(...)`, `failClosedTier` — feature gating
|
|
44
|
+
- `AuthProvider` — React context provider
|
|
45
|
+
|
|
46
|
+
Types: `SecureTokenStore`, `AuthProviderProps`, `AuthErrorCode`, `AuthErrorAudience`,
|
|
47
|
+
`AuthMessageMap`, `AuthMessageKey`
|
|
48
|
+
|
|
49
|
+
`AuthErrorAudience` distinguishes what may be shown to a user from what is diagnostic
|
|
50
|
+
only — never render a diagnostic-audience message in the UI.
|
|
51
|
+
|
|
52
|
+
## Where the detail lives
|
|
53
|
+
|
|
54
|
+
Read one section of `node_modules/@chipmobilesdk/rn-auth/README.md`:
|
|
55
|
+
|
|
56
|
+
| Need | Section |
|
|
57
|
+
|---|---|
|
|
58
|
+
| First integration | `## Install (consuming app)`, `## Quick start` |
|
|
59
|
+
| Required config fields | `## Configuration contract (LIB-010)` |
|
|
60
|
+
| New tenant or IdP | `## Tenant / provider prerequisite checklist (LIB-018)` |
|
|
61
|
+
| Token handling, logging rules | `## Security & privacy` |
|
|
62
|
+
| Full export list | `## Public API` |
|
|
63
|
+
| Version/peer constraints | `## Compatibility and validation` |
|