Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
feat: adds auth (#351)
Browse files Browse the repository at this point in the history
* feat: adds auth
  • Loading branch information
cujarrett committed Jan 9, 2023
1 parent b7c92e2 commit f7f7d7f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: actions/setup-node@v3
- run: npm ci
- run: npm run lint
- run: npm run test-exclude-twitter
- run: npm run test-exclude-vendors
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "eslint .",
"fix-lint": "eslint . --fix",
"test": "nyc ava --timeout=30s",
"test-exclude-twitter": "nyc ava --match='!*Twitter*' --timeout=20s",
"test-exclude-vendors": "nyc ava --match='!*Integration*'",
"build": "npm set-script prepare '' && npm install --production && rm -rf build && mkdir build && zip -r -q -x='*media*' -x='package-lock.json' -x='*terraform*' -x=*coverage* -x='*.md' -x='LICENSE' -x='*build*' -x='*test*' -x='*.DS_Store*' -x='*.nyc_output*' -x='*.git*' -x='*.nycrc' -x='*.eslintrc.js' -x='release.config.js' -x='commitlint.config.js' build/destiny-insights-bot.zip . && du -sh build && npm set-script prepare 'husky install'",
"deploy": "aws lambda update-function-code --function-name=destiny-insights-bot --zip-file=fileb://build/destiny-insights-bot.zip --region=us-east-1 1> /dev/null",
"ci": "npm run lint && npm run test",
Expand Down
4 changes: 4 additions & 0 deletions src/integrations/destiny-insights-backend.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const fetch = (...args) => import("node-fetch").then(({ default: fetch }) => fetch(...args))
const { getParameters } = require("./aws-parameter-store.js")

module.exports.getVendorInventory = async (vendor) => {
console.log(`getVendorInventory for ${vendor} called`)
const { DESTINY_INSIGHTS_BACKEND_AUTH_KEY } = await getParameters()

const endpoint = `https://api.destinyinsights.com/${vendor}`
const options = {
method: "GET",
headers: { "key": DESTINY_INSIGHTS_BACKEND_AUTH_KEY },
json: true
}
const maxRetries = 3
Expand Down

0 comments on commit f7f7d7f

Please sign in to comment.