Problem/Motivation
There is a 403 error when the Asset versioning feature is disabled. It works properly when the Asset versioning feature is enabled at WIDEN DAM
Steps to reproduce
- Disable Asset versioning feature
- Try browse media asset at content type
Expectation
The expected result is that user would be able to access the asset even the the Acquia DAM Asset Versioning feature disabled.
Issue fork acquia_dam-3462318
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
chandu7929 commentedComment #5
rajeshreeputraComment #6
baluertlBy briefly running through the suggested changes, I foresee the potential of a code conflict. The self-explanatorily incorrect assumption of the inline comment
has been overridden once already in #3424689: Look for the "finalized" asset version not the latest modified.
Not counting this one, there are already 5–6 other open tickets already in Needs Review status. Most of them means a significant amount of code change. To avoid double-work I would suggest let's focus on getting them merged first, then get return here with a fresher
1.1.xbranch.Therefore I dare to mark this as Postponed for now but feel free to switch back if you feel it's urgent to work on.
Comment #7
baluertlNow MR tested, I confirm that it solves the 403 error.
I also agree with renaming our DAM client's
getAssetVersionList()method to a more genericgetAssetDetails()which will better describe its functioning.Still I suggest to let's wait until #3424689: Look for the "finalized" asset version not the latest modified lands, then it will be easier to integrate these changes.
Note to ourselves: once starting to work on this issue just make sure that both occurrences of error message “Cannot get asset version list from API” in different classes are aligned with these changes.
Comment #8
baluertlSome thoughts on the Widen API v1/v2 usage
The Client\AcquiaDamClient::getAssetVersionList() in the current 1.0.x dev HEAD calls Widen API like this:
$response = $this->get("https://$domain/api/rest/asset/uuid/$id/assetversions");(see API docs)Which is provided by the v1 API. This MR suggests replacing this method with a different one, which would call v2 API:
$response = $this->get("/v2/assets/$id");(see API docs)Generally, I agree with that as it leans towards modernisation. However, now I checked our source code and at some point, we already rely on v2 API endpoints, for example
AcquiadamAuthService::sendAuthRequest()(source).This mixed usage of Widen API causes some heavy feelings for me. I think we could – after some discussion – put some work into searching through the entire codebase and checking all external HTTP calls (heads up, not only the Client class!) to ensure that the next stable release of this module will rely on exclusively on Widen API v2.
Comment #9
baluertlTests are failing on D9, setting back to NW.
Comment #10
baluertlReady for review.
Comment #13
japerryComment #16
baluertlComment #17
baluertl