From 7105058bacef6da0be686575d1141e272b4c47ca Mon Sep 17 00:00:00 2001 From: Filip Swiatczak Date: Thu, 30 Sep 2021 10:30:47 +0100 Subject: [PATCH] bitbucket typed.d.ts added Signed-off-by: Filip Swiatczak --- .../src/providers/bitbucket/provider.ts | 1 - .../src/providers/bitbucket/types.d.ts | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 plugins/auth-backend/src/providers/bitbucket/types.d.ts diff --git a/plugins/auth-backend/src/providers/bitbucket/provider.ts b/plugins/auth-backend/src/providers/bitbucket/provider.ts index 7f27e64fee..1c84258273 100644 --- a/plugins/auth-backend/src/providers/bitbucket/provider.ts +++ b/plugins/auth-backend/src/providers/bitbucket/provider.ts @@ -16,7 +16,6 @@ import express from 'express'; import passport, { Profile as PassportProfile } from 'passport'; -// @ts-ignore passport-bitbucket-oauth2 does not have type definitions import { Strategy as BitbucketStrategy } from 'passport-bitbucket-oauth2'; import { TokenIssuer } from '../../identity/types'; import { CatalogIdentityClient, getEntityClaims } from '../../lib/catalog'; diff --git a/plugins/auth-backend/src/providers/bitbucket/types.d.ts b/plugins/auth-backend/src/providers/bitbucket/types.d.ts new file mode 100644 index 0000000000..70c4c8cba9 --- /dev/null +++ b/plugins/auth-backend/src/providers/bitbucket/types.d.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +declare module 'passport-bitbucket-oauth2' { + import { StrategyCreated } from 'passport'; + import express = require('express'); + + export class Strategy { + name?: string | undefined; + authenticate( + this: StrategyCreated, + req: express.Request, + options?: any, + ): any; + constructor(options: any, verify: any); + } +}