- Introduced new HTTP authentication and page management APIs, allowing for the creation, retrieval, updating, and deletion of HTTP auth profiles and pages. - Added validation for auth and page fields to ensure proper configuration and error handling. - Implemented a mechanism for resolving auth credentials from various sources, including inline definitions, KV store, and secrets. - Enhanced workflow validation to include checks for HTTP triggers, ensuring proper auth and response configurations. - Updated the web interface to include new routes for managing HTTP auth profiles and pages, improving user experience and accessibility.
34 lines
1.0 KiB
JavaScript
34 lines
1.0 KiB
JavaScript
/**
|
|
* @param {import("knex").Knex} knex
|
|
*/
|
|
export async function up(knex) {
|
|
await knex.schema.createTable("http_pages", (t) => {
|
|
t.text("id").primary();
|
|
t.text("name").notNullable().unique();
|
|
t.text("content").notNullable();
|
|
t.text("mime").notNullable(); // html | json
|
|
t.integer("status").notNullable().defaultTo(200);
|
|
t.text("created_at").notNullable();
|
|
t.text("updated_at").notNullable();
|
|
});
|
|
|
|
await knex.schema.createTable("http_auths", (t) => {
|
|
t.text("id").primary();
|
|
t.text("name").notNullable().unique();
|
|
t.text("type").notNullable(); // bearer | basic | header
|
|
t.text("config").notNullable(); // JSON
|
|
t.integer("unauthorized_status").nullable();
|
|
t.text("unauthorized_response").nullable();
|
|
t.text("created_at").notNullable();
|
|
t.text("updated_at").notNullable();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @param {import("knex").Knex} knex
|
|
*/
|
|
export async function down(knex) {
|
|
await knex.schema.dropTableIfExists("http_auths");
|
|
await knex.schema.dropTableIfExists("http_pages");
|
|
}
|