Skip to content

Commit

Permalink
fix: rename env var
Browse files Browse the repository at this point in the history
  • Loading branch information
teselil committed Jun 28, 2023
1 parent 6dbaaae commit e2cd60d
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apps/backoffice-v2/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ VITE_AUTH_ENABLED=true
VITE_MOCK_SERVER=false
VITE_POLLING_INTERVAL=10
VITE_ASSIGNMENT_POLLING_INTERVAL=5
WEBHOOK_URL=ws://localhost:3500
WEBSOCKET_URL=ws://localhost:3500
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { env } from '../../../env/env';
* @constructor
*/
export const Navbar: FunctionComponent = () => {
const { readyState } = useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
const { readyState } = useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/backoffice-v2/src/common/env/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export const EnvSchema = z.object({
.or(z.literal(false))
.catch(undefined),
VITE_IMAGE_LOGO_URL: z.string().optional(),
WEBHOOK_URL: z.string().url().default('ws://localhost:3500'),
WEBSOCKET_URL: z.string().url().default('ws://localhost:3500'),
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useWebSocket, { ReadyState } from 'react-use-websocket';
import { env } from '../../../../common/env/env';

export const AuthenticatedLayout: FunctionComponentWithChildren = ({ children }) => {
const { readyState } = useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
const { readyState } = useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/backoffice-v2/src/pages/Entities/Entities.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import useWebSocket, { ReadyState } from 'react-use-websocket';
import { env } from '../../common/env/env';

export const Entities: FunctionComponent = () => {
const { readyState } = useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
const { readyState } = useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/backoffice-v2/src/pages/Entity/Entity.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import useWebSocket, { ReadyState } from 'react-use-websocket';
import { env } from '../../common/env/env';

export const Entity = () => {
const { readyState } = useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
const { readyState } = useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import useWebSocket, { ReadyState } from 'react-use-websocket';
import { env } from '../../../../common/env/env';

export const CallToAction: FunctionComponent<ICallToActionProps> = ({ value, data }) => {
const { readyState } = useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
const { readyState } = useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Actions: FunctionComponent<IActionsProps> = ({
fullName,
showResolutionButtons = true,
}) => {
const { readyState } = useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
const { readyState } = useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useWebSocket, { ReadyState } from 'react-use-websocket';
import { env } from '../../../../common/env/env';

export const Details: FunctionComponent<IDetailsProps> = ({ id, value }) => {
const { readyState } = useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
const { readyState } = useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
});
Expand Down
2 changes: 1 addition & 1 deletion apps/backoffice-v2/src/pages/Root/Root.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ReactQueryDevtools = lazy(() =>
);

export const Root: FunctionComponent = () => {
useWebSocket(`${env.WEBHOOK_URL}/?testParams=55`, {
useWebSocket(`${env.WEBSOCKET_URL}/?testParams=55`, {
share: true,
shouldReconnect: () => true,
onOpen: () => {
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/example.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ workflowService:
API_KEY: "secret"
NODE_ENV: "development"
SENTRY_DSN: ""
WEBHOOK_URL: "ws://localhost:3500"
WEBHOOK_URL: ""
WEBHOOK_SECRET: "webhook_secret"
3 changes: 2 additions & 1 deletion services/workflows-service/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ HEADLESS_EXAMPLE_CORS_ORIGIN=http://localhost:5173
API_KEY=secret
NODE_ENV=local
SENTRY_DSN=
WEBHOOK_URL=http://localhost:3500
WEBHOOK_URL=
WEBHOOK_SECRET=webhook_secret
WEBSOCKET_URL=ws://localhost:3000
3 changes: 1 addition & 2 deletions services/workflows-service/src/auth/session-auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export class SessionAuthGuard implements CanActivate {
const req = context.switchToHttp().getRequest<Request>();

if (!req.isAuthenticated()) {
// throw new UnauthorizedException('Unauthorized');
return true;
throw new UnauthorizedException('Unauthorized');
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion services/workflows-service/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const env = createEnv({
AWS_S3_BUCKET_SECRET: z.string().optional(),
API_KEY: z.string(),
SENTRY_DSN: z.string().nullable().optional(),
WEBHOOK_URL: z.string().url(),
WEBSOCKET_URL: z.string().url(),
},
client: {},
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class FilterControllerExternal {
query: data?.query as InputJsonValue,
},
});
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=filters`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=filters`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return createdFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class WorkflowControllerExternal {
): Promise<WorkflowRuntimeData> {
try {
const updatedWorkflow = await this.service.updateWorkflowRuntimeData(params.id, data);
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return updatedWorkflow;
Expand Down Expand Up @@ -164,7 +164,7 @@ export class WorkflowControllerExternal {
...data,
id,
});
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return createdEvent;
Expand All @@ -185,7 +185,7 @@ export class WorkflowControllerExternal {
...data,
id,
});
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return createdEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class WorkflowControllerInternal {
@common.Body() data: WorkflowDefinitionCreateDto,
) {
const createdWorkflowDefinition = await this.service.createWorkflowDefinition(data);
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return createdWorkflowDefinition;
Expand Down Expand Up @@ -124,7 +124,7 @@ export class WorkflowControllerInternal {
...data,
id: params.id,
});
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return createdEvent;
Expand All @@ -142,7 +142,7 @@ export class WorkflowControllerInternal {
): Promise<WorkflowRuntimeData> {
try {
const updatedWorkflow = await this.service.updateWorkflowRuntimeData(params.id, data);
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return updatedWorkflow;
Expand All @@ -165,7 +165,7 @@ export class WorkflowControllerInternal {
): Promise<WorkflowRuntimeData> {
try {
const assignedWorkflow = await this.service.assignWorkflowToUser(params.id, data);
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return assignedWorkflow;
Expand Down Expand Up @@ -205,7 +205,7 @@ export class WorkflowControllerInternal {
submitStates: true,
},
});
const websocketServerNotifyUri = `${env.WEBHOOK_URL}/notify?type=workflows_list`;
const websocketServerNotifyUri = `${env.WEBSOCKET_URL}/notify?type=workflows_list`;
// todo is it important to await this?
await axios.post(websocketServerNotifyUri);
return deletedWorkflow;
Expand Down

0 comments on commit e2cd60d

Please sign in to comment.