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

feat(spdx): Add API for SPDX Document tab #2402

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tuannn2
Copy link
Contributor

@tuannn2 tuannn2 commented Apr 12, 2024

  • Get SPDX Document Information
  • Update SPDX Document Information

How To Test?

1. Get SPDX Document information

  • Run command line:
curl 'https://sw360.org/api/releases/3765276512' -i -X GET \
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsic3czNjAtUkVTVC1BUEkiXSwidXNlcl9uYW1lIjoiYWRtaW5Ac3czNjAub3JnIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTcxMjkxOTg2NywiYXV0aG9yaXRpZXMiOlsiUkVBRCIsIldSSVRFIl0sImp0aSI6IlFNd3UxMFVWdUUwdFd3MkV5VnRsQm1OdGRzdyIsImNsaWVudF9pZCI6InRydXN0ZWQtc3czNjAtY2xpZW50In0.Xp3TdSvb2oQ77zqg8RLaz4F47vFEX0lPL4ijmKRmL9udAUWvV0GMWYeKVwYAQSDlPYPwqGxSk66wRp0R7hrpemKEAfmfA2X5V6-xwUaPsnV9nklr0wm_PGHxQDQIwI9yHDXwkRw9sYtFH67oQt32KRAJOeQnAkzT2Hgy3Ok45_XRmhQM9xcISdEOHN3svf6719pJbRJ-YRtLiRqhGaJGqbiCB6Iixu55zx0buqZc0PMPP-lwHQksiMGujXj1yQGeSt5FChuk87cxSqSLkkD56RVYUDeTa5g6kUsFdWHOHC6vpzT0TK5ihP_y2JhfvNKWy6nLgNxnqaQavvaOeoXZoA' \
    -H 'Accept: application/hal+json'

2. Update SPDX Document information

  • Run command line:
