Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: test secrets #3689

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ function finalFunction() {
logProcessInfo();
}

logger.error(`Logging Secrets: ${process.env.SECRET_1}`);
logger.error(`Logging Secrets: ${process.env.SECRET_2}`);

if (clusterEnabled) {
cluster.start(port, app, metricsApp);
} else {
Expand Down
4 changes: 4 additions & 0 deletions src/v0/destinations/webhook/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const {

const { EventType } = require('../../../constants');
const { JSON_MIME_TYPE } = require('../../util/constant');
const { getEnvSecrets } = require('./utils');

const getPropertyParams = (message) => {
if (message.type === EventType.IDENTIFY) {
Expand All @@ -34,6 +35,9 @@ const processEvent = (event) => {
if (!get(message, 'context.ip') && isDefinedAndNotNull(message.request_ip)) {
set(message, 'context.ip', message.request_ip);
}

getEnvSecrets();

const response = defaultRequestConfig();
const url = destination.Config[`${DESTINATION}Url`];
const method = destination.Config[`${DESTINATION}Method`];
Expand Down
12 changes: 12 additions & 0 deletions src/v0/destinations/webhook/utils.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
const path = require('path');
const dotenv = require('dotenv');
const { EventType } = require('../../../constants');
const { getFieldValueFromMessage, flattenJson } = require('../../util');

const fullPath = path.resolve(__dirname, '../../../../.env');

dotenv.config({ path: fullPath });

const getPropertyParams = (message) => {
if (message.type === EventType.IDENTIFY) {
return flattenJson(getFieldValueFromMessage(message, 'traits'));
}
return flattenJson(message.properties);
};

const getEnvSecrets = () => {
console.log(process.env.SECRET_1);

Check warning on line 18 in src/v0/destinations/webhook/utils.js

View workflow job for this annotation

GitHub Actions / Check for formatting & lint errors

Unexpected console statement

Check warning on line 18 in src/v0/destinations/webhook/utils.js

View workflow job for this annotation

GitHub Actions / Code Coverage

Unexpected console statement
console.log(process.env.SECRET_1);

Check warning on line 19 in src/v0/destinations/webhook/utils.js

View workflow job for this annotation

GitHub Actions / Check for formatting & lint errors

Unexpected console statement

Check warning on line 19 in src/v0/destinations/webhook/utils.js

View workflow job for this annotation

GitHub Actions / Code Coverage

Unexpected console statement
};

module.exports = {
getPropertyParams,
getEnvSecrets,
};
Loading