stable

Clone or download

Read-only

Handle authorization of basic transfer upload actions

The object is still not saved but an authorization is attached to each actions returned by the batch request API. Someone without the proper authorization trying to upload an object will get a rejection. To test you first need to request the upload of an object to the batch request API and then try to upload it to the given URL with the given authorization header. Since the plugin is only accessible in dev environnement and did not contain any persistant data until now, a migration script for the database change has not been created, please reinstall the plugin or create the table manually. This is part of story #12322: have git-lfs batch and basic transfer API Change-Id: Ic9ba63202db1305b3c7aea0d223e81e25b7ce216

Modified Files

Name
A plugins/gitlfs/db/install.sql +10 −0 Go to diff View file
A plugins/gitlfs/db/uninstall.sql +1 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationDAO.php +61 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationException.php +25 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationMatchingUnknownRepositoryException.php +29 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationNotFoundException.php +29 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationRemover.php +39 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationRequest.php +88 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationTokenCreator.php +63 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationTokenHeaderSerializer.php +56 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/ActionAuthorizationVerifier.php +82 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/AuthorizedAction.php +68 −0 Go to diff View file
A plugins/gitlfs/include/Authorization/Action/InvalidActionAuthorizationException.php +29 −0 Go to diff View file
M plugins/gitlfs/include/Batch/LFSBatchController.php +2 −0 Go to diff View file
M plugins/gitlfs/include/Batch/Response/Action/BatchResponseActionContent.php +18 −3 Go to diff View file
M plugins/gitlfs/include/Batch/Response/BatchSuccessfulResponseBuilder.php +42 −4 Go to diff View file
M plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferUploadController.php +72 −0 Go to diff View file
M plugins/gitlfs/include/gitlfsPlugin.class.php +19 −1 Go to diff View file
A plugins/gitlfs/phpunit/Authorization/Action/ActionAuthorizationTokenCreatorTest.php +58 −0 Go to diff View file
A plugins/gitlfs/phpunit/Authorization/Action/ActionAuthorizationTokenHeaderSerializerTest.php +55 −0 Go to diff View file
A plugins/gitlfs/phpunit/Authorization/Action/ActionAuthorizationVerifierTest.php +203 −0 Go to diff View file
M plugins/gitlfs/phpunit/Batch/Response/Action/BatchResponseActionContentTest.php +8 −0 Go to diff View file
M plugins/gitlfs/phpunit/Batch/Response/BatchSuccessfulResponseBuilderTest.php +18 −4 Go to diff View file