2016-09-09 23:36:35 +08:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Nextcloud - passman
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later. See the COPYING file.
|
|
|
|
*
|
|
|
|
* @author Sander Brand <brantje@gmail.com>
|
|
|
|
* @copyright Sander Brand 2016
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create your routes in here. The name is the lowercase name of the controller
|
|
|
|
* without the controller part, the stuff after the hash is the method.
|
|
|
|
* e.g. page#index -> OCA\Passman\Controller\PageController->index()
|
|
|
|
*
|
|
|
|
* The controller class has to be registered in the application.php file since
|
|
|
|
* it's instantiated in there
|
|
|
|
*/
|
|
|
|
return [
|
|
|
|
'routes' => [
|
|
|
|
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
|
2016-10-01 23:21:24 +08:00
|
|
|
['name' => 'page#bookmarklet', 'url' => '/bookmarklet', 'verb' => 'GET'],
|
2016-10-02 01:26:58 +08:00
|
|
|
['name' => 'page#publicSharePage', 'url' => '/share/public', 'verb' => 'GET'],
|
2016-09-09 23:36:35 +08:00
|
|
|
|
|
|
|
//Vault
|
2016-09-12 01:45:20 +08:00
|
|
|
['name' => 'vault#listVaults', 'url' => '/api/v2/vaults', 'verb' => 'GET'],
|
|
|
|
['name' => 'vault#create', 'url' => '/api/v2/vaults', 'verb' => 'POST'],
|
|
|
|
['name' => 'vault#get', 'url' => '/api/v2/vaults/{vault_id}', 'verb' => 'GET'],
|
|
|
|
['name' => 'vault#update', 'url' => '/api/v2/vaults/{vault_id}', 'verb' => 'PATCH'],
|
|
|
|
['name' => 'vault#delete', 'url' => '/api/v2/vaults/{vault_id}', 'verb' => 'DELETE'],
|
2016-09-27 02:12:14 +08:00
|
|
|
//@TODO make frontend use PATCH
|
2016-09-26 00:34:33 +08:00
|
|
|
['name' => 'vault#updateSharingKeys', 'url' => '/api/v2/vaults/{vault_id}/sharing-keys', 'verb' => 'POST'],
|
2016-09-09 23:36:35 +08:00
|
|
|
|
|
|
|
//Credential
|
2016-09-12 01:45:20 +08:00
|
|
|
['name' => 'credential#createCredential', 'url' => '/api/v2/credentials', 'verb' => 'POST'],
|
|
|
|
['name' => 'credential#getCredential', 'url' => '/api/v2/credentials/{credential_id}', 'verb' => 'GET'],
|
|
|
|
['name' => 'credential#updateCredential', 'url' => '/api/v2/credentials/{credential_id}', 'verb' => 'PATCH'],
|
|
|
|
['name' => 'credential#deleteCredential', 'url' => '/api/v2/credentials/{credential_id}', 'verb' => 'DELETE'],
|
2016-09-09 23:36:35 +08:00
|
|
|
|
|
|
|
//Revisions
|
2016-10-06 00:47:25 +08:00
|
|
|
['name' => 'credential#getRevision', 'url' => '/api/v2/credentials/{credential_guid}/revision', 'verb' => 'GET'],
|
2016-09-12 01:45:20 +08:00
|
|
|
['name' => 'credential#deleteRevision', 'url' => '/api/v2/credentials/{credential_id}/revision/{revision_id}', 'verb' => 'DELETE'],
|
2016-10-05 20:30:28 +08:00
|
|
|
['name' => 'credential#updateRevision', 'url' => '/api/v2/credentials/{credential_id}/revision/{revision_id}', 'verb' => 'PATCH'],
|
2016-09-09 23:36:35 +08:00
|
|
|
|
|
|
|
//File stuff
|
2016-09-15 00:57:38 +08:00
|
|
|
['name' => 'file#uploadFile', 'url' => '/api/v2/file', 'verb' => 'POST'],
|
2016-09-16 03:21:34 +08:00
|
|
|
['name' => 'file#getFile', 'url' => '/api/v2/file/{file_id}', 'verb' => 'GET'],
|
2016-09-15 00:57:38 +08:00
|
|
|
['name' => 'file#deleteFile', 'url' => '/api/v2/file/{file_id}', 'verb' => 'DELETE'],
|
2016-10-05 20:09:15 +08:00
|
|
|
['name' => 'file#updateFile', 'url' => '/api/v2/file/{file_id}', 'verb' => 'PATCH'],
|
2016-09-09 23:36:35 +08:00
|
|
|
|
2016-09-23 18:03:37 +08:00
|
|
|
//Sharing stuff
|
|
|
|
['name' => 'share#search', 'url' => '/api/v2/sharing/search', 'verb' => 'POST'],
|
2016-09-27 02:36:51 +08:00
|
|
|
['name' => 'share#getVaultsByUser', 'url' => '/api/v2/sharing/vaults/{user_id}', 'verb' => 'GET'],
|
2016-10-02 07:56:36 +08:00
|
|
|
['name' => 'share#applyIntermediateShare', 'url' => '/api/v2/sharing/share', 'verb' => 'POST'],
|
2016-10-02 20:02:38 +08:00
|
|
|
['name' => 'share#savePendingRequest', 'url' => '/api/v2/sharing/save', 'verb' => 'POST'],
|
2016-10-02 20:26:22 +08:00
|
|
|
['name' => 'share#getPendingRequests', 'url' => '/api/v2/sharing/pending', 'verb' => 'GET'],
|
2016-10-02 23:19:12 +08:00
|
|
|
['name' => 'share#deleteShareRequest', 'url' => '/api/v2/sharing/decline/{share_request_id}', 'verb' => 'DELETE'],
|
2016-10-03 01:07:03 +08:00
|
|
|
['name' => 'share#getVaultItems', 'url' => '/api/v2/sharing/vault/{vault_guid}/get', 'verb' => 'GET'],
|
2016-10-04 04:57:32 +08:00
|
|
|
['name' => 'share#createPublicShare', 'url' => '/api/v2/sharing/public', 'verb' => 'POST'],
|
2016-10-04 20:29:06 +08:00
|
|
|
['name' => 'share#getPublicCredentialData', 'url' => '/api/v2/sharing/credential/{credential_guid}/public', 'verb' => 'GET'],
|
|
|
|
['name' => 'share#unshareCredential', 'url' => '/api/v2/sharing/credential/{item_guid}', 'verb' => 'DELETE'],
|
|
|
|
['name' => 'share#getRevisions', 'url' => '/api/v2/sharing/credential/{item_guid}/revisions', 'verb' => 'GET'],
|
2016-10-04 20:40:48 +08:00
|
|
|
['name' => 'share#getItemAcl', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'GET'],
|
2016-10-05 22:58:19 +08:00
|
|
|
['name' => 'share#getFile', 'url' => '/api/v2/sharing/credential/{item_guid}/file/{file_guid}', 'verb' => 'GET'],
|
2016-10-04 22:20:55 +08:00
|
|
|
['name' => 'share#updateSharedCredentialACL', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'PATCH'],
|
2016-09-24 00:17:47 +08:00
|
|
|
|
|
|
|
//Internal API
|
|
|
|
['name' => 'internal#remind', 'url' => '/api/internal/notifications/remind/{credential_id}', 'verb' => 'POST'],
|
|
|
|
['name' => 'internal#read', 'url' => '/api/internal/notifications/read/{credential_id}', 'verb' => 'DELETE'],
|
2016-09-25 02:47:47 +08:00
|
|
|
['name' => 'internal#getAppVersion', 'url' => '/api/internal/version', 'verb' => 'GET'],
|
2016-09-26 06:27:02 +08:00
|
|
|
['name' => 'internal#generatePerson', 'url' => '/api/internal/generate_person', 'verb' => 'GET'],
|
2016-09-24 00:17:47 +08:00
|
|
|
|
2016-09-09 23:36:35 +08:00
|
|
|
]
|
|
|
|
];
|