Skip to content

Commit

Permalink
topic injestion wip done
Browse files Browse the repository at this point in the history
Former-commit-id: 4fc7d62
Former-commit-id: 0aedcadcd47d845816855fdf4ba738e694bda6d5
  • Loading branch information
factoidforrest committed Apr 27, 2022
1 parent 3459253 commit 76c068e
Show file tree
Hide file tree
Showing 33 changed files with 78,096 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ deploy-apigateway-to-firehose.ts
**/ContactForm.jsx
**/generated.ts
**/cdk.out/**
**/generated-schema-1-validator.ts
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ jobs:
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: Documentation Build ${{ job.status }}
SLACK_COLOR: ${{ job.status }}
SLACK_COLOR: ${{ job.status }
54 changes: 54 additions & 0 deletions .github/workflows/topics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2021 by LunaSec (owned by Refinery Labs, Inc)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: topics

on:
push:
branches:
- master

jobs:
checks:
runs-on: ubuntu-latest
env:
HASURA_URL: https://lunatrace.lunasec.io/api/service/v1/graphql
STATIC_SECRET_ACCESS_TOKEN: ${{secrets.HASURA_SERVICE_SECRET}}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-node@v1
with:
node-version: '16'

- name: Yarn Install
env:
IS_LUNASEC_CI: true
CI: true
run: |
yarn install --immutable --immutable-cache --inline-builds --ignore-scripts
- name: Upsert Topics
working-directory: lunatrace/bsl/backend
run: yarn run topics:update

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: always()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: Topics Deployed - ${{ job.status }}
SLACK_COLOR: ${{ job.status }
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "lunatrace/bsl/frontend/src/scss/proprietary-theme"]
path = lunatrace/bsl/frontend/src/scss/proprietary-theme
url = [email protected]:lunasec-io/appstack-theme.git
path = lunatrace/bsl/frontend/src/scss/proprietary-theme
url = [email protected]:lunasec-io/appstack-theme.git
2 changes: 1 addition & 1 deletion .idea/jsLinters/eslint.xml

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

41,984 changes: 41,984 additions & 0 deletions docs/.log391767

Large diffs are not rendered by default.

33,965 changes: 33,965 additions & 0 deletions js/sdks/packages/server-common/.log14192

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lunatrace/bsl/backend/.log131443.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6d10d46c73ab5e33b60ccaf298d7aa284c0ac9cf
3 changes: 3 additions & 0 deletions lunatrace/bsl/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test:load": "yarn run ts-node --files ./src/tests/local-load-vulnerabilities-test.ts",
"test:jest": "jest",
"vulnerabilities:update": "yarn run ts-node --files ./src/tests/upsert-vulns.ts",
"topics:update": "yarn run ts-node --files ./src/topic-ingester/cmd.ts ../topics",
"test:deleted": "yarn run ts-node --files ./src/tests/deleted-vulns-scan.ts",
"start:prod": "pm2-runtime start ./build/server.js --name demo-back-end",
"generate:hasura-calls": "graphql-codegen --config codegen.yml",
Expand Down Expand Up @@ -46,6 +47,7 @@
"@types/deepmerge": "^2.2.0",
"@types/eventsource": "^1.1.8",
"@types/express-jwt": "^6.0.4",
"@types/js-yaml": "~4.0.5",
"@types/markdown-table": "2.0.0",
"aws-lambda": "^1.0.7",
"aws-sdk": "^2.1082.0",
Expand All @@ -61,6 +63,7 @@
"graphql": "^16.3.0",
"graphql-request": "^4.0.0",
"graphql-tag": "^2.12.6",
"js-yaml": "~4.1.0",
"jwks-rsa": "^2.0.5",
"jwt-decode": "^3.1.2",
"markdown-table": "2.0.0",
Expand Down
5 changes: 3 additions & 2 deletions lunatrace/bsl/backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import {
ServerConfig,
} from './types/config';

const checkEnvVar = (envVarKey: string, defaultValue?: string) => {
export const checkEnvVar = (envVarKey: string, defaultValue?: string) => {
const envVar = process.env[envVarKey];

// If the environment variable is not set, and the value must come from the environment, AND we are in production and the default value is not defined.
// If the environment variable is not set, and the value must come from the environment,
// AND we are in production and the default value is not defined.
// then throw an error
if (!envVar && defaultValue === undefined) {
throw new Error(`Missing ${envVarKey} env var`);
Expand Down
Loading

0 comments on commit 76c068e

Please sign in to comment.