LocalAI/core/http/auth
TLoE419 4634b87c53 feat(api): expose chat conversation CRUD endpoints (#9432)
Wire the chathistory store into the HTTP layer. New endpoints under
/api/conversations:

- GET    /api/conversations        list
- POST   /api/conversations        upsert (id in body)
- DELETE /api/conversations        delete all
- PUT    /api/conversations/bulk   replace entire set (localStorage migration)
- GET    /api/conversations/:id    fetch one
- PUT    /api/conversations/:id    upsert (id in path; path id wins over body)
- DELETE /api/conversations/:id    delete one

All endpoints scope queries to the authenticated user via getUserID(c)
- callers cannot impersonate other users by passing a user_id in the
body. The endpoints are gated behind the new chat_history feature
permission (default ON in APIFeatures), registered through the existing
RouteFeatureRegistry so the unified feature middleware picks them up
automatically.

Application.ChatHistoryStore() returns nil when DisableWebUI is set or
no persistence path is configured, in which case route registration is
skipped entirely rather than registering handlers that always 503.

Also adds the chat-history instruction entry and Swagger tag so the
endpoint surfaces in /api/instructions and /swagger.

Assisted-by: Claude:claude-opus-4-7

Signed-off-by: TLoE419 <tloemizuchizu@gmail.com>
2026-05-18 18:06:06 -07:00
..
apikeys.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
apikeys_test.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
auth_suite_test.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
branding_routes_test.go feat(branding): admin-configurable instance name, tagline, and assets (#9635) 2026-05-02 15:51:36 +02:00
db.go feat: add quota system (#9090) 2026-03-21 10:09:49 +01:00
db_nosqlite.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
db_sqlite.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
db_test.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
features.go feat(api): expose chat conversation CRUD endpoints (#9432) 2026-05-18 18:06:06 -07:00
helpers_test.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
middleware.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
middleware_test.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
models.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
oauth.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
oauth_email_decision.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
oauth_email_decision_test.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
password.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
password_test.go chore: Security hardening (#9719) 2026-05-08 16:25:45 +02:00
permissions.go feat(api): expose chat conversation CRUD endpoints (#9432) 2026-05-18 18:06:06 -07:00
quota.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
roles.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
roles_test.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
session.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
session_test.go feat: add users and authentication support (#9061) 2026-03-19 21:40:51 +01:00
usage.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
usage_test.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
users.go fix(auth): cascade user deletion across all owned data on PostgreSQL (#9702) 2026-05-07 08:28:58 +02:00
users_test.go fix(auth): cascade user deletion across all owned data on PostgreSQL (#9702) 2026-05-07 08:28:58 +02:00