Commit Graph

124 Commits

Author SHA1 Message Date
Miguel González Aravena 9fba79d154 Fix eslint errors 2018-01-08 09:07:30 -03:00
Miguel González Aravena 4a7bf1daa9 Merge branch 'master' of github.com:MiguelGonzalezAravena/loopback-component-storage 2018-01-06 22:53:10 -03:00
Timo Wolf f467d964a7 add AWS S3 options for server side encryption
Now, the AWS S3 options for server side encryptions are passed to the
upload handler. Thus, the client can specify the AWS options and use
AWS Server Side Encryption.
2018-01-06 22:47:23 -03:00
Raymond Feng 8b663ddf9c Declare container parameter for swagger spec
Without this change, generated Swagger spec for the upload operation
does not have `container` parameter even it's a variable on the path.
As a result, the sepc fails validations.

An optional `container` is added to the remote method. Conditional
check is added to ensure backward compatibility.
2018-01-06 22:47:18 -03:00
Miroslav Bajtoš 4ea51fcd8c Mark HTTP path parameters as required
Per Swagger spec 2.0, parameters coming from the path must be marked
as required.

Before this change, the Swagger spec produced by loopback-swagger
was not valid because path parameters were optional.

Note that this commit does not fix the problem of the "uploaded"
method which does not have any swagger-supported parameters now,
and therefore the swagger spec will remain invalid (but with less
errors).
2018-01-06 22:46:26 -03:00
Miguel González Aravena 88a261e86d Create containers with slash 2018-01-06 22:45:58 -03:00
Miguel González Aravena e9a7c7e42f Fix eslint error 2018-01-06 22:45:21 -03:00
Miguel González Aravena 0c48e20d88 Fix test error 2018-01-06 22:44:57 -03:00
Miguel González Aravena 9ebfdcbdc2 Verify if dataSources.json exist 2018-01-06 22:44:09 -03:00
Miguel González Aravena 9597144422 Verify Container's name is a string 2018-01-06 22:43:43 -03:00
Raymond Feng 990649b607 Update deps 2018-01-06 22:42:59 -03:00
Jose De Gouveia ff200bf328 added file field name into getFilename function 2018-01-06 22:38:34 -03:00
Jeff Burn 64c723e123 Fix #185: Validation failures crash server
Fixes issue where upload and download methods in FileSystemProvider
cause crashes in downstream methods by not returning streams in error
scenarios

- Add streamError, readStreamError, writeStreamError helper function
- Wrap all returns from upload / download methods in streams
- Fix incorrect format string
- Add new unit tests
2018-01-06 22:30:39 -03:00
Oscar Bernal e55595b99e added maxFieldsSize override to formidable limit 2018-01-06 22:30:35 -03:00
Raymond Feng 7df8f45489 Fix eslint 2018-01-06 22:28:42 -03:00
ole3021 ecf44e0c68 fix scope error 2018-01-06 22:28:42 -03:00
Cristobal Vergara edd5651e0e Added support for external providers as npm modules. 2018-01-06 22:28:42 -03:00
Miguel González Aravena e6e49cf954 Merge branch 'master' of github.com:strongloop/loopback-component-storage 2018-01-06 21:59:52 -03:00
Timo Wolf e1109e39dd add AWS S3 options for server side encryption
Now, the AWS S3 options for server side encryptions are passed to the
upload handler. Thus, the client can specify the AWS options and use
AWS Server Side Encryption.
2017-10-09 09:51:20 +02:00
Raymond Feng 47d555798c Declare container parameter for swagger spec
Without this change, generated Swagger spec for the upload operation
does not have `container` parameter even it's a variable on the path.
As a result, the sepc fails validations.

An optional `container` is added to the remote method. Conditional
check is added to ensure backward compatibility.
2017-08-30 13:45:19 -07:00
Miroslav Bajtoš 7cf4d883ef
Mark HTTP path parameters as required
Per Swagger spec 2.0, parameters coming from the path must be marked
as required.

Before this change, the Swagger spec produced by loopback-swagger
was not valid because path parameters were optional.

