Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
Allow an optional static bearer token when using dev server
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Aug 25, 2022
1 parent f356dc9 commit 307c04b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/meta.dev.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"mustGatherApi": "http://localhost:9200/",
"namespace": "openshift-migration",
"configNamespace": "openshift-config"
}
}
1 change: 1 addition & 0 deletions pkg/api/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const getAppTitle = () =>

const FORKLIFT_ENV = [
'AUTH_REQUIRED',
'K8S_AUTH_BEARER_TOKEN',
'NODE_ENV',
'DATA_SOURCE',
'BRAND_TYPE',
Expand Down
4 changes: 2 additions & 2 deletions pkg/web/src/app/client/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import KubeClient, {
CoreNamespacedResourceKind,
CoreNamespacedResource,
} from '@konveyor/lib-ui';
import { META, ProviderType, CLUSTER_API_VERSION } from '@app/common/constants';
import { META, ProviderType, CLUSTER_API_VERSION, ENV } from '@app/common/constants';
import { IProviderObject, ISecret } from '@app/queries/types';
import { useNetworkContext } from '@app/common/context';
import {
Expand Down Expand Up @@ -203,7 +203,7 @@ export const checkIfResourceExists = async (
export const useClientInstance = (): KubeClient.ClusterClient => {
const { currentUser } = useNetworkContext();
const user = {
access_token: currentUser?.access_token || '',
access_token: currentUser?.access_token || ENV.K8S_AUTH_BEARER_TOKEN || '',
expiry_time: currentUser?.expiry_time || 0,
};
return ClientFactory.cluster(user, '/cluster-api');
Expand Down
1 change: 1 addition & 0 deletions pkg/web/src/app/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface IMetaVars {

export interface IEnvVars {
AUTH_REQUIRED: string;
K8S_AUTH_BEARER_TOKEN: string;
NODE_ENV: string;
DATA_SOURCE: string;
BRAND_TYPE: BrandType;
Expand Down

0 comments on commit 307c04b

Please sign in to comment.