diff --git a/apps/demo/CHANGELOG.md b/apps/demo/CHANGELOG.md index d472eb0..8055a42 100644 --- a/apps/demo/CHANGELOG.md +++ b/apps/demo/CHANGELOG.md @@ -1,5 +1,11 @@ # @authhero/demo +## 0.0.8 + +### Patch Changes + +- authhero@0.2.10 + ## 0.0.7 ### Patch Changes diff --git a/apps/demo/package.json b/apps/demo/package.json index 1c6482d..cc857f3 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -1,7 +1,7 @@ { "name": "@authhero/demo", "private": true, - "version": "0.0.7", + "version": "0.0.8", "scripts": { "dev": "bun --watch src/bun.ts" }, diff --git a/packages/adapter-interfaces/CHANGELOG.md b/packages/adapter-interfaces/CHANGELOG.md index b73a791..9b6c3f1 100644 --- a/packages/adapter-interfaces/CHANGELOG.md +++ b/packages/adapter-interfaces/CHANGELOG.md @@ -1,5 +1,15 @@ # @authhero/adapter-interfaces +## 0.11.0 + +### Minor Changes + +- Add the addons property + +### Patch Changes + +- Update the applications schema to handle addOns + ## 0.10.5 ### Patch Changes diff --git a/packages/adapter-interfaces/package.json b/packages/adapter-interfaces/package.json index 64897a8..9b62ddc 100644 --- a/packages/adapter-interfaces/package.json +++ b/packages/adapter-interfaces/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.10.5", + "version": "0.11.0", "files": [ "dist" ], diff --git a/packages/adapter-interfaces/src/adapters/Applications.ts b/packages/adapter-interfaces/src/adapters/Applications.ts index 20e79e6..198e927 100644 --- a/packages/adapter-interfaces/src/adapters/Applications.ts +++ b/packages/adapter-interfaces/src/adapters/Applications.ts @@ -10,6 +10,7 @@ export interface CreateApplicationParams { client_secret: string; id: string; disable_sign_ups: boolean; + addons?: Record>; } export interface ApplicationsAdapter { diff --git a/packages/adapter-interfaces/src/types/Application.ts b/packages/adapter-interfaces/src/types/Application.ts index 080d60e..a177967 100644 --- a/packages/adapter-interfaces/src/types/Application.ts +++ b/packages/adapter-interfaces/src/types/Application.ts @@ -3,6 +3,38 @@ import { z } from "@hono/zod-openapi"; export const applicationInsertSchema = z.object({ id: z.string(), name: z.string(), + callbacks: z + .string() + .transform((val) => (val === null ? "" : val)) + .default("") + .openapi({ + description: + "Comma-separated list of URLs whitelisted to use as a callback to the client after authentication.", + }), + allowed_origins: z + .string() + .transform((val) => (val === null ? "" : val)) + .default("") + .openapi({ + description: + "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs.", + }), + web_origins: z + .string() + .transform((val) => (val === null ? "" : val)) + .default("") + .openapi({ + description: + "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.", + }), + addons: z + .record(z.string(), z.record(z.string(), z.union([z.string(), z.number()]))) + .optional() + .openapi({ + description: + "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon.", + }), + // @deprecated. Renamed to match the auth0 API allowed_web_origins: z .string() .transform((val) => (val === null ? "" : val)) @@ -17,9 +49,16 @@ export const applicationInsertSchema = z.object({ .default(""), email_validation: z .enum(["enabled", "disabled", "enforced"]) - .default("enforced"), + .default("enforced") + .openapi({ + description: + "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0", + }), client_secret: z.string().default(""), - disable_sign_ups: z.boolean().default(false), + disable_sign_ups: z.boolean().default(false).openapi({ + description: + "Prevents users from signing up using the hosted login page. This is not available in auth0", + }), }); export type ApplicationInsert = z.infer; diff --git a/packages/adapter-interfaces/src/types/AuthParams.ts b/packages/adapter-interfaces/src/types/AuthParams.ts index 746531e..8f29008 100644 --- a/packages/adapter-interfaces/src/types/AuthParams.ts +++ b/packages/adapter-interfaces/src/types/AuthParams.ts @@ -11,6 +11,7 @@ export enum AuthorizationResponseMode { FRAGMENT = "fragment", FORM_POST = "form_post", WEB_MESSAGE = "web_message", + SAML_POST = "saml_post", } export enum CodeChallengeMethod { diff --git a/packages/authhero/CHANGELOG.md b/packages/authhero/CHANGELOG.md index c509ad5..0eec8c8 100644 --- a/packages/authhero/CHANGELOG.md +++ b/packages/authhero/CHANGELOG.md @@ -1,5 +1,13 @@ # authhero +## 0.2.10 + +### Patch Changes + +- Updated dependencies +- Updated dependencies + - @authhero/adapter-interfaces@0.11.0 + ## 0.2.9 ### Patch Changes diff --git a/packages/authhero/package.json b/packages/authhero/package.json index b1c2dc2..e1db45c 100644 --- a/packages/authhero/package.json +++ b/packages/authhero/package.json @@ -1,6 +1,6 @@ { "name": "authhero", - "version": "0.2.9", + "version": "0.2.10", "files": [ "dist" ], diff --git a/packages/drizzle/CHANGELOG.md b/packages/drizzle/CHANGELOG.md index e6c284e..306b11e 100644 --- a/packages/drizzle/CHANGELOG.md +++ b/packages/drizzle/CHANGELOG.md @@ -1,5 +1,13 @@ # @authhero/drizzle +## 0.1.26 + +### Patch Changes + +- Updated dependencies +- Updated dependencies + - @authhero/adapter-interfaces@0.11.0 + ## 0.1.25 ### Patch Changes diff --git a/packages/drizzle/package.json b/packages/drizzle/package.json index fb8a318..3535aa1 100644 --- a/packages/drizzle/package.json +++ b/packages/drizzle/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.1.25", + "version": "0.1.26", "files": [ "dist" ], diff --git a/packages/kysely/CHANGELOG.md b/packages/kysely/CHANGELOG.md index b14ad05..cbeba32 100644 --- a/packages/kysely/CHANGELOG.md +++ b/packages/kysely/CHANGELOG.md @@ -1,5 +1,17 @@ # @authhero/kysely-adapter +## 0.7.0 + +### Minor Changes + +- Add the addons property + +### Patch Changes + +- Updated dependencies +- Updated dependencies + - @authhero/adapter-interfaces@0.11.0 + ## 0.6.11 ### Patch Changes diff --git a/packages/kysely/package.json b/packages/kysely/package.json index 729359a..4201605 100644 --- a/packages/kysely/package.json +++ b/packages/kysely/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.6.11", + "version": "0.7.0", "files": [ "dist" ], diff --git a/packages/kysely/src/applications/create.ts b/packages/kysely/src/applications/create.ts index 16afc6d..82340ad 100644 --- a/packages/kysely/src/applications/create.ts +++ b/packages/kysely/src/applications/create.ts @@ -15,6 +15,7 @@ export function create(db: Kysely) { updated_at: new Date().toISOString(), ...params, disable_sign_ups: params.disable_sign_ups ? 1 : 0, + addons: params.addons ? JSON.stringify(params.addons) : null, }; await db diff --git a/packages/kysely/src/applications/get.ts b/packages/kysely/src/applications/get.ts index 138aab4..c5d5aac 100644 --- a/packages/kysely/src/applications/get.ts +++ b/packages/kysely/src/applications/get.ts @@ -20,6 +20,9 @@ export function get(db: Kysely) { } application.disable_sign_ups = !!application.disable_sign_ups; + application.addons = application.addons + ? JSON.parse(application.addons) + : {}; return removeNullProperties(application); }; diff --git a/packages/kysely/src/applications/list.ts b/packages/kysely/src/applications/list.ts index a3371bb..32ff15b 100644 --- a/packages/kysely/src/applications/list.ts +++ b/packages/kysely/src/applications/list.ts @@ -8,7 +8,12 @@ export function list(db: Kysely) { .selectFrom("applications") .where("applications.tenant_id", "=", tenantId); - const applications: Application[] = await query.selectAll().execute(); + const results = await query.selectAll().execute(); + const applications: Application[] = results.map((result) => ({ + ...result, + disable_sign_ups: !!result.disable_sign_ups, + addons: result.addons ? JSON.parse(result.addons) : {}, + })); return { applications, diff --git a/packages/kysely/src/db.ts b/packages/kysely/src/db.ts index 50e24fc..50d7c89 100644 --- a/packages/kysely/src/db.ts +++ b/packages/kysely/src/db.ts @@ -4,6 +4,7 @@ import { SqlAuthenticationCode } from "./authenticationCodes/AuthenticationCode" import { SqlUser } from "./users/User"; import { Application, + applicationSchema, Certificate, Code, Connection, @@ -32,8 +33,15 @@ const sqlLoginSchema = flattenSchema(loginSchema).extend({ }); type SqlLogin = z.infer; +const sqlApplicationSchema = z.object({ + ...applicationSchema.shape, + tenant_id: z.string(), + // The addons will be stored as JSON in a text column + addons: z.string().optional(), +}); + export interface Database { - applications: Application & { tenant_id: string }; + applications: z.infer; authentication_codes: SqlAuthenticationCode; branding: SqlBranding; codes: Code & { tenant_id: string };