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(license): Update Whitelist for License #2266

Merged

Conversation

tuannn2
Copy link
Contributor

@tuannn2 tuannn2 commented Jan 10, 2024

Feature

  • Feature Update Whitelist in License Page

How To Test?

  • Run command
curl 'https://sw360.org/api/licenses/Apache-2.0/whitelist' -i -X PATCH \
    -H 'Content-Type: application/hal+json' \
    -H 'Authorization: BearereyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsic3czNjAtUkVTVC1BUEkiXSwidXNlcl9uYW1lIjoiYWRtaW5Ac3czNjAub3JnIiwic2NvcGUiOlsiYWxsIl0sImV4cCI6MTcwNDg4MzY5OSwiYXV0aG9yaXRpZXMiOlsiUkVBRCIsIldSSVRFIl0sImp0aSI6ImRJc0ZOSml3ckhHRjE1ZHJrZzBCX1JSX21rVSIsImNsaWVudF9pZCI6InRydXN0ZWQtc3czNjAtY2xpZW50In0.iuADty2_ZFsM1ETIqAJIV43oM9djLO1aNnNfYyArigg71mbFqjsrxL0q_n9GZcCqtLIJQfIiIjv6g7v8SFC-fS5RsIw0rDRFjHAydIUWdr8lhG96YomWAFfJNicIng6h1q6FU-JUbzPgneYStkGJQ1RXUWUMGO9_nMzimED7oI56JPL4DiicyS0Q7QzNnvTIx3zyub7SjWXGEM82Lc4DzweLIdL3G7tmklHxU2nIbL0ch9xhhEjgZiiTik3t0s-z-LXVlLqCui7lgvHi1n9CZ6VKdyA_s5KtjrdLSBYlWa2R8l6_dyPY5lvVhyIUr6ozx5mCHUPpfVsf1uc0Wedcsg' \
    -H 'Accept: application/hal+json' \
    -d '{
  "0002" : true,
  "0001" : true
}'
  • Output
{
  "externalLicenseLink" : "https://spdx.org/licenses/Apache-2.0.html",
  "note" : "License's Note",
  "externalIds" : {
    "Trove" : "License :: OSI Approved :: Apache Software License",
    "SPDX" : "Apache-2.0"
  },
  "additionalData" : {
    "Key" : "Value"
  },
  "OSIApproved" : "NA",
  "FSFLibre" : "NA",
  "obligations" : [ {
    "type" : "obligation",
    "text" : "This is text of Obligation 1",
    "whitelist" : [ "Department" ],
    "title" : "Obligation 1",
    "obligationLevel" : "LICENSE_OBLIGATION",
    "obligationType" : "PERMISSION"
  }, {
    "type" : "obligation",
    "text" : "This is text of Obligation 2",
    "whitelist" : [ "Department2" ],
    "title" : "Obligation 2",
    "obligationLevel" : "LICENSE_OBLIGATION",
    "obligationType" : "OBLIGATION"
  } ],
  "obligationDatabaseIds" : [ "0002", "0001" ],
  "text" : "placeholder for the Apache 2.0 license text",
  "checked" : true,
  "shortName" : "Apache 2.0",
  "fullName" : "Apache License 2.0",
  "_links" : {
    "self" : {
      "href" : "https://sw360.org/api/licenses/Apache-2.0"
    }
  },
  "_embedded" : {
    "sw360:obligations" : [ {
      "text" : "This is text of Obligation 1",
      "whitelist" : [ "Department" ],
      "title" : "Obligation 1",
      "obligationType" : "PERMISSION",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/obligations/0001"
        }
      }
    }, {
      "text" : "This is text of Obligation 2",
      "whitelist" : [ "Department2" ],
      "title" : "Obligation 2",
      "obligationType" : "OBLIGATION",
      "_links" : {
        "self" : {
          "href" : "https://sw360.org/api/obligations/0002"
        }
      }
    } ]
  }
}

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 Jan 10, 2024
@nikkuma7
Copy link
Contributor

Hi @tuannn2 ,
I have created the obligation licenses and linked with the licenses in license tab. As we can see in the below SS.
image

I have linked the obligation licenses with OBSD license.
image

Getting "No license details found in the database" Even i have the license with the same name in the database.
image

Please let me know if any configuration or changes required.

@tuannn2 tuannn2 closed this Jan 16, 2024
@tuannn2 tuannn2 reopened this Jan 16, 2024
@tuannn2
Copy link
Contributor Author

tuannn2 commented Jan 16, 2024

Hi @tuannn2 , I have created the obligation licenses and linked with the licenses in license tab. As we can see in the below SS. image

I have linked the obligation licenses with OBSD license. image

Getting "No license details found in the database" Even i have the license with the same name in the database. image

Please let me know if any configuration or changes required.

Hi @nikkuma7,
You can try it with this url: https://localhost:8080/api/licenses/0BSD/whitelist
Instead of
FeedbackTestWhitelist

@nikkuma7
Copy link
Contributor

getting error : status code (501) server does not support the functionality required to fulfill the request.
image

@tuannn2
Copy link
Contributor Author

tuannn2 commented Jan 16, 2024

getting error : status code (501) server does not support the functionality required to fulfill the request. image

Did you use OBSD or 0BSD?
Please copy theLicense Shortname of license.

@nikkuma7
Copy link
Contributor

Test successful.
image

@tuannn2 tuannn2 force-pushed the release/update_whitelist_obligation branch from 071e3be to 0e39dc1 Compare February 2, 2024 01:53
@tienlee tienlee removed the needs general test This is general testing, meaning that there is no org specific issue to check for label Feb 5, 2024
@tuannn2 tuannn2 force-pushed the release/update_whitelist_obligation branch from 0e39dc1 to ae14fdf Compare February 28, 2024 03:45
@ag4ums ag4ums assigned rudra-superrr and unassigned eldrin30 Apr 22, 2024
@@ -96,6 +96,20 @@ include::{snippets}/should_document_update_license/http-response.adoc[]
===== Links
include::{snippets}/should_document_update_license/links.adoc[]

[[resources-update-whitelist-license]]
==== Update whitelist a license
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change the heading to, Update whitelist for license's obligations for better understanding.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rudra-superrr Thanks for your comment. I have fixed it. Please help me to review the changes

Signed-off-by: hoangnt2 <hoang2.nguyenthai@toshiba.co.jp>
@hoangnt2 hoangnt2 force-pushed the release/update_whitelist_obligation branch from ae14fdf to ea94202 Compare May 2, 2024 06:44
@rudra-superrr
Copy link
Contributor

LGTM.

@rudra-superrr rudra-superrr added ready ready to merge and removed needs code review labels May 2, 2024
@ag4ums ag4ums merged commit 8fbcd83 into eclipse-sw360:main May 8, 2024
2 checks passed
@hoangnt2 hoangnt2 deleted the release/update_whitelist_obligation branch December 12, 2024 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New-UI Level for the API and UI level changes for the new-ui ready ready to merge REST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants