-
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
Changes from 16 commits
b01b930
9269c79
ae593c6
f9c000d
5bfb59e
be541e0
cfef47f
06a714c
f3bd560
2501dad
31a0e6c
6c14668
103d036
0b1fba0
a99377e
b04ea58
a6c162a
56f9fa2
cdd2a44
b65e436
a7bdfa1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -44,6 +44,34 @@ inputs: | |||||||||||||||||
description: 'App: Random token (https://randomkeygen.com/) to validate Datafrete webhooks' | ||||||||||||||||||
mercadopago-token: | ||||||||||||||||||
description: 'App: Mercadopago API access token' | ||||||||||||||||||
frenet-token: | ||||||||||||||||||
description: 'App: Frenet API token' | ||||||||||||||||||
galaxpay-id: | ||||||||||||||||||
description: 'App: Galax Pay ID' | ||||||||||||||||||
galaxpay-hash: | ||||||||||||||||||
description: 'App: Galax Pay hash' | ||||||||||||||||||
ga-api-token: | ||||||||||||||||||
description: 'App: Google analytics API secret' | ||||||||||||||||||
infinitepay-id: | ||||||||||||||||||
description: 'App: InifinitePay Client ID' | ||||||||||||||||||
infinitepay-secret: | ||||||||||||||||||
description: 'App: InifinitePay Client Secret' | ||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||
fb-graph-token: | ||||||||||||||||||
description: 'App: Facebook Graph token' | ||||||||||||||||||
jadlog-contract-token: | ||||||||||||||||||
description: 'App: Jadlog contract token' | ||||||||||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
paghiper-token: | ||||||||||||||||||
description: 'App: PagHiper API token' | ||||||||||||||||||
pix-credentials: | ||||||||||||||||||
description: 'App: Pix credentials' | ||||||||||||||||||
flashcourier-contract: | ||||||||||||||||||
description: 'App: Flash Courier contract' | ||||||||||||||||||
webhook-app-token: | ||||||||||||||||||
description: 'App: Webhooks App Token' | ||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||
|
||||||||||||||||||
outputs: {} | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -166,6 +194,20 @@ runs: | |||||||||||||||||
GALAXPAY_PARTNER_HASH: ${{ inputs.galaxpay-partner-hash }} | ||||||||||||||||||
DATAFRETE_OPERATOR_TOKEN: ${{ inputs.datafrete-operator-token }} | ||||||||||||||||||
MERCADOPAGO_TOKEN: ${{ inputs.mercadopago-token }} | ||||||||||||||||||
FRENET_TOKEN: ${{ inputs.frenet-token }} | ||||||||||||||||||
GALAXPAY_ID: ${{ inputs.galaxpay-id }} | ||||||||||||||||||
GALAXPAY_HASH: ${{ inputs.galaxpay-hash }} | ||||||||||||||||||
GA_API_TOKEN: ${{ inputs.ga-api-token }} | ||||||||||||||||||
INFINITEPAY_ID: ${{ inputs.infinitepay-id }} | ||||||||||||||||||
INFINITEPAY_SECRET: ${{ inputs.infinitepay-secret }} | ||||||||||||||||||
FB_GRAPH_TOKEN: ${{ inputs.fb-graph-token }} | ||||||||||||||||||
JADLOG_CONTRACT_TOKEN: ${{ inputs.jadlog-contract-token }} | ||||||||||||||||||
PAGARME_ENCRYP_KEY: ${{ inputs.pagarme-encry-key }} | ||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||
PAGARME_TOKEN: ${{ inputs.pagarme-token }} | ||||||||||||||||||
PAGHIPER_TOKEN: ${{ inputs.paghiper-token }} | ||||||||||||||||||
PIX_CREDENTIALS: ${{ inputs.pix-credentials }} | ||||||||||||||||||
FLASHCOURIER_CONTRACT: ${{ inputs.flashcourier-contract }} | ||||||||||||||||||
WEBHOOKAPP_TOKEN: ${{ inputs.webhook-app-token }} | ||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||
run: | | ||||||||||||||||||
export GAC_FILENAME=".gac-$RANDOM.json" | ||||||||||||||||||
echo $FIREBASE_SERVICE_ACCOUNT > $GAC_FILENAME | ||||||||||||||||||
|
@@ -189,6 +231,20 @@ runs: | |||||||||||||||||
GALAXPAY_PARTNER_HASH=$GALAXPAY_PARTNER_HASH | ||||||||||||||||||
DATAFRETE_OPERATOR_TOKEN=$DATAFRETE_OPERATOR_TOKEN | ||||||||||||||||||
MERCADOPAGO_TOKEN=$MERCADOPAGO_TOKEN | ||||||||||||||||||
FRENET_TOKEN:$FRENET_TOKEN | ||||||||||||||||||
GALAXPAY_ID=$GALAXPAY_ID | ||||||||||||||||||
GALAXPAY_HASH=$GALAXPAY_HASH | ||||||||||||||||||
GA_API_TOKEN=$GA_API_TOKEN | ||||||||||||||||||
INFINITEPAY_ID=$INFINITEPAY_ID | ||||||||||||||||||
INFINITEPAY_SECRET=$INFINITEPAY_SECRET | ||||||||||||||||||
FB_GRAPH_TOKEN=$FB_GRAPH_TOKEN | ||||||||||||||||||
JADLOG_CONTRACT_TOKEN=$JADLOG_CONTRACT_TOKEN | ||||||||||||||||||
PAGARME_ENCRYP_KEY=$PAGARME_ENCRYP_KEY | ||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||
PAGARME_TOKEN=$PAGARME_TOKEN | ||||||||||||||||||
PAGHIPER_TOKEN=$PAGHIPER_TOKEN | ||||||||||||||||||
PIX_CREDENTIALS=$PIX_CREDENTIALS | ||||||||||||||||||
FLASHCOURIER_CONTRACT=$FLASHCOURIER_CONTRACT | ||||||||||||||||||
WEBHOOKAPP_TOKEN=$WEBHOOKAPP_TOKEN | ||||||||||||||||||
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.
Suggested change
|
||||||||||||||||||
" > functions/.env | ||||||||||||||||||
if [ -z "$DEPLOY_CODEBASE" ]; then | ||||||||||||||||||
GOOGLE_APPLICATION_CREDENTIALS=$GAC_FILENAME npm run deploy | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,4 +1,5 @@ | ||||
import axios from 'axios'; | ||||
import logger from 'firebase-functions/logger'; | ||||
|
||||
const getDimension = (side, item) => { | ||||
if (item.dimensions && item.dimensions[side]) { | ||||
|
@@ -23,11 +24,18 @@ export default async ({ params, application }) => { | |||
...application.hidden_data, | ||||
}; | ||||
|
||||
if (!config.frenet_access_token) { | ||||
return { | ||||
error: 'FRENET_ERR', | ||||
message: 'Frenet token is unset on app hidden data (calculate unavailable) for this store', | ||||
}; | ||||
if (!process.env.FRENET_TOKEN) { | ||||
const frenetToken = config.frenet_access_token; | ||||
if (typeof frenetToken === 'string' && frenetToken) { | ||||
process.env.FRENET_TOKEN = frenetToken; | ||||
} else { | ||||
logger.warn('Missing Frenet token'); | ||||
|
||||
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.
Suggested change
|
||||
return { | ||||
error: 'FRENET_ERR', | ||||
message: 'Frenet token is unset on app hidden data (calculate unavailable) for this store', | ||||
}; | ||||
} | ||||
} | ||||
|
||||
// https://apx-mods.e-com.plus/api/v1/calculate_shipping/response_schema.json?store_id=100 | ||||
|
@@ -87,7 +95,7 @@ export default async ({ params, application }) => { | |||
method: 'post', | ||||
headers: { | ||||
'Content-Type': 'application/json', | ||||
token: config.frenet_access_token, | ||||
token: process.env.FRENET_TOKEN, | ||||
}, | ||||
data: schema, | ||||
}); | ||||
|
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.