Skip to content

Commit 01a3d9a

Browse files
committed
add docs to revoke share access
1 parent 94f5b71 commit 01a3d9a

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed

code/go/0chain.net/blobbercore/handler/handler.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,54 @@ func CleanupDiskHandler(ctx context.Context, r *http.Request) (interface{}, erro
789789
return "cleanup", err
790790
}
791791

792+
// swagger:route DELETE /v1/marketplace/shareinfo/{allocation} revokeshare
793+
// revokeshare is the handler to respond to share file requests from clients
794+
//
795+
// parameters:
796+
// +name: allocation
797+
// description: TxHash of the allocation in question.
798+
// in: path
799+
// required: true
800+
// type: string
801+
// +name: X-App-Client-ID
802+
// description: The ID/Wallet address of the client sending the request.
803+
// in: header
804+
// type: string
805+
// required: true
806+
// +name: X-App-Client-Key
807+
// description: The key of the client sending the request.
808+
// in: header
809+
// type: string
810+
// required: true
811+
// +name: ALLOCATION-ID
812+
// description: The ID of the allocation in question.
813+
// in: header
814+
// type: string
815+
// required: true
816+
// +name: X-App-Client-Signature
817+
// description: Digital signature of the client used to verify the request.
818+
// in: header
819+
// type: string
820+
// required: true
821+
// +name: X-App-Client-Signature-V2
822+
// description: Digital signature of the client used to verify the request. Overrides X-App-Client-Signature if provided.
823+
// in: header
824+
// type: string
825+
// +name: path
826+
// description: Path of the file to be shared.
827+
// in: query
828+
// type: string
829+
// required: true
830+
// +name: refereeClientID
831+
// description: The ID of the client to revoke access to the file (in case of private sharing).
832+
// in: query
833+
// type: string
834+
//
835+
// responses:
836+
//
837+
// 200:
838+
// 400:
839+
792840
func RevokeShare(ctx context.Context, r *http.Request) (interface{}, error) {
793841

794842
ctx = setupHandlerContext(ctx, r)

swagger.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Documentation of the blobber API.
4141
| GET | /v1/file/objecttree/{allocation} | [referencepath](#referencepath) | |
4242
| GET | /v1/file/refs/{allocation} | [refshandler](#refshandler) | |
4343
| GET | /v1/file/rename/{allocation} | [renameallocation](#renameallocation) | |
44+
| DELETE | /v1/marketplace/shareinfo/{allocation} | [revokeshare](#revokeshare) | |
4445
| POST | /v1/marketplace/shareinfo/{allocation} | [shareinfo](#shareinfo) | |
4546

4647

@@ -613,6 +614,46 @@ Status: Internal Server Error
613614

614615
###### <span id="renameallocation-500-schema"></span> Schema
615616

617+
### <span id="revokeshare"></span> revokeshare (*revokeshare*)
618+
619+
```
620+
DELETE /v1/marketplace/shareinfo/{allocation}
621+
```
622+
623+
revokeshare is the handler to respond to share file requests from clients
624+
625+
#### Parameters
626+
627+
| Name | Source | Type | Go type | Separator | Required | Default | Description |
628+
|------|--------|------|---------|-----------| :------: |---------|-------------|
629+
| allocation | `path` | string | `string` | || | TxHash of the allocation in question. |
630+
| ALLOCATION-ID | `header` | string | `string` | || | The ID of the allocation in question. |
631+
| X-App-Client-ID | `header` | string | `string` | || | The ID/Wallet address of the client sending the request. |
632+
| X-App-Client-Key | `header` | string | `string` | || | The key of the client sending the request. |
633+
| X-App-Client-Signature | `header` | string | `string` | || | Digital signature of the client used to verify the request. |
634+
| X-App-Client-Signature-V2 | `header` | string | `string` | | | | Digital signature of the client used to verify the request. Overrides X-App-Client-Signature if provided. |
635+
| path | `query` | string | `string` | || | Path of the file to be shared. |
636+
| refereeClientID | `query` | string | `string` | | | | The ID of the client to revoke access to the file (in case of private sharing). |
637+
638+
#### All responses
639+
| Code | Status | Description | Has headers | Schema |
640+
|------|--------|-------------|:-----------:|--------|
641+
| [200](#revokeshare-200) | OK | | | [schema](#revokeshare-200-schema) |
642+
| [400](#revokeshare-400) | Bad Request | | | [schema](#revokeshare-400-schema) |
643+
644+
#### Responses
645+
646+
647+
##### <span id="revokeshare-200"></span> 200
648+
Status: OK
649+
650+
###### <span id="revokeshare-200-schema"></span> Schema
651+
652+
##### <span id="revokeshare-400"></span> 400
653+
Status: Bad Request
654+
655+
###### <span id="revokeshare-400-schema"></span> Schema
656+
616657
### <span id="shareinfo"></span> shareinfo (*shareinfo*)
617658

618659
```

swagger.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,53 @@ paths:
847847
"500":
848848
description: ""
849849
/v1/marketplace/shareinfo/{allocation}:
850+
delete:
851+
description: revokeshare is the handler to respond to share file requests from clients
852+
operationId: revokeshare
853+
parameters:
854+
- description: TxHash of the allocation in question.
855+
in: path
856+
name: allocation
857+
required: true
858+
type: string
859+
- description: The ID/Wallet address of the client sending the request.
860+
in: header
861+
name: X-App-Client-ID
862+
required: true
863+
type: string
864+
- description: The key of the client sending the request.
865+
in: header
866+
name: X-App-Client-Key
867+
required: true
868+
type: string
869+
- description: The ID of the allocation in question.
870+
in: header
871+
name: ALLOCATION-ID
872+
required: true
873+
type: string
874+
- description: Digital signature of the client used to verify the request.
875+
in: header
876+
name: X-App-Client-Signature
877+
required: true
878+
type: string
879+
- description: Digital signature of the client used to verify the request. Overrides X-App-Client-Signature if provided.
880+
in: header
881+
name: X-App-Client-Signature-V2
882+
type: string
883+
- description: Path of the file to be shared.
884+
in: query
885+
name: path
886+
required: true
887+
type: string
888+
- description: The ID of the client to revoke access to the file (in case of private sharing).
889+
in: query
890+
name: refereeClientID
891+
type: string
892+
responses:
893+
"200":
894+
description: ""
895+
"400":
896+
description: ""
850897
post:
851898
description: shareinfo is the handler to respond to share file requests from clients
852899
operationId: shareinfo

0 commit comments

Comments
 (0)