{"_id":"@aiquants/auth-core","_rev":"6-67cfee2ef5ca298d1d21b185b489a2d0","name":"@aiquants/auth-core","dist-tags":{"latest":"0.6.1"},"versions":{"0.1.1":{"name":"@aiquants/auth-core","version":"0.1.1","keywords":["auth","authentication","session","allowlist","typescript"],"author":{"url":"https://x.com/fehdek","name":"fehde-k"},"license":"MIT","_id":"@aiquants/auth-core@0.1.1","maintainers":[{"name":"fehde-k","email":"owner@aiquants.co.jp"},{"name":"fehde","email":"genbu0498@gmail.com"}],"dist":{"shasum":"bfd0f447ea7d9619488e525f3d26d19cf15f31f2","tarball":"https://registry.npmjs.org/@aiquants/auth-core/-/auth-core-0.1.1.tgz","fileCount":9,"integrity":"sha512-fqf56iAZt67UWUwiicI9P3jjiF1zrcjd2E6dH4VSoJD5NPrPAv4atNEkPeJ9YtBsHdToxK53dvePOPZDVaKUWg==","signatures":[{"sig":"MEUCIGD+H8mzr4Cr0qkTJxTrgYMd/NASRF2xXsFwlxSH8kDGAiEAkLMoyjdihdXGHbkr797sGIoq1slqFwGJbuAWx5/7+fE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28732},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=8.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"biome lint src/","test":"vitest run","build":"tsup","check":"biome check src/","clean":"rimraf dist","check:fix":"biome check --write src/","typecheck":"tsc --noEmit","build:watch":"tsup --watch","publish:major":"pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:minor":"pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:patch":"pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"fehde","email":"genbu0498@gmail.com"},"description":"Transport-agnostic auth core: shared session/profile types, email/domain allowlist policy, and localizable auth error messages. No framework or provider SDK dependency.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.1.8","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.1.1_1784772175872_0.6600060676870005","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aiquants/auth-core","version":"0.2.0","keywords":["auth","authentication","session","allowlist","typescript"],"author":{"url":"https://x.com/fehdek","name":"fehde-k"},"license":"MIT","_id":"@aiquants/auth-core@0.2.0","maintainers":[{"name":"fehde-k","email":"owner@aiquants.co.jp"},{"name":"fehde","email":"genbu0498@gmail.com"}],"dist":{"shasum":"7f64661488de2321d3a9c61b227722e64b62b62c","tarball":"https://registry.npmjs.org/@aiquants/auth-core/-/auth-core-0.2.0.tgz","fileCount":9,"integrity":"sha512-89+D/dXTwyJ28KuT3wQeMaRvDjveR9E+x2uVBMR3TEA+mvWe/3TTnCsmiI4htDaIP5wHZ8wXRO4hXgfRtIdyeQ==","signatures":[{"sig":"MEUCIC6PP51ZxFU3/TqW9ZXvkwXf+ZF99JE63+HeSyd4z9zgAiEAkIqfpOG6arIf+ovAnVFirmoljJqOTdVL16ZXE/5Ulus=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33325},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=8.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"biome lint src/","test":"vitest run","build":"tsup","check":"biome check src/","clean":"rimraf dist","check:fix":"biome check --write src/","typecheck":"tsc --noEmit","build:watch":"tsup --watch","publish:major":"pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:minor":"pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:patch":"pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"fehde","email":"genbu0498@gmail.com"},"description":"Transport-agnostic auth core: shared session/profile types, email/domain allowlist policy, and localizable auth error messages. No framework or provider SDK dependency.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.1.8","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.2.0_1785927592676_0.03864736417464143","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@aiquants/auth-core","version":"0.4.0","keywords":["auth","authentication","session","allowlist","typescript"],"author":{"url":"https://x.com/fehdek","name":"fehde-k"},"license":"MIT","_id":"@aiquants/auth-core@0.4.0","maintainers":[{"name":"fehde-k","email":"owner@aiquants.co.jp"},{"name":"fehde","email":"genbu0498@gmail.com"}],"dist":{"shasum":"526c3323e8f2a64c27c3166b43a3c91cbfa95487","tarball":"https://registry.npmjs.org/@aiquants/auth-core/-/auth-core-0.4.0.tgz","fileCount":9,"integrity":"sha512-z2LJy34bX0fyjyKY40BjOsDSTxYcJwj/VqTP38pEQ6TgpOxQkFo8zrjYUnkCuHH2lxlU4pPZQPwBETI8nVSNVQ==","signatures":[{"sig":"MEUCIQC5iWFUqsow6363ApqU+7ETWTmiK6aEncpI2kHDnxZrjQIgRX3AkshFDizP14l3S1VXP7qn5H6wTjieR5Hxk4J54/U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIGORsjyviqyPrxezBY6jFJUPq5jX3y4mxLP1k1p7YjN6AiEArSP+acSgATe30wybe5T+DKiQGmt7SnxRkB4QhdRNSEc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":53133},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=8.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"biome lint src/","test":"vitest run","build":"tsup","check":"biome check src/","clean":"rimraf dist","check:fix":"biome check --write src/","typecheck":"tsc --noEmit","build:watch":"tsup --watch","publish:major":"pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:minor":"pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:patch":"pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"fehde","email":"genbu0498@gmail.com"},"description":"Transport-agnostic auth core: shared session/profile types, email/domain allowlist policy, and localizable auth error messages. No framework or provider SDK dependency.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.1.8","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.4.0_1788961296795_0.3306151375229567","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@aiquants/auth-core","version":"0.5.0","keywords":["auth","authentication","session","allowlist","typescript"],"author":{"url":"https://x.com/fehdek","name":"fehde-k"},"license":"MIT","_id":"@aiquants/auth-core@0.5.0","maintainers":[{"name":"fehde-k","email":"owner@aiquants.co.jp"},{"name":"fehde","email":"genbu0498@gmail.com"}],"dist":{"shasum":"5fe09465705222c02f7f5e41b23317f717069448","tarball":"https://registry.npmjs.org/@aiquants/auth-core/-/auth-core-0.5.0.tgz","fileCount":9,"integrity":"sha512-7nuPn2W+euAwCNl1a5cJOBaFwrONqI9g3wJVXnicWihVNer2dWy/bmCSxeoDTcc2OVMAETCeLVMKfhHApY2cbg==","signatures":[{"sig":"MEUCIFK1PdBzG3XRb6k/wwOMbz0t4QzzkNydVThgDPjXsA5AAiEAoCgdbvAwOVabybRYW55bZ2nzwRxN60fssP43gnj2U8Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCICU8OayJTvgzWoABM/V2PCAwMYXXpEna2N/ZeKLBDsOnAiBkWgjS7SizwcqRW/XLCvBHeo08AR3aRlRclSbJ91dnvQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54149},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=8.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"biome lint src/","test":"vitest run","build":"tsup","check":"biome check src/","clean":"rimraf dist","check:fix":"biome check --write src/","typecheck":"tsc --noEmit","build:watch":"tsup --watch","publish:major":"pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:minor":"pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:patch":"pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"fehde","email":"genbu0498@gmail.com"},"description":"Transport-agnostic auth core: shared session/profile types, email/domain allowlist policy, and localizable auth error messages. No framework or provider SDK dependency.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.1.8","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.5.0_1788973209925_0.038286169405529424","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@aiquants/auth-core","version":"0.6.0","keywords":["auth","authentication","session","allowlist","typescript"],"author":{"url":"https://x.com/fehdek","name":"fehde-k"},"license":"MIT","_id":"@aiquants/auth-core@0.6.0","maintainers":[{"name":"fehde-k","email":"owner@aiquants.co.jp"},{"name":"fehde","email":"genbu0498@gmail.com"}],"dist":{"shasum":"afe789f95d481b073de3edb6b803f05466540c97","tarball":"https://registry.npmjs.org/@aiquants/auth-core/-/auth-core-0.6.0.tgz","fileCount":9,"integrity":"sha512-c+Od7yCP7xBiPUar58p1Lsr12lzaDSZ2p3ZQh4esDpQdTnxGrE+e42+dwwVJxIHj2WkALVjJ3Xy06s1M4y+wWA==","signatures":[{"sig":"MEQCIFplGNhKB+5SQSuU8zoOLUwpXxatbf9YWJauRWnBg6NlAiA/ZZuzqljYa/xfqcJue+ZvReVfOgEOemVwlXu79t+nVA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQC4pcNKZdpOaNR+2bmoWy4mBw7aARLFyYltxxRIPo2lMQIgCG7EnC5et2FgTv7KVJUeq8BG3zBJItvQAe2SrMDUxns=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59093},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=8.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"biome lint src/","test":"vitest run","build":"tsup","check":"biome check src/","clean":"rimraf dist","check:fix":"biome check --write src/","typecheck":"tsc --noEmit","build:watch":"tsup --watch","publish:major":"pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:minor":"pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:patch":"pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"fehde","email":"genbu0498@gmail.com"},"description":"Transport-agnostic auth core: shared session/profile types, email/domain allowlist policy, and localizable auth error messages. No framework or provider SDK dependency.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.1.8","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_0.6.0_1789030356556_0.8293607728602037","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"_id":"@aiquants/auth-core@0.6.1","dist":{"shasum":"4d0b7e8c0a694574af7deca16158b4843c17a2cf","tarball":"https://registry.npmjs.org/@aiquants/auth-core/-/auth-core-0.6.1.tgz","fileCount":7,"integrity":"sha512-+seqfdjs42Nd59KI/lPxzY6GVpYdNO0/v1GPd+m2BM7tO5EUomjbVaHrvk4p7wQ4GeFKh79axywZiL3eLD7Gew==","signatures":[{"sig":"MEUCIQDtj1RhCzuPfZHFFRNklrI6tO9UaJlegPOHO8+0eavI0QIgW74kaZ+O//8PtpawNw08nGD5GHGOrqZH7zJ+WzQ5GXc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG8y786fPn3Ufq3BeHcuUqPQu34BbenLSp2H4D8k8lIaAiEAsq/8LrMHGeRPFykZ0C4j1T2hXsg4hCi0VXg7BgLkPZU="}],"unpackedSize":16879},"main":"dist/index.js","name":"@aiquants/auth-core","types":"dist/index.d.ts","author":{"url":"https://x.com/fehdek","name":"fehde-k"},"module":"dist/index.mjs","engines":{"node":">=18.0.0","pnpm":">=8.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"license":"MIT","scripts":{"dev":"tsup --watch","lint":"biome lint src/","test":"vitest run","build":"tsup && node ../../.config/scripts/strip-dts-comments.mjs dist","check":"biome check src/","clean":"rimraf dist","check:fix":"biome check --write src/","typecheck":"tsc --noEmit","build:watch":"tsup --watch","publish:major":"pnpm run typecheck && pnpm run --if-present test && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:minor":"pnpm run typecheck && pnpm run --if-present test && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","publish:patch":"pnpm run typecheck && pnpm run --if-present test && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks","test:coverage":"vitest run --coverage"},"version":"0.6.1","_npmUser":{"name":"fehde","email":"genbu0498@gmail.com"},"keywords":["auth","authentication","session","allowlist","typescript"],"description":"Transport-agnostic auth core: shared session/profile types, email/domain allowlist policy, and localizable auth error messages. No framework or provider SDK dependency.","directories":{},"maintainers":[{"name":"fehde-k","email":"owner@aiquants.co.jp"},{"name":"fehde","email":"genbu0498@gmail.com"}],"sideEffects":false,"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","rimraf":"^6.1.2","vitest":"^4.1.8","typescript":"^5.9.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-core_0.6.1_1789684253065_0.7645667921153736"}}},"time":{"created":"2026-07-23T02:02:55.701Z","modified":"2026-09-17T22:30:53.294Z","0.1.1":"2026-07-23T02:02:56.016Z","0.2.0":"2026-08-05T10:59:52.830Z","0.4.0":"2026-09-09T13:41:36.880Z","0.5.0":"2026-09-09T17:00:10.013Z","0.6.0":"2026-09-10T08:52:36.655Z","0.6.1":"2026-09-17T22:30:53.144Z"},"author":{"url":"https://x.com/fehdek","name":"fehde-k"},"license":"MIT","keywords":["auth","authentication","session","allowlist","typescript"],"description":"Transport-agnostic auth core: shared session/profile types, email/domain allowlist policy, and localizable auth error messages. No framework or provider SDK dependency.","maintainers":[{"name":"fehde-k","email":"owner@aiquants.co.jp"},{"name":"fehde","email":"genbu0498@gmail.com"}],"readme":"# @aiquants/auth-core\n\nTransport- and provider-agnostic **authentication core**: shared session/profile types, an email/domain **allowlist** policy, and localizable auth **error messages**. No framework or Google SDK dependency — pair it with a framework adapter (`@aiquants/auth-react-router`).\n\n## Install\n\nInside this monorepo it is already wired as a pnpm workspace package:\n\n```jsonc\n\"dependencies\": { \"@aiquants/auth-core\": \"workspace:*\" }\n```\n\n## API\n\n- `AuthenticationPayload`, `GoogleProfileBase`, `SessionProfile`, `MyGoogleProfile` — the session/profile types re-homed from the app's `@coji/remix-auth-google` module augmentation so non-auth code can import them without pulling in remix-auth.\n- `emailDomainAllowlist(allowedEmails, allowedDomains)` → `(email) => boolean` — trim+lowercase normalized, logical OR of exact-email and domain match, fail-closed (throws when both lists empty). `parseAllowlistCsv(raw)` parses a comma-separated env value.\n  Domain patterns accept **both** `example.com` and `@example.com` (a leading `@` is stripped), because env values are usually written bare while admin UIs tend to teach the `@`-prefixed form. Matching is exact on the host — `example.com` never grants `evil-example.com` or `sub.example.com`.\n- `normalizeAuthEmail(email)` — the single comparison form (`trim` + `toLowerCase`) shared by the allowlist predicate, the external directory ledger, and membership matching. Two normalizers would let an address be present in one surface and absent in another with nothing raising an error.\n- `AuthUser` / `AuthGroup` / `AuthGroupMember` / `AuthAllowlistEntry` — entity types for a user/group administration surface (see `@aiquants/auth-react-router/admin`).\n  - `AuthGroup.externalLink` (`AuthGroupExternalLink`) records that an upstream directory owns the group's name and membership; `AuthGroup.readOnly` is the flag the UI acts on. Role assignment stays local, so an upstream change never grants privileges by itself.\n  - `AuthAllowlistEntry` is a discriminated union on `type`: `email` / `domain` rows carry a literal `pattern`, `group` rows carry a `groupId`. A group's address can be renamed upstream, so it is never the canonical value.\n  - `AuthAllowlistEntry.owner` says **who may edit** the row (`deployment` = immutable env-var source, `tenant` = that tenant's administrators). It is deliberately not a login-time filter: authentication happens before a tenant is resolved.\n  - `readOnly` is required on both types. Making it optional would introduce an implicit \"unset means editable\" default.\n- `AuthDirectoryStatus` — health of the external directory synchronization. `isStale` is `true` when a sync has never succeeded, because \"unknown\" is not evidence of health.\n- `defaultAuthMessages` / `AuthMessages` / `resolveAuthMessages(over?)` — the Japanese login-page error strings, overridable per app.\n\n## Session profile shape (byte-compatible contract)\n\n`SessionProfile` is the exact value persisted in the `\"__session\"` cookie under key `\"user\"`:\n\n```ts\n{ id, displayName, name: { familyName, givenName }, emails: [{ value }],\n  accessToken, refreshToken?, expirationDateMs?, provider, role? }\n```\n\n`photo` / `_json` / `photos` are intentionally excluded. Changing this shape invalidates live 30-day session cookies.\n\nMIT\n","readmeFilename":""}