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

Commit

Permalink
Merge pull request #37 from forseti-security/ui-updates
Browse files Browse the repository at this point in the history
Consolidate magic nums/strings into Imported Constants
  • Loading branch information
garrettwong authored Sep 24, 2019
2 parents d6b4002 + 959541b commit bd194ad
Show file tree
Hide file tree
Showing 28 changed files with 623 additions and 517 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ clah_source.env
clah_dockersource.env
dockersource.env
asdf.env.enc
config.json

# Keys
sa-key.json
Expand Down
20 changes: 20 additions & 0 deletions forseti-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ export FORSETI_SERVER_VM_CHANNEL="[VM_IP]:[GRPC_PORT]"
export FORSETI_DATA_MODEL_HANDLE="[DATA_MODEL_HANDLE_HASH:21254f1de747879237a95cb552e80844]"
EOF

# create auth config.json for authenticating
# refer to instructions on setting up project authentication
cat > server/config.json << EOF
{
"host": "0.0.0.0",
"port": 8080,
"bodyLimit": "100kb",
"corsHeaders": ["Link"],
"GCLOUD_PROJECT": "[PROJECT_ID]",
"DATA_BACKEND": "datastore",
"NODE_ENV": "",
"OAUTH2_CLIENT_ID": "[SERVICE_ACCOUNT_NAME]@apps.googleusercontent.com",
"OAUTH2_CLIENT_SECRET": "[CLIENT_SECRET]",
"OAUTH2_CALLBACK": "http://localhost:8080/auth/google/callback",
"SECRET": "[SECRET]"
}
EOF


npm install
source source.env
# the forseti-api server runs on localhost port 8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
"member": "user/[email protected]",
"role": "roles/resourcemanager.folderEditor"
}, {
"resources": ["project/gwc-core"],
"resources": ["project/the-core"],
"member": "user/[email protected]",
"role": "roles/compute.admin"
}, {
"resources": ["project/gwc-core"],
"resources": ["project/the-core"],
"member": "user/[email protected]",
"role": "roles/editor"
}, {
Expand All @@ -67,7 +67,7 @@
"member": "user/[email protected]",
"role": "roles/owner"
}, {
"resources": ["mls-bucket"],
"resources": ["tf-lb-https-gke"],
"member": "user/[email protected]",
"role": "roles/storage.admin"
"role": "roles/container.admin"
}]
2 changes: 1 addition & 1 deletion forseti-api/dist-forseti-visualizer-ui/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>Forseti-Visualizer</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link ref=stylesheet href=https://use.fontawesome.com/releases/v5.1.0/css/all.css><link href=/css/app.d10c1184.css rel=preload as=style><link href=/css/chunk-vendors.112e7008.css rel=preload as=style><link href=/js/app.0787ac60.js rel=preload as=script><link href=/js/chunk-vendors.970ee17e.js rel=preload as=script><link href=/css/chunk-vendors.112e7008.css rel=stylesheet><link href=/css/app.d10c1184.css rel=stylesheet></head><body><noscript><strong>We're sorry but forseti-visualizer-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.970ee17e.js></script><script src=/js/app.0787ac60.js></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>Forseti-Visualizer</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link ref=stylesheet href=https://use.fontawesome.com/releases/v5.1.0/css/all.css><link href=/css/app.4eb5fd76.css rel=preload as=style><link href=/css/chunk-vendors.112e7008.css rel=preload as=style><link href=/js/app.705a2d05.js rel=preload as=script><link href=/js/chunk-vendors.970ee17e.js rel=preload as=script><link href=/css/chunk-vendors.112e7008.css rel=stylesheet><link href=/css/app.4eb5fd76.css rel=stylesheet></head><body><noscript><strong>We're sorry but forseti-visualizer-ui doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.970ee17e.js></script><script src=/js/app.705a2d05.js></script></body></html>
4 changes: 2 additions & 2 deletions forseti-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "forseti-visualizer-api",
"version": "1.0.1",
"description": "Forseti Viz API to serve Forseti Based GCP content",
"version": "1.0.2",
"description": "Forseti Visualizer API to serve Forseti Based GCP content",
"author": "Garrett Wong",
"main": "server.js",
"scripts": {
Expand Down
13 changes: 1 addition & 12 deletions forseti-api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,10 @@ app.use('/api', api({
// set up / main route
app.get('/', (req, res) => {
res.render('index', {
title: `Hello World`
title: `Forseti-Visualizer`
});
});

// test routes
app.get('/home', function (req, res) {
res.send('GET: ' + req.url);
});

app.post('/home', function (req, res) {
res.send('POST: ' + req.url);
});




/* AUTH */

Expand Down
17 changes: 0 additions & 17 deletions forseti-api/server/config.json

This file was deleted.

2 changes: 1 addition & 1 deletion forseti-visualizer-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forseti-visualizer-ui",
"version": "1.0.1",
"version": "1.0.2",
"private": true,
"scripts": {
"build": "vue-cli-service build",
Expand Down
8 changes: 4 additions & 4 deletions forseti-visualizer-ui/public/dataset1_iamexplainbyuser.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
"member": "user/[email protected]",
"role": "roles/resourcemanager.folderEditor"
}, {
"resources": ["project/gwc-core"],
"resources": ["project/the-core"],
"member": "user/[email protected]",
"role": "roles/compute.admin"
}, {
"resources": ["project/gwc-core"],
"resources": ["project/the-core"],
"member": "user/[email protected]",
"role": "roles/editor"
}, {
Expand All @@ -67,7 +67,7 @@
"member": "user/[email protected]",
"role": "roles/owner"
}, {
"resources": ["mls-bucket"],
"resources": ["tf-lb-https-gke"],
"member": "user/[email protected]",
"role": "roles/storage.admin"
"role": "roles/container.admin"
}]
4 changes: 2 additions & 2 deletions forseti-visualizer-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<v-toolbar app>
<v-toolbar-title class="headline text-uppercase">
<span>Forseti</span>
<span class="font-weight-light">Viz</span>
<span class="font-weight-light">Visualizer</span>
</v-toolbar-title>
<v-spacer></v-spacer>

<router-link to="/viz">
<v-btn flat>Viz</v-btn>
<v-btn flat>Visualizer</v-btn>
</router-link>
<!-- <router-link to="/violations">
<v-btn flat>violations</v-btn>
Expand Down
Loading

0 comments on commit bd194ad

Please sign in to comment.