Skip to content

License not converted to SHA-512 #258

Open
@AfshinOnline

Description

@AfshinOnline

Current Behavior:

The license type is not automatically picked up for the component eg if it is permissive MIT license it still appears on error.
When one attempts to update the component type manually and mention license type this error response observed in the call:

[{"message":"The SHA-512 hash must be a valid 128 character HEX number","messageTemplate":"The SHA-512 hash must be a valid 128 character HEX number","path":"sha512","invalidValue":"696720AC242F41BFCB4C9A97C059446196BCB91CFCC4D0C485CBC113B925BF8B07ECF861E533BCAC020C3D079471A25668173782EF0D7A4486F0FB46B762A8BF"}]

Steps to Reproduce:

When selecting projects -> clicking on project name -> policy violations -> component name -> details -> legal tab to change the license type -> press Update

Error received and license not updated.

Expected Behavior:

The component should update the license to the one selected in the options.

Environment:

  • Dependency-Track Version: 4.5.0 latest
  • Client Browser: Chrome
  • Client O/S: Windows 10 pro

Additional Details:

This is the curl for the request:

curl 'http://localhost:8080/api/v1/component'
-H 'Accept: application/json, text/plain, /'
-H 'Accept-Language: en-US,en;q=0.9'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImlzcyI6IkRlcGVuZGVuY3ktVHJhY2siLCJpYXQiOjE2NjM5MzcwMzgsImV4cCI6MTY2NDU0MTgzOCwicGVybWlzc2lvbnMiOiJBQ0NFU1NfTUFOQUdFTUVOVCxCT01fVVBMT0FELFBPTElDWV9NQU5BR0VNRU5ULFBPTElDWV9WSU9MQVRJT05fQU5BTFlTSVMsUE9SVEZPTElPX01BTkFHRU1FTlQsUFJPSkVDVF9DUkVBVElPTl9VUExPQUQsU1lTVEVNX0NPTkZJR1VSQVRJT04sVklFV19QT0xJQ1lfVklPTEFUSU9OLFZJRVdfUE9SVEZPTElPLFZJRVdfVlVMTkVSQUJJTElUWSxWVUxORVJBQklMSVRZX0FOQUxZU0lTLFZVTE5FUkFCSUxJVFlfTUFOQUdFTUVOVCxBQ0NFU1NfTUFOQUdFTUVOVCxCT01fVVBMT0FELFBPTElDWV9NQU5BR0VNRU5ULFBPTElDWV9WSU9MQVRJT05fQU5BTFlTSVMsUE9SVEZPTElPX01BTkFHRU1FTlQsUFJPSkVDVF9DUkVBVElPTl9VUExPQUQsU1lTVEVNX0NPTkZJR1VSQVRJT04sVklFV19QT0xJQ1lfVklPTEFUSU9OLFZJRVdfUE9SVEZPTElPLFZJRVdfVlVMTkVSQUJJTElUWSxWVUxORVJBQklMSVRZX0FOQUxZU0lTLFZVTE5FUkFCSUxJVFlfTUFOQUdFTUVOVCIsImlkcCI6IkxPQ0FMIn0.Pkb1yUOgQT9Xg3Msc0dBrdnwpM4UWfj971LHnMj2Nyw'
-H 'Connection: keep-alive'
-H 'Content-Type: application/json'
-H 'DNT: 1'
-H 'Origin: http://localhost:8080'
-H 'Referer: http://localhost:8080/components/8fc34b85-70df-4ec9-801d-ad44c652132e'
-H 'Sec-Fetch-Dest: empty'
-H 'Sec-Fetch-Mode: cors'
-H 'Sec-Fetch-Site: same-origin'
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36'
-H 'sec-ch-ua: "Google Chrome";v="105", "Not)A;Brand";v="8", "Chromium";v="105"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "Windows"'
--data-raw '{"uuid":"8fc34b85-70df-4ec9-801d-ad44c652132e","name":"Polly","version":"7.2.3","description":"Polly is a library that allows developers to express resilience and transient fault handling policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner.","license":"BSD-1-Clause","classifier":"LIBRARY","purl":"pkg:nuget/[email protected]","copyright":"Copyright (c) 2022, App vNext","sha512":"696720AC242F41BFCB4C9A97C059446196BCB91CFCC4D0C485CBC113B925BF8B07ECF861E533BCAC020C3D079471A25668173782EF0D7A4486F0FB46B762A8BF"}'
--compressed

When replacing the number in sha512 : 696720AC242F41BFCB4C9A97C059446196BCB91CFCC4D0C485CBC113B925BF8B07ECF861E533BCAC020C3D079471A25668173782EF0D7A4486F0FB46B762A8BF
to
d78f942facb306330026197b51974b2fbcd91ef67a2b4657583cbe7fe396a5125fe9f10020b0d17f0a2b9fa354baafd4da8fcae5ae4a567053e0eee7c2f7b3bf
the update occurs.

Bug was tracked down to frontend code

<b-input-group-form-select id="component-license-input" required="false"

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions