diff --git a/.changeset/friendly-sheep-flash.md b/.changeset/friendly-sheep-flash.md index 83df13b290..58ae309bf1 100644 --- a/.changeset/friendly-sheep-flash.md +++ b/.changeset/friendly-sheep-flash.md @@ -1,5 +1,4 @@ --- -'@backstage/plugin-stack-overflow': patch '@backstage/plugin-stack-overflow-backend': patch --- diff --git a/plugins/stack-overflow/config.d.ts b/plugins/stack-overflow/config.d.ts index 181f196312..cf50241ec9 100644 --- a/plugins/stack-overflow/config.d.ts +++ b/plugins/stack-overflow/config.d.ts @@ -27,7 +27,7 @@ export interface Config { /** * The api key to authenticate to Stack Overflow API - * @visibility frontend + * @visibility secret */ apiKey?: string; }; diff --git a/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx b/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx index 8b954f5cf4..6d2ef9856a 100644 --- a/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx +++ b/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx @@ -42,7 +42,6 @@ import { export const Content = (props: StackOverflowQuestionsContentProps) => { const { requestParams } = props; const configApi = useApi(configApiRef); - const apiKey = configApi.getOptionalString('stackoverflow.apiKey'); const baseUrl = configApi.getOptionalString('stackoverflow.baseUrl') || 'https://api.stackexchange.com/2.2'; @@ -50,20 +49,11 @@ export const Content = (props: StackOverflowQuestionsContentProps) => { const { value, loading, error } = useAsync(async (): Promise< StackOverflowQuestion[] > => { - try { - if (Object.keys(requestParams).indexOf('key') >= 0) { - delete requestParams.key; - } - } catch (e) { - // console.log("Failed to remove key from params"); - } - const params = qs.stringify(requestParams, { arrayFormat: 'comma', addQueryPrefix: true, }); - const apiKeyParam = apiKey ? `${params ? '&' : '?'}key=${apiKey}` : ''; - const response = await fetch(`${baseUrl}/questions${params}${apiKeyParam}`); + const response = await fetch(`${baseUrl}/questions${params}`); const data = await response.json(); return data.items; }, []);