-
Notifications
You must be signed in to change notification settings - Fork 7
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(apps): Set app tokens #179
Conversation
@leomp12 uma dúvida nesse app do flash courier o contrato poderia ser todo um secret, ou deveriamos salvar cada um como secret aqui ?
|
É muita coisa né ? 🙃 |
59e1e07
to
b04ea58
Compare
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.
Só uns typos mesmo porque isso vira API...
action.yml
Outdated
galaxpay-hash: | ||
description: 'App: Galax Pay hash' | ||
ga-api-token: | ||
description: 'App: Google analytics API secret' |
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.
description: 'App: Google analytics API secret' | |
description: 'App: Google Analytics API secret' |
action.yml
Outdated
pagarme-encry-key: | ||
description: 'App: PagarMe Encryption Key' | ||
pagarme-token: | ||
description: 'App: PagarMe API token' |
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.
pagarme-encry-key: | |
description: 'App: PagarMe Encryption Key' | |
pagarme-token: | |
description: 'App: PagarMe API token' | |
pagarme-encrypt-key: | |
description: 'App: Pagar.me encryption Key' | |
pagarme-token: | |
description: 'App: Pagar.me API token' |
action.yml
Outdated
webhook-app-token: | ||
description: 'App: Webhooks App Token' |
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.
webhook-app-token: | |
description: 'App: Webhooks App Token' | |
webhooks-token: | |
description: 'App: Webhooks token' |
let headers: { Authorization: string; } | undefined; | ||
|
||
if (token) { | ||
if (!process.env.WEBHOOKAPP_TOKEN) { |
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.
if (!process.env.WEBHOOKAPP_TOKEN) { | |
if (!process.env.WEBHOOKS_TOKEN) { |
if (!process.env.WEBHOOKAPP_TOKEN) { | ||
const webhookAppToken = options.webhook_token | ||
if (typeof webhookAppToken === 'string' && webhookAppToken) { | ||
process.env.WEBHOOKAPP_TOKEN = webhookAppToken; |
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.
process.env.WEBHOOKAPP_TOKEN = webhookAppToken; | |
process.env.WEBHOOKS_TOKEN = webhookAppToken; |
@@ -25,7 +26,25 @@ export default (data: AppModuleBody) => { | |||
...application.hidden_data, | |||
}; | |||
|
|||
if (!configApp.pagarme_encryption_key || !configApp.pagarme_api_key) { | |||
if (!process.env.PAGARME_ENCRYP_KEY) { |
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.
if (!process.env.PAGARME_ENCRYP_KEY) { | |
if (!process.env.PAGARME_ENCRYPT_KEY) { |
if (!process.env.PAGARME_ENCRYP_KEY) { | ||
const parameEncrypKey = configApp.pagarme_encryption_key; | ||
if (typeof parameEncrypKey === 'string' && parameEncrypKey) { | ||
process.env.PAGARME_ENCRYP_KEY = parameEncrypKey; |
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.
process.env.PAGARME_ENCRYP_KEY = parameEncrypKey; | |
process.env.PAGARME_ENCRYPT_KEY = parameEncrypKey; |
} | ||
} | ||
|
||
if (!process.env.PAGARME_ENCRYP_KEY || !process.env.PAGARME_TOKEN) { |
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.
if (!process.env.PAGARME_ENCRYP_KEY || !process.env.PAGARME_TOKEN) { | |
if (!process.env.PAGARME_ENCRYPT_KEY || !process.env.PAGARME_TOKEN) { |
@@ -137,7 +156,7 @@ export default (data: AppModuleBody) => { | |||
// https://github.com/pagarme/pagarme-js | |||
gateway.js_client = { | |||
script_uri: 'https://assets.pagar.me/pagarme-js/4.8/pagarme.min.js', | |||
onload_expression: `window._pagarmeKey="${configApp.pagarme_encryption_key}"; | |||
onload_expression: `window._pagarmeKey="${process.env.PAGARME_ENCRYP_KEY}"; |
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.
onload_expression: `window._pagarmeKey="${process.env.PAGARME_ENCRYP_KEY}"; | |
onload_expression: `window._pagarmeKey="${process.env.PAGARME_ENCRYPT_KEY}"; |
logger.warn('Missing GalaxPay ID'); | ||
} | ||
} | ||
|
||
const measurementId = appData.measurement_id; |
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.
Não tinha que ter um env opcional pra esse ID também?
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.
Quer dizer, só a API key sem esse ID é inútil né?
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.
valeu 👍🏾
No description provided.