adobe / spacecat-api-service

Edge Delivery services experience success as a service automation: SpaceCat + Star Catalogue
Apache License 2.0
3 stars 1 forks source link

feat: opt-out updateExcludedURLs #354

Closed AndreiAlexandruParaschiv closed 2 weeks ago

AndreiAlexandruParaschiv commented 2 weeks ago

https://jira.corp.adobe.com/browse/SITES-22463

PATH {endpoint}/{siteId}/{auditType} where auditType is broken-backlinks

Body

{
  "excludedURLs": [
    "https://www.neacaisaslr.com",
    "https://www.marinica.com",
    "https://www.tudorica.com",
    "https://www.misulica.com"
   ]
}

Response:

{
    "disabled": true,
    "excludedURLs": [
       "https://www.neacaisaslr.com",
       "https://www.marinica.com",
       "https://www.tudorica.com",
       "https://www.misulica.com""
    ]
}

To remove the excludedURLs, send an empty array in the body

Disclaimer: tested it (a lot) on dev for siteId 7be95fa1-e532-410c-b6f8-6584ca92ac09

github-actions[bot] commented 2 weeks ago

This PR will trigger a minor release when merged.

iuliag commented 2 weeks ago
'404':
        $ref: './responses.yaml#/404-audit-not-found'

The implementation does not seem to return any 404.

AndreiAlexandruParaschiv commented 2 weeks ago

👍🏻 Do you validate anywhere that the strings passed in the excludedURLs array are valid URL format? If not, you should.

Added isValidUrl function to validate the URLs and also added checks to return 404 for siteId and auditType

solaris007 commented 2 weeks ago

:tada: This PR is included in version 1.45.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: