@@ -108,7 +108,6 @@ public async Task<CipherMiniResponseModel> GetAdmin(string id)
108
108
return new CipherMiniDetailsResponseModel ( cipher , _globalSettings , collectionCiphersGroupDict , cipher . OrganizationUseTotp ) ;
109
109
}
110
110
111
- [ HttpGet ( "{id}/full-details" ) ]
112
111
[ HttpGet ( "{id}/details" ) ]
113
112
public async Task < CipherDetailsResponseModel > GetDetails ( Guid id )
114
113
{
@@ -124,8 +123,15 @@ public async Task<CipherDetailsResponseModel> GetDetails(Guid id)
124
123
return new CipherDetailsResponseModel ( cipher , user , organizationAbilities , _globalSettings , collectionCiphers ) ;
125
124
}
126
125
126
+ [ HttpGet ( "{id}/full-details" ) ]
127
+ [ Obsolete ( "This endpoint is deprecated. Use GET details method instead." ) ]
128
+ public async Task < CipherDetailsResponseModel > GetFullDetails ( Guid id )
129
+ {
130
+ return await GetDetails ( id ) ;
131
+ }
132
+
127
133
[ HttpGet ( "" ) ]
128
- public async Task < ListResponseModel < CipherDetailsResponseModel > > Get ( )
134
+ public async Task < ListResponseModel < CipherDetailsResponseModel > > GetAll ( )
129
135
{
130
136
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
131
137
var hasOrgs = _currentContext . Organizations . Count != 0 ;
@@ -232,7 +238,6 @@ public async Task<CipherMiniResponseModel> PostAdmin([FromBody] CipherCreateRequ
232
238
}
233
239
234
240
[ HttpPut ( "{id}" ) ]
235
- [ HttpPost ( "{id}" ) ]
236
241
public async Task < CipherResponseModel > Put ( Guid id , [ FromBody ] CipherRequestModel model )
237
242
{
238
243
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -273,8 +278,14 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
273
278
return response ;
274
279
}
275
280
281
+ [ HttpPost ( "{id}" ) ]
282
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
283
+ public async Task < CipherResponseModel > PostPut ( Guid id , [ FromBody ] CipherRequestModel model )
284
+ {
285
+ return await Put ( id , model ) ;
286
+ }
287
+
276
288
[ HttpPut ( "{id}/admin" ) ]
277
- [ HttpPost ( "{id}/admin" ) ]
278
289
public async Task < CipherMiniResponseModel > PutAdmin ( Guid id , [ FromBody ] CipherRequestModel model )
279
290
{
280
291
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -307,6 +318,13 @@ public async Task<CipherMiniResponseModel> PutAdmin(Guid id, [FromBody] CipherRe
307
318
return response ;
308
319
}
309
320
321
+ [ HttpPost ( "{id}/admin" ) ]
322
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
323
+ public async Task < CipherMiniResponseModel > PostPutAdmin ( Guid id , [ FromBody ] CipherRequestModel model )
324
+ {
325
+ return await PutAdmin ( id , model ) ;
326
+ }
327
+
310
328
[ HttpGet ( "organization-details" ) ]
311
329
public async Task < ListResponseModel < CipherMiniDetailsResponseModel > > GetOrganizationCiphers ( Guid organizationId )
312
330
{
@@ -678,7 +696,6 @@ private async Task<bool> CanEditItemsInCollections(Guid organizationId, IEnumera
678
696
}
679
697
680
698
[ HttpPut ( "{id}/partial" ) ]
681
- [ HttpPost ( "{id}/partial" ) ]
682
699
public async Task < CipherResponseModel > PutPartial ( Guid id , [ FromBody ] CipherPartialRequestModel model )
683
700
{
684
701
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -694,8 +711,14 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
694
711
return response ;
695
712
}
696
713
714
+ [ HttpPost ( "{id}/partial" ) ]
715
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
716
+ public async Task < CipherResponseModel > PostPutPartial ( Guid id , [ FromBody ] CipherPartialRequestModel model )
717
+ {
718
+ return await PutPartial ( id , model ) ;
719
+ }
720
+
697
721
[ HttpPut ( "{id}/share" ) ]
698
- [ HttpPost ( "{id}/share" ) ]
699
722
public async Task < CipherResponseModel > PutShare ( Guid id , [ FromBody ] CipherShareRequestModel model )
700
723
{
701
724
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -731,8 +754,14 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
731
754
return response ;
732
755
}
733
756
757
+ [ HttpPost ( "{id}/share" ) ]
758
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
759
+ public async Task < CipherResponseModel > PostPutShare ( Guid id , [ FromBody ] CipherShareRequestModel model )
760
+ {
761
+ return await PutShare ( id , model ) ;
762
+ }
763
+
734
764
[ HttpPut ( "{id}/collections" ) ]
735
- [ HttpPost ( "{id}/collections" ) ]
736
765
public async Task < CipherDetailsResponseModel > PutCollections ( Guid id , [ FromBody ] CipherCollectionsRequestModel model )
737
766
{
738
767
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -757,8 +786,14 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
757
786
collectionCiphers ) ;
758
787
}
759
788
789
+ [ HttpPost ( "{id}/collections" ) ]
790
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
791
+ public async Task < CipherDetailsResponseModel > PostPutCollections ( Guid id , [ FromBody ] CipherCollectionsRequestModel model )
792
+ {
793
+ return await PutCollections ( id , model ) ;
794
+ }
795
+
760
796
[ HttpPut ( "{id}/collections_v2" ) ]
761
- [ HttpPost ( "{id}/collections_v2" ) ]
762
797
public async Task < OptionalCipherDetailsResponseModel > PutCollections_vNext ( Guid id , [ FromBody ] CipherCollectionsRequestModel model )
763
798
{
764
799
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -791,8 +826,14 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
791
826
return response ;
792
827
}
793
828
829
+ [ HttpPost ( "{id}/collections_v2" ) ]
830
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
831
+ public async Task < OptionalCipherDetailsResponseModel > PostPutCollections_vNext ( Guid id , [ FromBody ] CipherCollectionsRequestModel model )
832
+ {
833
+ return await PutCollections_vNext ( id , model ) ;
834
+ }
835
+
794
836
[ HttpPut ( "{id}/collections-admin" ) ]
795
- [ HttpPost ( "{id}/collections-admin" ) ]
796
837
public async Task < CipherMiniDetailsResponseModel > PutCollectionsAdmin ( string id , [ FromBody ] CipherCollectionsRequestModel model )
797
838
{
798
839
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -821,6 +862,13 @@ public async Task<CipherMiniDetailsResponseModel> PutCollectionsAdmin(string id,
821
862
return new CipherMiniDetailsResponseModel ( cipher , _globalSettings , collectionCiphersGroupDict , cipher . OrganizationUseTotp ) ;
822
863
}
823
864
865
+ [ HttpPost ( "{id}/collections-admin" ) ]
866
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
867
+ public async Task < CipherMiniDetailsResponseModel > PostPutCollectionsAdmin ( string id , [ FromBody ] CipherCollectionsRequestModel model )
868
+ {
869
+ return await PutCollectionsAdmin ( id , model ) ;
870
+ }
871
+
824
872
[ HttpPost ( "bulk-collections" ) ]
825
873
public async Task PostBulkCollections ( [ FromBody ] CipherBulkUpdateCollectionsRequestModel model )
826
874
{
@@ -841,7 +889,6 @@ public async Task PostBulkCollections([FromBody] CipherBulkUpdateCollectionsRequ
841
889
}
842
890
843
891
[ HttpDelete ( "{id}" ) ]
844
- [ HttpPost ( "{id}/delete" ) ]
845
892
public async Task Delete ( Guid id )
846
893
{
847
894
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -854,8 +901,14 @@ public async Task Delete(Guid id)
854
901
await _cipherService . DeleteAsync ( cipher , userId ) ;
855
902
}
856
903
904
+ [ HttpPost ( "{id}/delete" ) ]
905
+ [ Obsolete ( "This endpoint is deprecated. Use DELETE method instead." ) ]
906
+ public async Task PostDelete ( Guid id )
907
+ {
908
+ await Delete ( id ) ;
909
+ }
910
+
857
911
[ HttpDelete ( "{id}/admin" ) ]
858
- [ HttpPost ( "{id}/delete-admin" ) ]
859
912
public async Task DeleteAdmin ( Guid id )
860
913
{
861
914
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -869,8 +922,14 @@ public async Task DeleteAdmin(Guid id)
869
922
await _cipherService . DeleteAsync ( cipher , userId , true ) ;
870
923
}
871
924
925
+ [ HttpPost ( "{id}/delete-admin" ) ]
926
+ [ Obsolete ( "This endpoint is deprecated. Use DELETE method instead." ) ]
927
+ public async Task PostDeleteAdmin ( Guid id )
928
+ {
929
+ await DeleteAdmin ( id ) ;
930
+ }
931
+
872
932
[ HttpDelete ( "" ) ]
873
- [ HttpPost ( "delete" ) ]
874
933
public async Task DeleteMany ( [ FromBody ] CipherBulkDeleteRequestModel model )
875
934
{
876
935
if ( ! _globalSettings . SelfHosted && model . Ids . Count ( ) > 500 )
@@ -883,8 +942,14 @@ public async Task DeleteMany([FromBody] CipherBulkDeleteRequestModel model)
883
942
await _cipherService . DeleteManyAsync ( model . Ids . Select ( i => new Guid ( i ) ) , userId ) ;
884
943
}
885
944
945
+ [ HttpPost ( "delete" ) ]
946
+ [ Obsolete ( "This endpoint is deprecated. Use DELETE method instead." ) ]
947
+ public async Task PostDeleteMany ( [ FromBody ] CipherBulkDeleteRequestModel model )
948
+ {
949
+ await DeleteMany ( model ) ;
950
+ }
951
+
886
952
[ HttpDelete ( "admin" ) ]
887
- [ HttpPost ( "delete-admin" ) ]
888
953
public async Task DeleteManyAdmin ( [ FromBody ] CipherBulkDeleteRequestModel model )
889
954
{
890
955
if ( ! _globalSettings . SelfHosted && model . Ids . Count ( ) > 500 )
@@ -910,6 +975,13 @@ public async Task DeleteManyAdmin([FromBody] CipherBulkDeleteRequestModel model)
910
975
await _cipherService . DeleteManyAsync ( cipherIds , userId , new Guid ( model . OrganizationId ) , true ) ;
911
976
}
912
977
978
+ [ HttpPost ( "delete-admin" ) ]
979
+ [ Obsolete ( "This endpoint is deprecated. Use DELETE method instead." ) ]
980
+ public async Task PostDeleteManyAdmin ( [ FromBody ] CipherBulkDeleteRequestModel model )
981
+ {
982
+ await DeleteManyAdmin ( model ) ;
983
+ }
984
+
913
985
[ HttpPut ( "{id}/delete" ) ]
914
986
public async Task PutDelete ( Guid id )
915
987
{
@@ -1050,7 +1122,6 @@ public async Task<ListResponseModel<CipherMiniResponseModel>> PutRestoreManyAdmi
1050
1122
}
1051
1123
1052
1124
[ HttpPut ( "move" ) ]
1053
- [ HttpPost ( "move" ) ]
1054
1125
public async Task MoveMany ( [ FromBody ] CipherBulkMoveRequestModel model )
1055
1126
{
1056
1127
if ( ! _globalSettings . SelfHosted && model . Ids . Count ( ) > 500 )
@@ -1063,8 +1134,14 @@ public async Task MoveMany([FromBody] CipherBulkMoveRequestModel model)
1063
1134
string . IsNullOrWhiteSpace ( model . FolderId ) ? ( Guid ? ) null : new Guid ( model . FolderId ) , userId ) ;
1064
1135
}
1065
1136
1137
+ [ HttpPost ( "move" ) ]
1138
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
1139
+ public async Task PostMoveMany ( [ FromBody ] CipherBulkMoveRequestModel model )
1140
+ {
1141
+ await MoveMany ( model ) ;
1142
+ }
1143
+
1066
1144
[ HttpPut ( "share" ) ]
1067
- [ HttpPost ( "share" ) ]
1068
1145
public async Task < ListResponseModel < CipherMiniResponseModel > > PutShareMany ( [ FromBody ] CipherBulkShareRequestModel model )
1069
1146
{
1070
1147
var organizationId = new Guid ( model . Ciphers . First ( ) . OrganizationId ) ;
@@ -1112,6 +1189,13 @@ public async Task<ListResponseModel<CipherMiniResponseModel>> PutShareMany([From
1112
1189
return new ListResponseModel < CipherMiniResponseModel > ( response ) ;
1113
1190
}
1114
1191
1192
+ [ HttpPost ( "share" ) ]
1193
+ [ Obsolete ( "This endpoint is deprecated. Use PUT method instead." ) ]
1194
+ public async Task < ListResponseModel < CipherMiniResponseModel > > PostPutShareMany ( [ FromBody ] CipherBulkShareRequestModel model )
1195
+ {
1196
+ return await PutShareMany ( model ) ;
1197
+ }
1198
+
1115
1199
[ HttpPost ( "purge" ) ]
1116
1200
public async Task PostPurge ( [ FromBody ] SecretVerificationRequestModel model , Guid ? organizationId = null )
1117
1201
{
@@ -1230,7 +1314,7 @@ await Request.GetFileAsync(async (stream) =>
1230
1314
[ Obsolete ( "Deprecated Attachments API" , false ) ]
1231
1315
[ RequestSizeLimit ( Constants . FileSize101mb ) ]
1232
1316
[ DisableFormValueModelBinding ]
1233
- public async Task < CipherResponseModel > PostAttachment ( Guid id )
1317
+ public async Task < CipherResponseModel > PostAttachmentV1 ( Guid id )
1234
1318
{
1235
1319
ValidateAttachment ( ) ;
1236
1320
@@ -1324,7 +1408,6 @@ await _cipherService.CreateAttachmentShareAsync(cipher, stream, fileName, key,
1324
1408
}
1325
1409
1326
1410
[ HttpDelete ( "{id}/attachment/{attachmentId}" ) ]
1327
- [ HttpPost ( "{id}/attachment/{attachmentId}/delete" ) ]
1328
1411
public async Task < DeleteAttachmentResponseData > DeleteAttachment ( Guid id , string attachmentId )
1329
1412
{
1330
1413
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -1337,8 +1420,14 @@ public async Task<DeleteAttachmentResponseData> DeleteAttachment(Guid id, string
1337
1420
return await _cipherService . DeleteAttachmentAsync ( cipher , attachmentId , userId , false ) ;
1338
1421
}
1339
1422
1423
+ [ HttpPost ( "{id}/attachment/{attachmentId}/delete" ) ]
1424
+ [ Obsolete ( "This endpoint is deprecated. Use DELETE method instead." ) ]
1425
+ public async Task < DeleteAttachmentResponseData > PostDeleteAttachment ( Guid id , string attachmentId )
1426
+ {
1427
+ return await DeleteAttachment ( id , attachmentId ) ;
1428
+ }
1429
+
1340
1430
[ HttpDelete ( "{id}/attachment/{attachmentId}/admin" ) ]
1341
- [ HttpPost ( "{id}/attachment/{attachmentId}/delete-admin" ) ]
1342
1431
public async Task < DeleteAttachmentResponseData > DeleteAttachmentAdmin ( Guid id , string attachmentId )
1343
1432
{
1344
1433
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -1352,6 +1441,13 @@ public async Task<DeleteAttachmentResponseData> DeleteAttachmentAdmin(Guid id, s
1352
1441
return await _cipherService . DeleteAttachmentAsync ( cipher , attachmentId , userId , true ) ;
1353
1442
}
1354
1443
1444
+ [ HttpPost ( "{id}/attachment/{attachmentId}/delete-admin" ) ]
1445
+ [ Obsolete ( "This endpoint is deprecated. Use DELETE method instead." ) ]
1446
+ public async Task < DeleteAttachmentResponseData > PostDeleteAttachmentAdmin ( Guid id , string attachmentId )
1447
+ {
1448
+ return await DeleteAttachmentAdmin ( id , attachmentId ) ;
1449
+ }
1450
+
1355
1451
[ AllowAnonymous ]
1356
1452
[ HttpPost ( "attachment/validate/azure" ) ]
1357
1453
public async Task < ObjectResult > AzureValidateFile ( )
0 commit comments