-
Notifications
You must be signed in to change notification settings - Fork 484
feat(api): add NANGO_ADMIN_PROD_ENV env var #3828
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import db, { schema, dbNamespace } from '@nangohq/database'; | ||
import type { ServiceResponse } from '../../models/Generic.js'; | ||
import environmentService from '../environment.service.js'; | ||
import type { Result } from '@nangohq/utils'; | ||
import { basePublicUrl, Err, getLogger, Ok, stringToHash, truncateJson } from '@nangohq/utils'; | ||
import db, { dbNamespace, schema } from '@nangohq/database'; | ||
import { Err, Ok, basePublicUrl, getLogger, stringToHash, truncateJson } from '@nangohq/utils'; | ||
|
||
import configService from '../config.service.js'; | ||
import connectionService from '../connection.service.js'; | ||
import type { LogContextGetter } from '@nangohq/logs'; | ||
import type { ConnectionJobs, DBConnection, DBConnectionDecrypted, DBEnvironment, DBSlackNotification, DBTeam } from '@nangohq/types'; | ||
import type { NangoError } from '../../utils/error.js'; | ||
import { refreshOrTestCredentials } from '../connections/credentials/refresh.js'; | ||
import configService from '../config.service.js'; | ||
import environmentService from '../environment.service.js'; | ||
import { ProxyRequest } from '../proxy/request.js'; | ||
import { getProxyConfiguration } from '../proxy/utils.js'; | ||
|
||
import type { ServiceResponse } from '../../models/Generic.js'; | ||
import type { Config } from '../../models/Provider.js'; | ||
import type { NangoError } from '../../utils/error.js'; | ||
import type { FeatureFlags } from '@nangohq/kvstore'; | ||
import type { LogContextGetter } from '@nangohq/logs'; | ||
import type { ConnectionJobs, DBConnection, DBConnectionDecrypted, DBEnvironment, DBSlackNotification, DBTeam } from '@nangohq/types'; | ||
import type { Result } from '@nangohq/utils'; | ||
|
||
const logger = getLogger('SlackService'); | ||
const TABLE = dbNamespace + 'slack_notifications'; | ||
|
@@ -85,7 +87,7 @@ export class SlackService { | |
|
||
private integrationKey = process.env['NANGO_SLACK_INTEGRATION_KEY'] || 'slack'; | ||
private nangoAdminUUID = process.env['NANGO_ADMIN_UUID']; | ||
private env = 'prod'; | ||
private env = process.env['NANGO_ADMIN_PROD_ENV'] || 'prod'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nb in shared you wont be able to use parsed, but you can refactor the class to accept the env in the constructor |
||
constructor({ logContextGetter, featureFlags }: { logContextGetter: LogContextGetter; featureFlags: FeatureFlags }) { | ||
this.logContextGetter = logContextGetter; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we now prefer to use the validated and type safed
parsedEnvs
. Example:nango/packages/server/lib/server.ts
Line 33 in 5ea7299
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and that way you can put a default value too