Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/messages/en/edge_wizard.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"edge_setup_component_label_ip_or_domain": "IP or Domain",
"edge_setup_component_label_ip_or_domain_help": "Enter the IP or domain name of the server where the Edge Component is deployed. Core will then connect to it and perform the adoption automatically.",
"edge_setup_component_label_grpc_port": "gRPC Port",
"edge_setup_component_label_grpc_port_help": "Specify the gRPC TCP port for Edge Component communication. If unchanged, leave the default value. Ensure this port is open and accessible to the Core instance through any server or network firewalls.",
"edge_setup_component_label_grpc_port_help": "If you have changed the default Edge gRPC port, please change it here.",
"edge_setup_component_error_common_name_required": "Edge Name is required",
"edge_setup_component_error_ip_or_domain_required": "IP or Domain is required",
"edge_setup_component_error_grpc_port_required": "gRPC Port is required",
Expand Down
1 change: 1 addition & 0 deletions web/messages/en/gateway_wizard.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"gateway_setup_component_label_common_name": "Common Name",
"gateway_setup_component_label_ip_or_domain": "IP or Domain",
"gateway_setup_component_label_grpc_port": "gRPC Port",
"gateway_setup_component_label_grpc_port_help": "If you have changed the default Gateway gRPC port, please change it here.",
"gateway_setup_component_error_common_name_required": "Common Name is required",
"gateway_setup_component_error_ip_or_domain_required": "IP or Domain is required",
"gateway_setup_component_error_grpc_port_required": "gRPC Port is required",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useNavigate } from '@tanstack/react-router';
import { type ReactNode, useMemo } from 'react';
import type { WizardPageStep } from '../../shared/components/wizard/types';
import { WizardPage } from '../../shared/components/wizard/WizardPage/WizardPage';
import { externalProviderName, SUPPORTED_SYNC_PROVIDERS } from '../../shared/constants';
import { externalProviderName, supportedSyncProviders } from '../../shared/constants';
import { AddExternalOpenIdClientSettingsStep } from './steps/AddExternalOpenIdClientSettingsStep/AddExternalOpenIdClientSettingsStep';
import { AddExternalOpenIdDirectoryStep } from './steps/AddExternalOpenIdDirectoryStep/AddExternalOpenIdDirectoryStep';
import { AddExternalOpenIdValidationStep } from './steps/AddExternalOpenIdValidationStep/AddExternalOpenIdValidationStep';
Expand Down Expand Up @@ -36,7 +36,7 @@ export const AddExternalOpenIdWizardPage = () => {
order: 1,
description:
'Manage core details and connection parameters for your VPN location.',
hidden: !SUPPORTED_SYNC_PROVIDERS.has(provider),
hidden: !supportedSyncProviders.has(provider),
},
validation: {
id: AddExternalProviderStep.Validation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '../../../../shared/api/types';
import { Controls } from '../../../../shared/components/Controls/Controls';
import { WizardCard } from '../../../../shared/components/wizard/WizardCard/WizardCard';
import { SUPPORTED_SYNC_PROVIDERS } from '../../../../shared/constants';
import { supportedSyncProviders } from '../../../../shared/constants';
import { Button } from '../../../../shared/defguard-ui/components/Button/Button';
import { SizedBox } from '../../../../shared/defguard-ui/components/SizedBox/SizedBox';
import { ThemeSpacing } from '../../../../shared/defguard-ui/types';
Expand Down Expand Up @@ -118,7 +118,7 @@ export const AddExternalOpenIdClientSettingsStep = () => {
onChange: formSchema,
},
onSubmit: async ({ value }) => {
if (SUPPORTED_SYNC_PROVIDERS.has(provider)) {
if (supportedSyncProviders.has(provider)) {
next(value);
} else {
const storeState = useAddExternalOpenIdStore.getState().providerState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
externalProviderName,
googleProviderBaseUrl,
jumpcloudProviderBaseUrl,
SUPPORTED_SYNC_PROVIDERS,
supportedSyncProviders,
} from '../../shared/constants';
import { AddExternalProviderStep, type AddExternalProviderStepValue } from './types';

Expand Down Expand Up @@ -78,7 +78,7 @@ export const useAddExternalOpenIdStore = create<Store>()(
next: (data) => {
const { provider, activeStep, providerState } = get();
let targetStep = activeStep;
const canDirectorySync = SUPPORTED_SYNC_PROVIDERS.has(provider);
const canDirectorySync = supportedSyncProviders.has(provider);
switch (activeStep) {
case 'client-settings':
if (canDirectorySync) {
Expand All @@ -99,7 +99,7 @@ export const useAddExternalOpenIdStore = create<Store>()(
back: (data) => {
const { provider, activeStep, providerState } = get();
let targetStep = activeStep;
const canDirectorySync = SUPPORTED_SYNC_PROVIDERS.has(provider);
const canDirectorySync = supportedSyncProviders.has(provider);
switch (activeStep) {
case 'directory-sync':
targetStep = AddExternalProviderStep.ClientSettings;
Expand Down
3 changes: 2 additions & 1 deletion web/src/pages/EdgeSetupPage/useEdgeWizardStore.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { omit } from 'lodash-es';
import { create } from 'zustand';
import { createJSONStorage, persist } from 'zustand/middleware';
import { edgeDefaultGrpcPort } from '../../shared/constants';
import { type EdgeAdoptionState, EdgeSetupStep, type EdgeSetupStepValue } from './types';

type StoreValues = {
Expand Down Expand Up @@ -35,7 +36,7 @@ const defaults: StoreValues = {
isOnWelcomePage: true,
common_name: '',
ip_or_domain: '',
grpc_port: 50051,
grpc_port: edgeDefaultGrpcPort,
edgeAdoptionState: edgeAdoptionStateDefaults,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const SetupGatewayComponentStep = () => {
<field.FormInput
required
label={m.gateway_setup_component_label_grpc_port()}
helper={m.gateway_setup_component_label_grpc_port_help()}
type="number"
/>
)}
Expand Down
3 changes: 2 additions & 1 deletion web/src/pages/GatewaySetupPage/useGatewayWizardStore.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { omit } from 'lodash-es';
import { create } from 'zustand';
import { createJSONStorage, persist } from 'zustand/middleware';
import { gatewayDefaultGrpcPort } from '../../shared/constants';
import type { SetupStepId } from './steps/types';
import { GatewaySetupStep, type GatewaySetupStepValue } from './types';

Expand Down Expand Up @@ -48,7 +49,7 @@ const defaults: StoreValues = {
isOnWelcomePage: true,
common_name: '',
ip_or_domain: '',
grpc_port: 50066,
grpc_port: gatewayDefaultGrpcPort,
network_id: null,
gatewayAdoptionState: gatewayAdoptionStateDefaults,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
MigrationWizardApiState,
MigrationWizardLocationState,
} from '../../../shared/api/types';
import { edgeDefaultGrpcPort } from '../../../shared/constants';
import { getMigrationStateQueryOptions } from '../../../shared/query';
import type { EdgeAdoptionState } from '../../EdgeSetupPage/types';
import {
Expand Down Expand Up @@ -54,7 +55,7 @@ const defaults: StoreValues = {
ca_option: null,
common_name: '',
ip_or_domain: '',
grpc_port: 50051,
grpc_port: edgeDefaultGrpcPort,
edgeAdoptionState: edgeAdoptionStateDefaults,
};

Expand Down
3 changes: 2 additions & 1 deletion web/src/pages/SetupPage/initial/useSetupWizardStore.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { omit } from 'lodash-es';
import { create } from 'zustand';
import { createJSONStorage, persist } from 'zustand/middleware';
import { edgeDefaultGrpcPort } from '../../../shared/constants';
import type { EdgeAdoptionState } from '../../EdgeSetupPage/types';
import { type CAOptionType, SetupPageStep, type SetupPageStepValue } from './types';

Expand Down Expand Up @@ -75,7 +76,7 @@ const defaults: StoreValues = {
// Edge settings
common_name: '',
ip_or_domain: '',
grpc_port: 50051,
grpc_port: edgeDefaultGrpcPort,
edgeAdoptionState: edgeAdoptionStateDefaults,
};

Expand Down
6 changes: 5 additions & 1 deletion web/src/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const externalProviderName: Record<OpenIdProviderKindValue, string> = {
Zitadel: 'Zitadel',
};

export const SUPPORTED_SYNC_PROVIDERS: Set<OpenIdProviderKindValue> = new Set([
export const supportedSyncProviders: Set<OpenIdProviderKindValue> = new Set([
OpenIdProviderKind.Google,
OpenIdProviderKind.Microsoft,
OpenIdProviderKind.Okta,
Expand All @@ -38,3 +38,7 @@ export const SUPPORTED_SYNC_PROVIDERS: Set<OpenIdProviderKindValue> = new Set([
export const googleProviderBaseUrl = 'https://accounts.google.com';

export const jumpcloudProviderBaseUrl = 'https://oauth.id.jumpcloud.com';

export const edgeDefaultGrpcPort = 50051;

export const gatewayDefaultGrpcPort = 50066;
Loading