Skip to content

Commit 76c068e

Browse files
topic injestion wip done
Former-commit-id: 4fc7d62 Former-commit-id: 0aedcadcd47d845816855fdf4ba738e694bda6d5
1 parent 3459253 commit 76c068e

File tree

33 files changed

+78096
-11
lines changed

33 files changed

+78096
-11
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ deploy-apigateway-to-firehose.ts
1313
**/ContactForm.jsx
1414
**/generated.ts
1515
**/cdk.out/**
16+
**/generated-schema-1-validator.ts

.github/workflows/documentation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ jobs:
7474
env:
7575
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
7676
SLACK_TITLE: Documentation Build ${{ job.status }}
77-
SLACK_COLOR: ${{ job.status }}
77+
SLACK_COLOR: ${{ job.status }

.github/workflows/topics.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2021 by LunaSec (owned by Refinery Labs, Inc)
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
name: topics
16+
17+
on:
18+
push:
19+
branches:
20+
- master
21+
22+
jobs:
23+
checks:
24+
runs-on: ubuntu-latest
25+
env:
26+
HASURA_URL: https://lunatrace.lunasec.io/api/service/v1/graphql
27+
STATIC_SECRET_ACCESS_TOKEN: ${{secrets.HASURA_SERVICE_SECRET}}
28+
steps:
29+
- uses: actions/checkout@v2
30+
with:
31+
fetch-depth: 0
32+
33+
- uses: actions/setup-node@v1
34+
with:
35+
node-version: '16'
36+
37+
- name: Yarn Install
38+
env:
39+
IS_LUNASEC_CI: true
40+
CI: true
41+
run: |
42+
yarn install --immutable --immutable-cache --inline-builds --ignore-scripts
43+
44+
- name: Upsert Topics
45+
working-directory: lunatrace/bsl/backend
46+
run: yarn run topics:update
47+
48+
- name: Slack Notification
49+
uses: rtCamp/action-slack-notify@v2
50+
if: always()
51+
env:
52+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
53+
SLACK_TITLE: Topics Deployed - ${{ job.status }}
54+
SLACK_COLOR: ${{ job.status }

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "lunatrace/bsl/frontend/src/scss/proprietary-theme"]
2-
path = lunatrace/bsl/frontend/src/scss/proprietary-theme
3-
url = [email protected]:lunasec-io/appstack-theme.git
2+
path = lunatrace/bsl/frontend/src/scss/proprietary-theme
3+
url = [email protected]:lunasec-io/appstack-theme.git

.idea/jsLinters/eslint.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.log391767

Lines changed: 41984 additions & 0 deletions
Large diffs are not rendered by default.

js/sdks/packages/server-common/.log14192

Lines changed: 33965 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6d10d46c73ab5e33b60ccaf298d7aa284c0ac9cf

lunatrace/bsl/backend/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"test:load": "yarn run ts-node --files ./src/tests/local-load-vulnerabilities-test.ts",
1515
"test:jest": "jest",
1616
"vulnerabilities:update": "yarn run ts-node --files ./src/tests/upsert-vulns.ts",
17+
"topics:update": "yarn run ts-node --files ./src/topic-ingester/cmd.ts ../topics",
1718
"test:deleted": "yarn run ts-node --files ./src/tests/deleted-vulns-scan.ts",
1819
"start:prod": "pm2-runtime start ./build/server.js --name demo-back-end",
1920
"generate:hasura-calls": "graphql-codegen --config codegen.yml",
@@ -46,6 +47,7 @@
4647
"@types/deepmerge": "^2.2.0",
4748
"@types/eventsource": "^1.1.8",
4849
"@types/express-jwt": "^6.0.4",
50+
"@types/js-yaml": "~4.0.5",
4951
"@types/markdown-table": "2.0.0",
5052
"aws-lambda": "^1.0.7",
5153
"aws-sdk": "^2.1082.0",
@@ -61,6 +63,7 @@
6163
"graphql": "^16.3.0",
6264
"graphql-request": "^4.0.0",
6365
"graphql-tag": "^2.12.6",
66+
"js-yaml": "~4.1.0",
6467
"jwks-rsa": "^2.0.5",
6568
"jwt-decode": "^3.1.2",
6669
"markdown-table": "2.0.0",

lunatrace/bsl/backend/src/config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ import {
2323
ServerConfig,
2424
} from './types/config';
2525

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

29-
// 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.
29+
// If the environment variable is not set, and the value must come from the environment,
30+
// AND we are in production and the default value is not defined.
3031
// then throw an error
3132
if (!envVar && defaultValue === undefined) {
3233
throw new Error(`Missing ${envVarKey} env var`);

0 commit comments

Comments
 (0)