25
25
using Bit . Core . Vault . Queries ;
26
26
using Bit . Core . Vault . Repositories ;
27
27
using Bit . Core . Vault . Services ;
28
+ using Bit . SharedWeb . Swagger ;
28
29
using Microsoft . AspNetCore . Authorization ;
29
30
using Microsoft . AspNetCore . Mvc ;
30
31
@@ -108,8 +109,9 @@ public async Task<CipherMiniResponseModel> GetAdmin(string id)
108
109
return new CipherMiniDetailsResponseModel ( cipher , _globalSettings , collectionCiphersGroupDict , cipher . OrganizationUseTotp ) ;
109
110
}
110
111
111
- [ HttpGet ( "{id}/full-details" ) ]
112
112
[ HttpGet ( "{id}/details" ) ]
113
+ [ HttpGet ( "{id}/full-details" ) ]
114
+ [ SwaggerExclude ( "GET" , "full-details" ) ]
113
115
public async Task < CipherDetailsResponseModel > GetDetails ( Guid id )
114
116
{
115
117
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -125,7 +127,7 @@ public async Task<CipherDetailsResponseModel> GetDetails(Guid id)
125
127
}
126
128
127
129
[ HttpGet ( "" ) ]
128
- public async Task < ListResponseModel < CipherDetailsResponseModel > > Get ( )
130
+ public async Task < ListResponseModel < CipherDetailsResponseModel > > GetAll ( )
129
131
{
130
132
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
131
133
var hasOrgs = _currentContext . Organizations . Count != 0 ;
@@ -233,6 +235,7 @@ public async Task<CipherMiniResponseModel> PostAdmin([FromBody] CipherCreateRequ
233
235
234
236
[ HttpPut ( "{id}" ) ]
235
237
[ HttpPost ( "{id}" ) ]
238
+ [ SwaggerExclude ( "POST" ) ]
236
239
public async Task < CipherResponseModel > Put ( Guid id , [ FromBody ] CipherRequestModel model )
237
240
{
238
241
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -275,6 +278,7 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
275
278
276
279
[ HttpPut ( "{id}/admin" ) ]
277
280
[ HttpPost ( "{id}/admin" ) ]
281
+ [ SwaggerExclude ( "POST" ) ]
278
282
public async Task < CipherMiniResponseModel > PutAdmin ( Guid id , [ FromBody ] CipherRequestModel model )
279
283
{
280
284
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -679,6 +683,7 @@ private async Task<bool> CanEditItemsInCollections(Guid organizationId, IEnumera
679
683
680
684
[ HttpPut ( "{id}/partial" ) ]
681
685
[ HttpPost ( "{id}/partial" ) ]
686
+ [ SwaggerExclude ( "POST" ) ]
682
687
public async Task < CipherResponseModel > PutPartial ( Guid id , [ FromBody ] CipherPartialRequestModel model )
683
688
{
684
689
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -696,6 +701,7 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
696
701
697
702
[ HttpPut ( "{id}/share" ) ]
698
703
[ HttpPost ( "{id}/share" ) ]
704
+ [ SwaggerExclude ( "POST" ) ]
699
705
public async Task < CipherResponseModel > PutShare ( Guid id , [ FromBody ] CipherShareRequestModel model )
700
706
{
701
707
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -733,6 +739,7 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
733
739
734
740
[ HttpPut ( "{id}/collections" ) ]
735
741
[ HttpPost ( "{id}/collections" ) ]
742
+ [ SwaggerExclude ( "POST" ) ]
736
743
public async Task < CipherDetailsResponseModel > PutCollections ( Guid id , [ FromBody ] CipherCollectionsRequestModel model )
737
744
{
738
745
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -759,6 +766,7 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
759
766
760
767
[ HttpPut ( "{id}/collections_v2" ) ]
761
768
[ HttpPost ( "{id}/collections_v2" ) ]
769
+ [ SwaggerExclude ( "POST" ) ]
762
770
public async Task < OptionalCipherDetailsResponseModel > PutCollections_vNext ( Guid id , [ FromBody ] CipherCollectionsRequestModel model )
763
771
{
764
772
var user = await _userService . GetUserByPrincipalAsync ( User ) ;
@@ -793,6 +801,7 @@ await _applicationCacheService.GetOrganizationAbilitiesAsync(),
793
801
794
802
[ HttpPut ( "{id}/collections-admin" ) ]
795
803
[ HttpPost ( "{id}/collections-admin" ) ]
804
+ [ SwaggerExclude ( "POST" ) ]
796
805
public async Task < CipherMiniDetailsResponseModel > PutCollectionsAdmin ( string id , [ FromBody ] CipherCollectionsRequestModel model )
797
806
{
798
807
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -842,6 +851,7 @@ public async Task PostBulkCollections([FromBody] CipherBulkUpdateCollectionsRequ
842
851
843
852
[ HttpDelete ( "{id}" ) ]
844
853
[ HttpPost ( "{id}/delete" ) ]
854
+ [ SwaggerExclude ( "POST" ) ]
845
855
public async Task Delete ( Guid id )
846
856
{
847
857
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -856,6 +866,7 @@ public async Task Delete(Guid id)
856
866
857
867
[ HttpDelete ( "{id}/admin" ) ]
858
868
[ HttpPost ( "{id}/delete-admin" ) ]
869
+ [ SwaggerExclude ( "POST" ) ]
859
870
public async Task DeleteAdmin ( Guid id )
860
871
{
861
872
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -871,6 +882,7 @@ public async Task DeleteAdmin(Guid id)
871
882
872
883
[ HttpDelete ( "" ) ]
873
884
[ HttpPost ( "delete" ) ]
885
+ [ SwaggerExclude ( "POST" ) ]
874
886
public async Task DeleteMany ( [ FromBody ] CipherBulkDeleteRequestModel model )
875
887
{
876
888
if ( ! _globalSettings . SelfHosted && model . Ids . Count ( ) > 500 )
@@ -885,6 +897,7 @@ public async Task DeleteMany([FromBody] CipherBulkDeleteRequestModel model)
885
897
886
898
[ HttpDelete ( "admin" ) ]
887
899
[ HttpPost ( "delete-admin" ) ]
900
+ [ SwaggerExclude ( "POST" ) ]
888
901
public async Task DeleteManyAdmin ( [ FromBody ] CipherBulkDeleteRequestModel model )
889
902
{
890
903
if ( ! _globalSettings . SelfHosted && model . Ids . Count ( ) > 500 )
@@ -1051,6 +1064,7 @@ public async Task<ListResponseModel<CipherMiniResponseModel>> PutRestoreManyAdmi
1051
1064
1052
1065
[ HttpPut ( "move" ) ]
1053
1066
[ HttpPost ( "move" ) ]
1067
+ [ SwaggerExclude ( "POST" ) ]
1054
1068
public async Task MoveMany ( [ FromBody ] CipherBulkMoveRequestModel model )
1055
1069
{
1056
1070
if ( ! _globalSettings . SelfHosted && model . Ids . Count ( ) > 500 )
@@ -1065,6 +1079,7 @@ public async Task MoveMany([FromBody] CipherBulkMoveRequestModel model)
1065
1079
1066
1080
[ HttpPut ( "share" ) ]
1067
1081
[ HttpPost ( "share" ) ]
1082
+ [ SwaggerExclude ( "POST" ) ]
1068
1083
public async Task < ListResponseModel < CipherMiniResponseModel > > PutShareMany ( [ FromBody ] CipherBulkShareRequestModel model )
1069
1084
{
1070
1085
var organizationId = new Guid ( model . Ciphers . First ( ) . OrganizationId ) ;
@@ -1230,7 +1245,7 @@ await Request.GetFileAsync(async (stream) =>
1230
1245
[ Obsolete ( "Deprecated Attachments API" , false ) ]
1231
1246
[ RequestSizeLimit ( Constants . FileSize101mb ) ]
1232
1247
[ DisableFormValueModelBinding ]
1233
- public async Task < CipherResponseModel > PostAttachment ( Guid id )
1248
+ public async Task < CipherResponseModel > PostAttachmentV1 ( Guid id )
1234
1249
{
1235
1250
ValidateAttachment ( ) ;
1236
1251
@@ -1325,6 +1340,7 @@ await _cipherService.CreateAttachmentShareAsync(cipher, stream, fileName, key,
1325
1340
1326
1341
[ HttpDelete ( "{id}/attachment/{attachmentId}" ) ]
1327
1342
[ HttpPost ( "{id}/attachment/{attachmentId}/delete" ) ]
1343
+ [ SwaggerExclude ( "POST" ) ]
1328
1344
public async Task < DeleteAttachmentResponseData > DeleteAttachment ( Guid id , string attachmentId )
1329
1345
{
1330
1346
var userId = _userService . GetProperUserId ( User ) . Value ;
@@ -1339,6 +1355,7 @@ public async Task<DeleteAttachmentResponseData> DeleteAttachment(Guid id, string
1339
1355
1340
1356
[ HttpDelete ( "{id}/attachment/{attachmentId}/admin" ) ]
1341
1357
[ HttpPost ( "{id}/attachment/{attachmentId}/delete-admin" ) ]
1358
+ [ SwaggerExclude ( "POST" ) ]
1342
1359
public async Task < DeleteAttachmentResponseData > DeleteAttachmentAdmin ( Guid id , string attachmentId )
1343
1360
{
1344
1361
var userId = _userService . GetProperUserId ( User ) . Value ;
0 commit comments