curl 'https://sw360.org/api/releases/12121212/spdx' -i -X PATCH \
    -H 'Content-Type: application/hal+json' \
    -H 'Authorization: BearereyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsic3czNjAtUkVTVC1BUEkiXSwidXNlcl9uYW1lIjoiYWRtaW5Ac3czNjAub3JnIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTcxMjkxOTg2NywiYXV0aG9yaXRpZXMiOlsiUkVBRCIsIldSSVRFIl0sImp0aSI6IjU3V0FjbWdBamFsTnNlNktXTE9qNzd4MzJENCIsImNsaWVudF9pZCI6InRydXN0ZWQtc3czNjAtY2xpZW50In0.bqnOCLGdOiYGj8liZazzGJw2ce1ahXrnv7nJxHM47J0E3MoQsHea7DAOhPYLNubZMFpjq8ynHwss8ZsxtoKFdJ8V_7zy5M4mpECwybOSqmx94qksl3vDjQwOOpGTWLshezZ1k8w1w-LeA9CecNSe9t_0K-kdOoGMDMGYfDuVQLOv67QGtuxYI--ZlH_xh-wc6AzLHFuh6rTkoi14N50OI5jBI8PK-bajdcce1m0KCPplgVwMWX5cu9hpvLcDJOq9EYf3ezWQzlcMHNDRR-_CNkKbs1XX4Jsri-KZEssSB8dQ9C2LZA5SK1mQartmXcY3rINPxVh5XmLDwufzrjcymQ' \
    -H 'Accept: application/hal+json' \
    -d '{
  "packageInformation" : {
    "type" : "packageInformation",
    "name" : "11",
    "SPDXID" : "SPDXRef-Package-11",
    "versionInfo" : "11",
    "packageFileName" : "11",
    "supplier" : "Organization: 11",
    "originator" : "Organization: 11",
    "downloadLocation" : "11",
    "filesAnalyzed" : true,
    "packageVerificationCode" : {
      "excludedFiles" : [ "11" ],
      "value" : "11"
    },
    "checksums" : [ {
      "algorithm" : "11",
      "checksumValue" : "1111",
      "index" : 0
    } ],
    "homepage" : "11",
    "sourceInfo" : "11",
    "licenseConcluded" : "11",
    "licenseInfoFromFiles" : [ "11" ],
    "licenseDeclared" : "11",
    "licenseComments" : "11",
    "copyrightText" : "11",
    "summary" : "11",
    "description" : "11",
    "packageComment" : "11",
    "externalRefs" : [ {
      "referenceCategory" : "SECURITY",
      "referenceLocator" : "11",
      "referenceType" : "cpe22Type",
      "comment" : "11",
      "index" : 0
    } ],
    "attributionText" : [ "11" ],
    "annotations" : [ ],
    "primaryPackagePurpose" : "11",
    "releaseDate" : "2023-11-10T07:30:39Z",
    "builtDate" : "2023-11-09T07:29:43Z",
    "validUntilDate" : "2023-11-22T07:30:47Z",
    "relationships" : [ {
      "spdxElementId" : "11",
      "relationshipType" : "11",
      "relatedSpdxElement" : "11",
      "relationshipComment" : "11",
      "index" : 0
    } ],
    "moderators" : [ ]
  },
  "spdxDocument" : {
    "type" : "SPDXDocument",
    "spdxFileInfoIds" : [ ],
    "snippets" : [ {
      "SPDXID" : "SPDXRef-Snippet-11",
      "snippetFromFile" : "SPDXRef-11",
      "snippetRanges" : [ {
        "rangeType" : "11",
        "startPointer" : "11",
        "endPointer" : "11",
        "reference" : "11",
        "index" : 0
      } ],
      "licenseConcluded" : "11",
      "licenseInfoInSnippets" : [ "11" ],
      "licenseComments" : "11",
      "copyrightText" : "11",
      "comment" : "11",
      "name" : "11",
      "snippetAttributionText" : "11",
      "index" : 0
    } ],
    "relationships" : [ {
      "spdxElementId" : "11",
      "relationshipType" : "11",
      "relatedSpdxElement" : "11",
      "relationshipComment" : "11",
      "index" : 0
    } ],
    "annotations" : [ {
      "annotator" : "Organization: 11",
      "annotationDate" : "2023-11-14T07:31:11Z",
      "annotationType" : "11",
      "spdxIdRef" : "11",
      "annotationComment" : "11",
      "index" : 0
    } ],
    "otherLicensingInformationDetecteds" : [ {
      "licenseId" : "LicenseRef-11",
      "extractedText" : "11",
      "licenseName" : "11",
      "licenseCrossRefs" : [ "11" ],
      "licenseComment" : "11",
      "index" : 0
    } ],
    "documentState" : {
      "isOriginalDocument" : true,
      "moderationState" : null,
      "setModerationState" : false,
      "setIsOriginalDocument" : true
    },
    "moderators" : [ ]
  },
  "documentCreationInformation" : {
    "type" : "documentCreationInformation",
    "spdxVersion" : "SPDX-3333",
    "dataLicense" : "11",
    "SPDXID" : "SPDXRef-1111",
    "name" : "11",
    "documentNamespace" : "11",
    "externalDocumentRefs" : [ {
      "externalDocumentId" : "11",
      "checksum" : {
        "algorithm" : "11",
        "checksumValue" : "11",
        "index" : 0
      },
      "spdxDocument" : "11",
      "index" : 0
    } ],
    "licenseListVersion" : "11",
    "creator" : [ {
      "type" : "Person",
      "value" : "Test Admin ([email protected])",
      "index" : 0
    } ],
    "created" : "2023-11-27T07:25:40Z",
    "creatorComment" : "11",
    "documentComment" : "11",
    "createdBy" : "[email protected]",
    "moderators" : [ ]
  }
}'

Checklist

Must:

  • All related issues are referenced in commit messages and in PR

@tienlee tienlee added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for REST New-UI Level for the API and UI level changes for the new-ui labels Apr 12, 2024
@hoangnt2 hoangnt2 force-pushed the release/add_api_spdx_document branch 2 times, most recently from f004f4d to 1b39c93 Compare May 6, 2024 02:22
@hoangnt2 hoangnt2 force-pushed the release/add_api_spdx_document branch from 1b39c93 to 6fb4767 Compare May 21, 2024 03:53
@hoangnt2 hoangnt2 force-pushed the release/add_api_spdx_document branch 3 times, most recently from 212eca8 to 920a116 Compare May 31, 2024 10:29
@GMishx
Copy link
Member

GMishx commented Oct 17, 2024

@tuannn2 please rebase the branch for resolving merge conflict.

@rudra-superrr @afsahsyeda please help with review/test.

@hoangnt2 hoangnt2 self-assigned this Oct 31, 2024
@hoangnt2 hoangnt2 force-pushed the release/add_api_spdx_document branch 2 times, most recently from 59ff8aa to 2d01cb3 Compare October 31, 2024 08:49
@KoukiHama
Copy link
Member

@tienlee @hoangnt2 @shi9qiu
Could you check this PR?

@hoangnt2 hoangnt2 force-pushed the release/add_api_spdx_document branch from 2d01cb3 to f130836 Compare October 31, 2024 09:13
@hoangnt2
Copy link
Contributor

@KoukiHama, I am checking it

@hoangnt2 hoangnt2 force-pushed the release/add_api_spdx_document branch from f130836 to 430c931 Compare November 6, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs code review needs general test This is general testing, meaning that there is no org specific issue to check for New-UI Level for the API and UI level changes for the new-ui REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants