github.com/CycloneDX/sbom-utility@v0.16.0/schema/constants.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  /*
     3   * Licensed to the Apache Software Foundation (ASF) under one or more
     4   * contributor license agreements.  See the NOTICE file distributed with
     5   * this work for additional information regarding copyright ownership.
     6   * The ASF licenses this file to You under the Apache License, Version 2.0
     7   * (the "License"); you may not use this file except in compliance with
     8   * the License.  You may obtain a copy of the License at
     9   *
    10   *     http://www.apache.org/licenses/LICENSE-2.0
    11   *
    12   * Unless required by applicable law or agreed to in writing, software
    13   * distributed under the License is distributed on an "AS IS" BASIS,
    14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15   * See the License for the specific language governing permissions and
    16   * limitations under the License.
    17   */
    18  
    19  package schema
    20  
    21  // Supported schemas will be identified (or "keyed") uniquely using values:
    22  // - Format ID (e.g., "SPDXRef-DOCUMENT", "CycloneDX") - identifies the format/standard
    23  // - Schema version (e.g., "SPDX-2.2", "" )
    24  // ASSUMPTIONS:
    25  // - Since we see that both SPDX and CycloneDX both support "semver" of their specification versions
    26  // BUT, they only provide the "MAJOR.MINOR" components of "semver" we will use the
    27  // "latest" ".PATCH" version of the JSON schema to test against
    28  // NOTE: If any of these 3 components are not found in an SBOM then the schema is not deterministic.
    29  // TODO:  support "override" or "supplemental" (defaults) to be provided on the command line.
    30  // TODO: Allow for discrete "semver" for a schema to be provided as an override
    31  // that includes full "MAJOR.MINOR.PATCH" granularity
    32  
    33  // Format ID (key component)
    34  // UNUSED, TODO Use these values to verify remotely loaded schema files
    35  const (
    36  	ID_SPDX      = "SPDXRef-DOCUMENT"
    37  	ID_CYCLONEDX = "CycloneDX"
    38  )
    39  
    40  // Document property keys
    41  // JSON document property keys to lookup values in their respective SBOM formats
    42  // UNUSED, TODO Use these values to verify remotely loaded schema files
    43  const (
    44  	// SPDX
    45  	PROPKEY_ID_SPDX      = "SPDXID"
    46  	PROPKEY_VERSION_SPDX = "spdxVersion"
    47  	// CycloneDX
    48  	PROPKEY_ID_CYCLONEDX      = "bomFormat"
    49  	PROPKEY_VERSION_CYCLONEDX = "specVersion"
    50  )