refactor: stop sharing api/client specific config (#51423)

This commit is contained in:
Oliver Eyton-Williams
2023-08-29 15:05:27 +02:00
committed by GitHub
parent 2428910ad1
commit cb9d6a6243
29 changed files with 29 additions and 29 deletions

View File

@@ -4,7 +4,7 @@ import jwt from 'jsonwebtoken';
import passport from 'passport';
import fetch from 'node-fetch';
import { isEmail } from 'validator';
import { jwtSecret } from '../../../../config/secrets';
import { jwtSecret } from '../../../config/secrets';
import { decodeEmail } from '../../common/utils';
import {
createPassportCallbackAuthenticator,

View File

@@ -16,7 +16,7 @@ import isURL from 'validator/lib/isURL';
import fetch from 'node-fetch';
import jwt from 'jsonwebtoken';
import { jwtSecret } from '../../../../config/secrets';
import { jwtSecret } from '../../../config/secrets';
import { challengeTypes } from '../../../../config/challenge-types';
import {

View File

@@ -2,7 +2,7 @@ import debug from 'debug';
import Stripe from 'stripe';
import { donationSubscriptionConfig } from '../../../../config/donation-settings';
import keys from '../../../../config/secrets';
import keys from '../../../config/secrets';
import {
getAsyncPaypalToken,
verifyWebHook,

View File

@@ -3,7 +3,7 @@ import dedent from 'dedent';
import passport from 'passport';
import { availableLangs } from '../../../config/i18n';
import { jwtSecret } from '../../../config/secrets';
import { jwtSecret } from '../../config/secrets';
import passportProviders from './passport-providers';
import { setAccessTokenToResponse } from './utils/getSetAccessToken';
import {

View File

@@ -1,4 +1,4 @@
var secrets = require('../../../config/secrets');
var secrets = require('../../config/secrets');
module.exports = {
db: {

View File

@@ -9,7 +9,7 @@ const loopback = require('loopback');
const boot = require('loopback-boot');
const morgan = require('morgan');
const { sentry } = require('../../../config/secrets');
const { sentry } = require('../../config/secrets');
const { setupPassport } = require('./component-passport');
const log = createDebugger('fcc:server');

View File

@@ -1,4 +1,4 @@
import { allowedOrigins } from '../../../../config/cors-settings';
import { allowedOrigins } from '../../../config/cors-settings';
export default function constantHeaders() {
return function (req, res, next) {

View File

@@ -1,6 +1,6 @@
import { isEmpty } from 'lodash';
import { jwtSecret as _jwtSecret } from '../../../../config/secrets';
import { jwtSecret as _jwtSecret } from '../../../config/secrets';
import { wrapHandledError } from '../utils/create-handled-error';
import {

View File

@@ -1,5 +1,5 @@
import { Handlers, captureException } from '@sentry/node';
import { sentry } from '../../../../config/secrets';
import { sentry } from '../../../config/secrets';
import { isHandledError } from '../utils/create-handled-error';
// sends directly to Sentry

View File

@@ -1,5 +1,5 @@
import { Handlers } from '@sentry/node';
import { sentry } from '../../../../config/secrets';
import { sentry } from '../../../config/secrets';
export default function sentryRequestHandler() {
return sentry.dsn === 'dsn_from_sentry_dashboard'

View File

@@ -1,5 +1,5 @@
import { Handlers } from '@sentry/node';
import { sentry } from '../../../../config/secrets';
import { sentry } from '../../../config/secrets';
export default function sentryRequestHandler() {
return sentry.dsn === 'dsn_from_sentry_dashboard'

View File

@@ -1,7 +1,7 @@
import debugFactory from 'debug';
const log = debugFactory('fcc:boot:user');
import jwt from 'jsonwebtoken';
import { jwtSecret } from '../../../../config/secrets';
import { jwtSecret } from '../../../config/secrets';
/*
* User tokens for submitting external curriculum are deleted when they sign

View File

@@ -1,4 +1,4 @@
import { auth0 } from '../../../config/secrets';
import { auth0 } from '../../config/secrets';
const { clientID, clientSecret, domain } = auth0;

View File

@@ -3,7 +3,7 @@ import axios from 'axios';
import debug from 'debug';
import isEmail from 'validator/lib/isEmail';
import { donationSubscriptionConfig } from '../../../../config/donation-settings';
import keys from '../../../../config/secrets';
import keys from '../../../config/secrets';
const log = debug('fcc:boot:donate');

View File

@@ -1,6 +1,6 @@
/* eslint-disable camelcase */
import axios from 'axios';
import keys from '../../../../config/secrets';
import keys from '../../../config/secrets';
import {
mockApp,
createDonationMockFn,

View File

@@ -1,7 +1,7 @@
import { isBefore } from 'date-fns';
import jwt from 'jsonwebtoken';
import { jwtSecret as _jwtSecret } from '../../../../config/secrets';
import { jwtSecret as _jwtSecret } from '../../../config/secrets';
export const jwtCookieNS = 'jwt_access_token';

View File

@@ -1,5 +1,5 @@
const jwt = require('jsonwebtoken');
const { allowedOrigins } = require('../../../../config/cors-settings');
const { allowedOrigins } = require('../../../config/cors-settings');
// process.env.HOME_LOCATION is being used as a fallback here. If the one
// provided by the client is invalid we default to this.
const { availableLangs } = require('../../../../config/i18n');

View File

@@ -1,7 +1,7 @@
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
import jwt from 'jsonwebtoken';
import { uniqBy } from 'lodash';
import { jwtSecret } from '../../../config/secrets';
import { jwtSecret } from '../../../api-server/config/secrets';
import { getChallenges } from '../utils/get-challenges';
import { updateUserChallengeData } from '../utils/common-challenge-functions';
import { formatValidationError } from '../utils/error-formatting';

View File

@@ -0,0 +1,5 @@
export const prodAnalyticsId = 'GTM-57R6KJM';
export const devAnalyticsId = 'GTM-WSS47LM';
// this id includes a stream for the spanish learn platform
export const prodAnalyticsESId = 'GTM-KCS6GSD';

View File

@@ -4,7 +4,7 @@ import {
devAnalyticsId,
prodAnalyticsId,
prodAnalyticsESId
} from '../../../config/analytics-settings';
} from '../../config/analytics-settings';
import envData from '../../../config/env.json';

View File

@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { useMediaQuery } from 'react-responsive';
import { isLanding } from '../../../utils/path-parsers';
import { Link, SkeletonSprite } from '../../helpers';
import { SEARCH_EXPOSED_WIDTH } from '../../../../../config/misc';
import { SEARCH_EXPOSED_WIDTH } from '../../../../config/misc';
import MenuButton from './menu-button';
import NavLinks, { type NavLinksProps } from './nav-links';
import NavLogo from './nav-logo';

View File

@@ -10,7 +10,7 @@ import GreenPass from '../../../assets/icons/green-pass';
import { randomCompliment } from '../../../../src/utils/get-words';
import Help from '../../../assets/icons/help';
import Reset from '../../../assets/icons/reset';
import { MAX_MOBILE_WIDTH } from '../../../../../config/misc';
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
import { apiLocation } from '../../../../../config/env.json';
import { ChallengeMeta } from '../../../redux/prop-types';
import { Share } from '../../../components/share';

View File

@@ -15,7 +15,7 @@ import {
showPreviewPortalSelector,
showPreviewPaneSelector
} from '../redux/selectors';
import { TOOL_PANEL_HEIGHT } from '../../../../../config/misc';
import { TOOL_PANEL_HEIGHT } from '../../../../config/misc';
import ToolPanel from '../components/tool-panel';
import PreviewPortal from '../components/preview-portal';
import EditorTabs from './editor-tabs';

View File

@@ -11,7 +11,7 @@ import store from 'store';
import { editor } from 'monaco-editor';
import { challengeTypes } from '../../../../../config/challenge-types';
import LearnLayout from '../../../components/layouts/learn';
import { MAX_MOBILE_WIDTH } from '../../../../../config/misc';
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
import {
ChallengeFiles,

View File

@@ -18,7 +18,7 @@ import {
isAdvancingToChallengeSelector,
chapterSlugSelector
} from '../redux/selectors';
import { MAX_MOBILE_WIDTH } from '../../../../../config/misc';
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
interface PreviewPortalProps {
children: ReactElement | null;

View File

@@ -1,5 +0,0 @@
exports.prodAnalyticsId = 'GTM-57R6KJM';
exports.devAnalyticsId = 'GTM-WSS47LM';
// this id includes a stream for the spanish learn platform
exports.prodAnalyticsESId = 'GTM-KCS6GSD';