Skip to content

Commit

Permalink
(HP-1778) Removed unused env vars
Browse files Browse the repository at this point in the history
Also made some re-arrangements, so OIDC and KEYCLOAK vars are together.
  • Loading branch information
Niko Helle committed Jun 13, 2023
1 parent 6c48ab5 commit f27ebc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ REACT_APP_OIDC_AUTO_SILENT_RENEW="true"
REACT_APP_OIDC_LOGGING="false"
REACT_APP_OIDC_SILENT_AUTH_PATH="/silent_renew.html"
REACT_APP_OIDC_CALLBACK_PATH="/callback"
REACT_APP_API_BACKEND_AUDIENCE="exampleapp-api-dev"
REACT_APP_OIDC_TOKEN_EXCHANGE_PATH="/api-tokens/"
REACT_APP_OIDC_EXAMPLE_API_TOKEN_AUDIENCE="https://api.hel.fi/auth/exampleappdev"
REACT_APP_OIDC_PROFILE_API_TOKEN_AUDIENCE="https://api.hel.fi/auth/helsinkiprofiledev"
Expand All @@ -21,9 +20,6 @@ REACT_APP_KEYCLOAK_EXAMPLE_API_TOKEN_AUDIENCE="exampleapp-api-dev"
REACT_APP_KEYCLOAK_PROFILE_API_TOKEN_AUDIENCE="profile-api-dev"
REACT_APP_KEYCLOAK_API_TOKEN_GRANT_TYPE="urn:ietf:params:oauth:grant-type:uma-ticket"
REACT_APP_KEYCLOAK_API_TOKEN_PERMISSION="#access"
REACT_APP_PROFILE_BACKEND_URL="https://profiili-api.test.kuva.hel.ninja/graphql/"
REACT_APP_PROFILE_AUDIENCE="https://api.hel.fi/auth/helsinkiprofile"
REACT_APP_PROFILE_UI_URL="https://profiili.test.kuva.hel.ninja"
REACT_APP_KEYCLOAK_URL="https://tunnistus.dev.hel.ninja/auth"
REACT_APP_KEYCLOAK_CLIENT_ID="exampleapp-ui-dev"
REACT_APP_KEYCLOAK_SCOPE="openid profile"
Expand All @@ -36,5 +32,6 @@ REACT_APP_KEYCLOAK_AUTO_SIGN_IN="false"
REACT_APP_KEYCLOAK_LOGGING="false"
REACT_APP_KEYCLOAK_AUTO_SILENT_RENEW="true"
REACT_APP_KEYCLOAK_TOKEN_EXCHANGE_PATH="/realms/helsinki-tunnistus/protocol/openid-connect/token"
REACT_APP_BACKEND_AUDIENCE="https://api.hel.fi/auth/exampleapp"
REACT_APP_BACKEND_URL="https://example-api.dev.hel.ninja/api/v1/myuserdata/"
REACT_APP_PROFILE_BACKEND_URL="https://profiili-api.test.kuva.hel.ninja/graphql/"
REACT_APP_PROFILE_UI_URL="https://profiili.test.kuva.hel.ninja"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { mount, ReactWrapper } from 'enzyme';
import { act } from 'react-dom/test-utils';
import { waitFor } from '@testing-library/react';
import { FetchMock } from 'jest-fetch-mock';
import { AnyFunction } from '../../common';
import { FetchStatus } from '../useApiAccessTokens';
import useAuthorizedApiRequests, {
AuthorizedApiActions,
Expand All @@ -19,7 +18,7 @@ import {
resetAndSetMockApiAccessTokensHookData
} from '../__mocks__/useApiAccessTokens';
import { getFetchMockLastCallAuthenticationHeader } from '../../tests/common.test.helper';
import { setEnv, mockApiTokenResponse } from '../../tests/client.test.helper';
import { mockApiTokenResponse } from '../../tests/client.test.helper';
import { configureClient } from '../../client/__mocks__';

type TestProps = {
Expand All @@ -37,7 +36,6 @@ jest.mock('../../apiAccessTokens/useApiAccessTokens');
describe('useAuthorizedApiRequests hook ', () => {
let authorizedApiActions: AuthorizedApiActions<TestResponseData, TestProps>;
let dom: ReactWrapper;
let restoreEnv: AnyFunction;
let autoFetch = false;
let forceUpdate: React.Dispatch<React.SetStateAction<number>>;
const mockApiAccessTokensActions = getMockApiAccessTokensHookData();
Expand Down Expand Up @@ -155,13 +153,9 @@ describe('useAuthorizedApiRequests hook ', () => {
});

beforeAll(async () => {
restoreEnv = setEnv({
REACT_APP_PROFILE_AUDIENCE: testAudience
});
fetchMock.enableMocks();
});
afterAll(() => {
restoreEnv();
fetchMock.disableMocks();
});
afterEach(() => {
Expand Down

0 comments on commit f27ebc2

Please sign in to comment.