mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-15 14:21:17 +01:00
feat: surface per-user credentials to feed source providers (#110)
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>
This commit is contained in:
@@ -26,7 +26,11 @@ export class WeatherSourceProvider implements FeedSourceProvider {
|
||||
this.client = options.client
|
||||
}
|
||||
|
||||
async feedSourceForUser(_userId: string, config: unknown): Promise<WeatherSource> {
|
||||
async feedSourceForUser(
|
||||
_userId: string,
|
||||
config: unknown,
|
||||
_credentials: unknown,
|
||||
): Promise<WeatherSource> {
|
||||
const parsed = weatherConfig(config)
|
||||
if (parsed instanceof type.errors) {
|
||||
throw new Error(`Invalid weather config: ${parsed.summary}`)
|
||||
|
||||
Reference in New Issue
Block a user