mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-14 22:01:17 +01:00
Add credentials parameter to FeedSourceProvider.feedSourceForUser so providers can receive decrypted per-user credentials (OAuth tokens, passwords) from the user_sources table. Wire CredentialEncryptor into UserSessionManager to handle encrypt/decrypt. Providers receive plaintext and handle validation internally. Existing providers ignore the new parameter. Co-authored-by: Ona <no-reply@ona.com>
13 lines
510 B
TypeScript
13 lines
510 B
TypeScript
import type { FeedSource } from "@aelis/core"
|
|
import type { type } from "arktype"
|
|
|
|
export type ConfigSchema = ReturnType<typeof type>
|
|
|
|
export interface FeedSourceProvider {
|
|
/** The source ID this provider is responsible for (e.g., "aelis.location"). */
|
|
readonly sourceId: string
|
|
/** Arktype schema for validating user-provided config. Omit if the source has no config. */
|
|
readonly configSchema?: ConfigSchema
|
|
feedSourceForUser(userId: string, config: unknown, credentials: unknown): Promise<FeedSource>
|
|
}
|