Skip to content
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

Add config options for BOM upload storage #101

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
"bearer_token_auth_enable": "Authenticate with a personal access token",
"bom_formats": "BOM Formats",
"bom_formats_desc": "Enables support for processing BOMs of various formats. Only BOM formats which are enabled will be processed.",
"bom_upload_storage": "BOM Upload Storage",
"bom_upload_storage_compression_level": "Compression Level",
"bom_upload_storage_provider": "Provider",
"bom_validation": "BOM Validation",
"bom_validation_info": "Historically, Dependency-Track did not validate uploaded BOMs and VEXs against the CycloneDX schema. While this allowed BOMs to be processed that did not strictly adhere to the schema, it could lead to confusion when uploaded files were accepted, but then failed to be ingested during asynchronous processing. Starting with this release, uploaded files will be rejected if they fail schema validation. Note that this may reveal issues in BOM generators that currently produce invalid CycloneDX documents",
"cargo": "Cargo",
Expand Down
73 changes: 72 additions & 1 deletion src/views/administration/configuration/BomFormats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,59 @@
{{ $t('admin.bom_validation_info') }}
</p>
</div>
<div>
<b-form-group
:label="$t('admin.bom_upload_storage')"
label-size="lg"
label-class="font-weight-bold pt-0 mb-2"
>
<b-form-group
:label="$t('admin.bom_upload_storage_provider')"
label-for="bomUploadStorageProviderSelect"
label-cols="4"
label-cols-lg="2"
content-cols-sm
content-cols-lg="4"
>
<b-form-select
id="bomUploadStorageProviderSelect"
v-model="bomUploadStorageProvider"
>
<b-form-select-option
value="org.dependencytrack.storage.DatabaseBomUploadStorageProvider"
>Database</b-form-select-option
>
<b-form-select-option
value="org.dependencytrack.storage.LocalBomUploadStorageProvider"
>Local</b-form-select-option
>
</b-form-select>
</b-form-group>
<b-form-group
:label="$t('admin.bom_upload_storage_compression_level')"
label-for="bomUploadStorageCompressionLevelInput"
label-cols="4"
label-cols-lg="2"
content-cols-sm
content-cols-lg="4"
>
<b-form-row class="mt-2">
<b-col cols="11">
<b-form-input
id="bomUploadStorageCompressionLevelInput"
v-model="bomUploadStorageCompressionLevel"
type="range"
min="1"
max="22"
/>
</b-col>
<b-col cols="1">
<span>{{ bomUploadStorageCompressionLevel }}</span>
</b-col>
</b-form-row>
</b-form-group>
</b-form-group>
</div>
</b-card-body>
<b-card-footer>
<b-button variant="outline-primary" class="px-4" @click="saveChanges">{{
Expand All @@ -49,6 +102,8 @@ export default {
return {
isCycloneDXEnabled: false,
bomValidate: true,
bomUploadStorageProvider: null,
bomUploadStorageCompressionLevel: null,
};
},
methods: {
Expand All @@ -64,13 +119,23 @@ export default {
propertyName: 'bom.validation.enabled',
propertyValue: this.bomValidate,
},
{
groupName: 'artifact',
propertyName: 'bom.upload.storage.provider',
propertyValue: this.bomUploadStorageProvider,
},
{
groupName: 'artifact',
propertyName: 'bom.upload.storage.compression.level',
propertyValue: this.bomUploadStorageCompressionLevel,
},
]);
},
},
created() {
this.axios.get(this.configUrl).then((response) => {
let configItems = response.data.filter(function (item) {
return item.groupName === 'artifact' && item.propertyType === 'BOOLEAN';
return item.groupName === 'artifact';
});
for (let i = 0; i < configItems.length; i++) {
let item = configItems[i];
Expand All @@ -82,6 +147,12 @@ export default {
case 'bom.validation.enabled':
this.bomValidate = common.toBoolean(item.propertyValue);
break;
case 'bom.upload.storage.provider':
this.bomUploadStorageProvider = item.propertyValue;
break;
case 'bom.upload.storage.compression.level':
this.bomUploadStorageCompressionLevel = item.propertyValue;
break;
}
}
});
Expand Down
Loading