feat(server): implement HTTP auth and page management functionality

- 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.
This commit is contained in:
2026-08-15 06:41:26 +07:00
parent 951e6f8371
commit d666dc001d
17 changed files with 2197 additions and 38 deletions
+48
View File
@@ -335,3 +335,51 @@ export function useKv(filters = {}) {
},
});
}
export function useHttpPages() {
return useQuery({
queryKey: ["http-pages"],
queryFn: async () => (await api.get("/http-pages")).data.pages,
});
}
export function useUpsertHttpPage() {
const qc = useQueryClient();
return useMutation({
mutationFn: async (body) => (await api.put("/http-pages", body)).data,
onSuccess: () => qc.invalidateQueries({ queryKey: ["http-pages"] }),
});
}
export function useDeleteHttpPage() {
const qc = useQueryClient();
return useMutation({
mutationFn: async (id) =>
(await api.delete(`/http-pages/${encodeURIComponent(id)}`)).data,
onSuccess: () => qc.invalidateQueries({ queryKey: ["http-pages"] }),
});
}
export function useHttpAuths() {
return useQuery({
queryKey: ["http-auths"],
queryFn: async () => (await api.get("/http-auths")).data.auths,
});
}
export function useUpsertHttpAuth() {
const qc = useQueryClient();
return useMutation({
mutationFn: async (body) => (await api.put("/http-auths", body)).data,
onSuccess: () => qc.invalidateQueries({ queryKey: ["http-auths"] }),
});
}
export function useDeleteHttpAuth() {
const qc = useQueryClient();
return useMutation({
mutationFn: async (id) =>
(await api.delete(`/http-auths/${encodeURIComponent(id)}`)).data,
onSuccess: () => qc.invalidateQueries({ queryKey: ["http-auths"] }),
});
}