Note that this commit does not fix the problem of the "uploaded"
method which does not have any swagger-supported parameters now,
and therefore the swagger spec will remain invalid (but with less
errors).
2017-08-30 15:09:02 +02:00
Miguel González Aravena 6b1f9ffc8d Arreglar petición de archivo 2017-08-20 01:28:04 -03:00
Miguel González Aravena c0b546aa95 Arreglar error de test 2017-08-20 01:27:17 -03:00
Miguel González Aravena 4005a8fc2e Verificar que nombre de Contenedor es un string 2017-08-20 01:25:13 -03:00
Miguel González Aravena 38b1b2fae6 Arreglar errores de eslint 2017-08-20 01:21:42 -03:00
Miguel González Aravena 44ed536578 Arreglar error de test 2017-08-20 01:20:51 -03:00
Miguel González Aravena 7bd662151a Verificar si existe dataSources.json 2017-08-20 01:19:26 -03:00
Miguel González Aravena 8f7fdfa20c Verificar que nombre de Contenedor es un string 2017-08-20 01:18:37 -03:00
Miguel González Aravena d981e28ca1 Crear contenedores y subir archivos con '/' 2017-08-20 01:15:40 -03:00
Miguel González Aravena 955b1153f7 Arreglar errores de eslint 2017-08-20 01:13:29 -03:00
Miguel González Aravena 9cefe77ade Arreglar error de test 2017-08-20 01:12:13 -03:00
Miguel González Aravena 22ddb136b1 Verificar si existe dataSources.json 2017-08-20 01:10:21 -03:00
Miguel González Aravena 46e681dd47 Verificar que nombre de Contenedor es un string 2017-08-20 01:09:25 -03:00
Raymond Feng 636692a8a5 Update deps 2017-03-09 08:22:03 -08:00
Raymond Feng 2cea6a0c8d Merge branch 'master' of https://github.com/hgouveia/loopback-component-storage into hgouveia-master
# Conflicts:
#	lib/storage-handler.js
#	test/upload-download.test.js
2017-03-01 15:32:11 -08:00
Raymond Feng 0f521a1c2d Merge pull request #186 from jeffora/fix-error-handling
Fix #185: Validation failures crash server
2017-03-01 15:20:33 -08:00
Raymond Feng 4ef64a8d50 Merge branch 'max-fields-size-override' of https://github.com/obernal/loopback-component-storage into obernal-max-fields-size-override
# Conflicts:
#	lib/storage-service.js
2017-03-01 15:19:52 -08:00
Raymond Feng 656fba9d51 Fix eslint 2017-03-01 15:18:26 -08:00
Raymond Feng aab81590ed Merge pull request #182 from ole3021/fix/range-undefined-err
fix scope error
2017-03-01 15:11:28 -08:00
Raymond Feng b6e06dbceb Merge pull request #122 from vergara/fix-user
Added support for external providers as npm modules.
2017-03-01 15:07:28 -08:00
Raymond Feng 4d4e530955 Merge pull request #188 from cfjedimaster/master
look for a nameConflict option and use a uuid if value is makeUnique
2017-03-01 15:04:30 -08:00
Loay c6978261c7 Fix path joining/expanding 2017-02-10 16:26:30 -05:00
Raymond Camden ec959d2c38 fix lint 2017-02-02 09:19:28 -06:00
Raymond Camden 907f83ac3a Support nameConflict and makeUnique options 2017-02-01 13:16:53 -06:00
Jeff Burn 99fdb64d1e Fix #185: Validation failures crash server
Fixes issue where upload and download methods in FileSystemProvider
cause crashes in downstream methods by not returning streams in error
scenarios

- Add streamError, readStreamError, writeStreamError helper function
- Wrap all returns from upload / download methods in streams
- Fix incorrect format string
- Add new unit tests
2016-12-21 09:27:40 +11:00
ole3021 32bf1a90d8 fix scope error 2016-12-07 16:19:11 +08:00
Miroslav Bajtoš 6cb5a294c5 Continue middleware chain after download error
Stop sending constructing the error response directly inside the
storage component and send the error back to the application to handle
it.

As a result:

 - `File.afterRemoteError` hook is trigered now

 - App-provided error handling strategy is used to build error
   responses, e.g. using the production mode of strong-error-handler
   to hide sensitive information.
2016-11-10 15:58:39 -05:00
Miroslav Bajtoš 9997041093 Clean up "download()" implementation
Reduce nesting, remove repetition.
2016-11-10 14:20:38 +01:00
Loay f944fa2fd7 Return error when no file is uploaded 2016-11-09 16:01:36 -05:00
Loay 0931e9da83 Upgrade loopback to 3.0.0 2016-10-24 11:36:46 -04:00