mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
1f097b0fdd
* chore: resolve no-explicit-any lint warnings in plugins Replaces uses of `any` in the plugins directory with concrete types, `unknown`, or structured type assertions, addressing the remaining typescript-eslint(no-explicit-any) warnings flagged by oxlint. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: address review feedback in GitLabIssueProvider Drop trailing semicolon from log string and add early return in `destroyNamespace` when neither `user_id` nor `full_path` is present to avoid an unnecessary full-scan transaction. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
36 lines
960 B
TypeScript
36 lines
960 B
TypeScript
import type { Request } from "express";
|
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
import type OAuth2Strategy from "passport-oauth2";
|
|
import { Strategy } from "passport-oauth2";
|
|
|
|
interface AuthenticateOptions {
|
|
originalQuery?: Request["query"];
|
|
[key: string]: unknown;
|
|
}
|
|
|
|
export class OIDCStrategy extends Strategy {
|
|
constructor(
|
|
options: OAuth2Strategy.StrategyOptionsWithRequest,
|
|
verify: OAuth2Strategy.VerifyFunctionWithRequest
|
|
) {
|
|
super(options, verify);
|
|
|
|
if (process.env.https_proxy) {
|
|
const httpsProxyAgent = new HttpsProxyAgent(process.env.https_proxy);
|
|
this._oauth2.setAgent(httpsProxyAgent);
|
|
}
|
|
}
|
|
|
|
authenticate(req: Request, options: AuthenticateOptions) {
|
|
options.originalQuery = req.query;
|
|
super.authenticate(req, options);
|
|
}
|
|
|
|
authorizationParams(options: AuthenticateOptions) {
|
|
return {
|
|
...options.originalQuery,
|
|
...super.authorizationParams?.(options),
|
|
};
|
|
}
|
|
}
|