-
-
Notifications
You must be signed in to change notification settings - Fork 25
Add new (optional) front-end TypeScript GUI #162
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
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ba3f006
Add new TypeSCript GUI as optional
mrutkows 766c045
Add JSON editing capabilities
mrutkows 3204c5e
Fix various ts-gui issues
mrutkows 093fe98
Fix various ts-gui issues
mrutkows f2270d5
Fix various ts-gui issues
mrutkows be40368
Fix various ts-gui issues
mrutkows 7eeb98d
Move away from Electron app. to Go server and browser GUI
mrutkows c5f44c2
Move away from Electron app. to Go server and browser GUI
mrutkows 4c236e5
Move away from Electron app. to Go server and browser GUI
mrutkows 15e091f
Fix debug output when no vulns. found
mrutkows 1f895ee
Fix debug output when no vulns. found
mrutkows a0b2788
Fix temp. path issues that could be exploited
mrutkows 3f7ec5c
Fix request body message decoding to prevent exploits
mrutkows 2f12417
Sanitize input filenames that could be exploited
mrutkows 777b1ef
Sanitize input filenames that could be exploited
mrutkows 7b3e7ef
disable customized CodeQL scanning; use org. settings
mrutkows 4fb54a6
Plan for improved user exp. and pkging
mrutkows 1a5beaf
Plan for improved user exp. and pkging
mrutkows 9452063
Support persistent preferences in GUI
mrutkows File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,4 @@ a.txt | |
|
|
||
| # Node / frontend dependencies | ||
| node_modules/ | ||
| preferences.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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. | ||
| */ | ||
|
|
||
| package cmd | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
| "os" | ||
| "path/filepath" | ||
| "testing" | ||
|
|
||
| "github.com/CycloneDX/sbom-utility/utils" | ||
| ) | ||
|
|
||
| func TestPreferencesPrecedence(t *testing.T) { | ||
| // Create a temporary preferences.json file in current working directory | ||
| tempPrefFile := filepath.Join(".", utils.DEFAULT_PREFERENCES_FILENAME) | ||
| defer os.Remove(tempPrefFile) | ||
|
|
||
| prefData := utils.AppPreferences{ | ||
| CLI: utils.CLIPreferences{ | ||
| ConfigLicensePolicyFile: "test/license/license-policy-test-empty.json", | ||
| }, | ||
| } | ||
| encoded, err := json.Marshal(prefData) | ||
| if err != nil { | ||
| t.Fatalf("failed to marshal pref: %v", err) | ||
| } | ||
| if err := os.WriteFile(tempPrefFile, encoded, 0600); err != nil { | ||
| t.Fatalf("failed to write temp pref file: %v", err) | ||
| } | ||
|
|
||
| // 1. Test profile setting applied when no CLI flag is set | ||
| utils.GlobalFlags.ConfigLicensePolicyFile = "" | ||
| initConfigurations() | ||
|
|
||
| // Verify policy loaded from preferences.json is used | ||
| if LicensePolicyConfig == nil { | ||
| t.Fatalf("expected LicensePolicyConfig to be initialized") | ||
| } | ||
|
|
||
| // 2. Test explicit CLI flag overrides preferences.json | ||
| utils.GlobalFlags.ConfigLicensePolicyFile = "test/license/license-policy-test.json" | ||
| initConfigurations() | ||
|
|
||
| // Clean up global flag and restore defaults | ||
| utils.GlobalFlags.ConfigLicensePolicyFile = "" | ||
| _ = os.Remove(tempPrefFile) | ||
| initConfigurations() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.