feat: add gog oauth reuse for google chat
This commit is contained in:
1 parent
e83e4bf28c
commit
e4591ca120
13 files changed
+304
-13
No files matched your search
@@ -41,6 +41,9 @@ export type ChannelSetupInput = {
|
||||
oauthClientFile?: string;
|
||||
oauthRefreshToken?: string;
|
||||
oauthRefreshTokenFile?: string;
|
||||
oauthFromGog?: boolean;
|
||||
gogAccount?: string;
|
||||
gogClient?: string;
|
||||
useEnv?: boolean;
|
||||
homeserver?: string;
|
||||
userId?: string;
|
||||
|
||||
@@ -44,6 +44,9 @@ const optionNamesAdd = [
|
||||
"oauthClientFile",
|
||||
"oauthRefreshToken",
|
||||
"oauthRefreshTokenFile",
|
||||
"oauthFromGog",
|
||||
"gogAccount",
|
||||
"gogClient",
|
||||
"useEnv",
|
||||
"homeserver",
|
||||
"userId",
|
||||
@@ -187,6 +190,9 @@ export function registerChannelsCli(program: Command) {
|
||||
.option("--oauth-client-file <path>", "Google Chat OAuth client JSON file")
|
||||
.option("--oauth-refresh-token <token>", "Google Chat OAuth refresh token")
|
||||
.option("--oauth-refresh-token-file <path>", "Google Chat OAuth refresh token file")
|
||||
.option("--oauth-from-gog", "Reuse gog OAuth credentials for Google Chat", false)
|
||||
.option("--gog-account <email>", "gog account email to match refresh token")
|
||||
.option("--gog-client <client>", "gog client name to match credentials file")
|
||||
.option("--homeserver <url>", "Matrix homeserver URL")
|
||||
.option("--user-id <id>", "Matrix user ID")
|
||||
.option("--access-token <token>", "Matrix access token")
|
||||
|
||||
@@ -45,6 +45,9 @@ export function applyChannelAccountConfig(params: {
|
||||
oauthClientFile?: string;
|
||||
oauthRefreshToken?: string;
|
||||
oauthRefreshTokenFile?: string;
|
||||
oauthFromGog?: boolean;
|
||||
gogAccount?: string;
|
||||
gogClient?: string;
|
||||
useEnv?: boolean;
|
||||
homeserver?: string;
|
||||
userId?: string;
|
||||
@@ -88,6 +91,9 @@ export function applyChannelAccountConfig(params: {
|
||||
oauthClientFile: params.oauthClientFile,
|
||||
oauthRefreshToken: params.oauthRefreshToken,
|
||||
oauthRefreshTokenFile: params.oauthRefreshTokenFile,
|
||||
oauthFromGog: params.oauthFromGog,
|
||||
gogAccount: params.gogAccount,
|
||||
gogClient: params.gogClient,
|
||||
useEnv: params.useEnv,
|
||||
homeserver: params.homeserver,
|
||||
userId: params.userId,
|
||||
|
||||
@@ -42,6 +42,9 @@ export type ChannelsAddOptions = {
|
||||
oauthClientFile?: string;
|
||||
oauthRefreshToken?: string;
|
||||
oauthRefreshTokenFile?: string;
|
||||
oauthFromGog?: boolean;
|
||||
gogAccount?: string;
|
||||
gogClient?: string;
|
||||
useEnv?: boolean;
|
||||
homeserver?: string;
|
||||
userId?: string;
|
||||
@@ -216,6 +219,9 @@ export async function channelsAddCommand(
|
||||
oauthClientFile: opts.oauthClientFile,
|
||||
oauthRefreshToken: opts.oauthRefreshToken,
|
||||
oauthRefreshTokenFile: opts.oauthRefreshTokenFile,
|
||||
oauthFromGog: opts.oauthFromGog,
|
||||
gogAccount: opts.gogAccount,
|
||||
gogClient: opts.gogClient,
|
||||
homeserver: opts.homeserver,
|
||||
userId: opts.userId,
|
||||
accessToken: opts.accessToken,
|
||||
@@ -265,6 +271,9 @@ export async function channelsAddCommand(
|
||||
oauthClientFile: opts.oauthClientFile,
|
||||
oauthRefreshToken: opts.oauthRefreshToken,
|
||||
oauthRefreshTokenFile: opts.oauthRefreshTokenFile,
|
||||
oauthFromGog: opts.oauthFromGog,
|
||||
gogAccount: opts.gogAccount,
|
||||
gogClient: opts.gogClient,
|
||||
homeserver: opts.homeserver,
|
||||
userId: opts.userId,
|
||||
accessToken: opts.accessToken,
|
||||
|
||||
@@ -72,6 +72,12 @@ export type GoogleChatAccountConfig = {
|
||||
oauthRefreshToken?: string;
|
||||
/** OAuth refresh token file path (user auth). */
|
||||
oauthRefreshTokenFile?: string;
|
||||
/** Reuse gog OAuth credentials (user auth). */
|
||||
oauthFromGog?: boolean;
|
||||
/** gog account email to match refresh token (optional). */
|
||||
gogAccount?: string;
|
||||
/** gog client name to match credentials file (optional). */
|
||||
gogClient?: string;
|
||||
/** Webhook audience type (app-url or project-number). */
|
||||
audienceType?: "app-url" | "project-number";
|
||||
/** Audience value (app URL or project number). */
|
||||
|
||||
@@ -317,6 +317,9 @@ export const GoogleChatAccountSchema = z
|
||||
oauthClientFile: z.string().optional(),
|
||||
oauthRefreshToken: z.string().optional(),
|
||||
oauthRefreshTokenFile: z.string().optional(),
|
||||
oauthFromGog: z.boolean().optional(),
|
||||
gogAccount: z.string().optional(),
|
||||
gogClient: z.string().optional(),
|
||||
audienceType: z.enum(["app-url", "project-number"]).optional(),
|
||||
audience: z.string().optional(),
|
||||
webhookPath: z.string().optional(),
|
||||
|
||||
Reference in new issue
Block a user