strongbox: Npm - Return 404 error if repository not found
Task Description
Npm command for example, npm install @angular/core would return return a 406 error if a wrong endpoint is provided in the .npmrc file i.e. registry=http://localhost:48080/storages/storage-npm/. Correct endpoint would be registry=http://localhost:48080/storages/storage-npm/npmjs, correct endpoint would have the repo i.e. npmjs. However, we would like the error to be 404 - repository not found if repo is not there or a wrong one is provided.
init.author.name=Strongbox user
init.author.email=strongbox@localhost.com
email=strongbox@localhost.com
always-auth=true
registry=http://localhost:48080/storages/storage-npm/npmjs
_auth=
; `_auth` is base64 encoded authentication token
; you can use it instead of `username` and `_password`
Tasks
- Make sure
npm install @angular/corereturns404 - repo not founderror when wrong repo is provided int the endpoint. - Provide tests that expects
404for/storages/{storageId}and/storages - Provide documentation of how
@LayoutRequestMappingworks under the hood
Screenshots

Help
- Our chat
- Points of contact:
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 26 (21 by maintainers)
we need to fix the
LayoutRequestCondition.getStorageAndRepositoryConditioncurrently it expects to have/storages/{storageId}/{repositoryId}and the issue we have here is that URL contains only/storages/{storageId}we should improve theLayoutRequestCondition.getStorageAndRepositoryConditionmethod to returnRepositoryNotFoundRequestConditioneven if there was no{repositoryId}in URL and it should also returnStorageNotFoundRequestConditionif there was no{storageId}The problem is that we do not identify
layoutforstorage@pyashwanthkumar @PuneetBabbar I was working on this, but I am having a hard time making any progress. You can take it if you want.
It is an issue with requests being routed to the wrong controller and I can’t figure out why. NPM download requests with an invalid end point are being routed to the Maven download controller.