@absolutejs/auth 0.26.0 → 0.27.0-beta.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.
@@ -91,8 +91,8 @@ export declare const portalRoutes: ({ emit, onScimTokenCreated, onSsoConnectionC
91
91
  oidc: {
92
92
  put: {
93
93
  body: {
94
- redirectUri?: string | undefined;
95
94
  scopes?: string[] | undefined;
95
+ redirectUri?: string | undefined;
96
96
  issuer: string;
97
97
  clientId: string;
98
98
  clientSecret: string;
@@ -0,0 +1,6 @@
1
+ import type { RedisLike } from '../stores/redis';
2
+ import type { AuthSessionStore } from './types';
3
+ export type RedisSessionClient = RedisLike & {
4
+ keys: (pattern: string) => Promise<string[]>;
5
+ };
6
+ export declare const createRedisAuthSessionStore: <UserType>(redis: RedisSessionClient, keyPrefix?: string) => AuthSessionStore<UserType>;
package/dist/types.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { CredentialsFor, NonEmptyArray, OAuth2Client, OAuth2TokenResponse, ProviderOption, ProvidersMap } from 'citra';
2
2
  import { Cookie, status as statusType, redirect as redirectType } from 'elysia';
3
3
  import { ElysiaCustomStatusResponse } from 'elysia/error';
4
+ import type { ApiKeysConfig } from './apikeys/config';
4
5
  import type { AuditConfig } from './audit/config';
5
6
  import type { AuthorizationConfig } from './authorization/config';
6
7
  import type { ComplianceConfig } from './compliance/config';
@@ -213,6 +214,13 @@ export type AuthConfig<UserType> = {
213
214
  * mounts `{scimRoute}/Users` (+ `/ServiceProviderConfig`) with per-org bearer-token auth via
214
215
  * `scimTokenStore`, and maps SCIM resources to the consumer's user store through hooks. */
215
216
  scim?: ScimConfig;
217
+ /** Machine-to-machine authentication: static API keys (`sk_…`) + the OAuth2
218
+ * client_credentials grant. When `apiClientStore` + `accessTokenStore` are set,
219
+ * mounts `{tokenRoute}` (defaults `/oauth2/token`) so registered clients can
220
+ * exchange `client_id`/`client_secret` for short-lived `at_…` access tokens.
221
+ * Pair with the exported `createApiKey` / `resolveApiPrincipal` / `hasScopes`
222
+ * helpers to issue and guard with static keys. */
223
+ apikeys?: ApiKeysConfig;
216
224
  /** First-class multi-tenancy (the WorkOS model). When present, mounts organization +
217
225
  * membership + invitation routes under `{organizationsRoute}`: list the caller's orgs, create
218
226
  * one (caller becomes owner), invite/accept/revoke by email, and list/remove members. Ties the
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.26.0",
2
+ "version": "0.27.0-beta.1",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {
@@ -11,6 +11,7 @@
11
11
  "author": "Alex Kahn",
12
12
  "scripts": {
13
13
  "build": "rm -rf dist && bun build src/index.ts src/htmx/index.ts --outdir dist --sourcemap --target=bun --external elysia && tsc --emitDeclarationOnly --project tsconfig.json",
14
+ "config": "absolute config",
14
15
  "test": "bun test",
15
16
  "format": "absolute prettier --write",
16
17
  "lint": "absolute eslint",