-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New translations query_sign_http_read.md (Chinese Simplified) * New translations current.json (Chinese Simplified) * New translations migrate-reach-to-querysignhttpread.md (Chinese Simplified) * New translations _category_.yml (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations query_sign_http_write.md (Chinese Simplified)
- Loading branch information
1 parent
187d220
commit 5ea8fdc
Showing
6 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...-content-docs-go-storage/current/internal/migrate-reach-to-querysignhttpread.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: Migrate Reach to QuerySignHTTPRead | ||
--- | ||
|
||
## 介绍 | ||
|
||
### Reach | ||
|
||
[Reacher](../operations/reach.md) is used to get a public accessible url to object. | ||
|
||
### QuerySignHTTPRead | ||
|
||
[StorageHTTPSigner](../operations/storage_http_signer/index.md) is used to generate HTTP requests with signature information for storage service. [QuerySignHTTPRead](../operations/storage_http_signer/query_sign_http_read.md) will read data from the file by using query parameters to authenticate requests. | ||
|
||
For `*http.Request` returned by `QuerySignHttpRead`, where the `URL` field specifies either the URI being requested (for server requests) or the URL to access (for client requests) with signature in the query string. And `Header` field specifies HTTP headers converted from the optional pairs, which includes headers contained in the signature. | ||
|
||
Headers included in signature must be included in any HTTP request made with the signed URL. `QuerySignHttpRead` extends the functionality of `Reach`. And `Reacher` will be deprecated. | ||
|
||
## How to migrate Reach to QuerySignHTTPRead | ||
|
||
From [go-storage](https://github.com/beyondstorage/go-storage) side: | ||
|
||
- `StoragHTTPSigner` interface has been introduced and implemented. | ||
- `Reacher` interface and operation have been marked as deprecated and will be removed in the last major version. | ||
|
||
From service side: | ||
|
||
- `StorageHttpSigner` should be implemented if supported. | ||
- `Reacher` implementation should be removed before it's removed from [go-storage](https://github.com/beyondstorage/go-storage). | ||
|
||
From user side: | ||
|
||
`Reacher` interface and `Reach` operation are no longer available in the near future. To reach the object or resource, upgrade the dependency library `go-service-*` is needed, use `StorageHttpSigner` interface and `QuerySignHttpRead` operation instead. 例如: | ||
|
||
Before | ||
```go | ||
// ... | ||
url, err := store.Reach("abc", types.WithExpire(time.Hour)) | ||
// handle err and url | ||
``` | ||
|
||
After | ||
```go | ||
// ... | ||
req, err := store.QuerySignHttpRead("abc", time.Hour, opt) | ||
// handle err | ||
// get the accessible url to object | ||
url := req.URL.String() | ||
// or send request directly | ||
client := &http.Client{} | ||
resp, err := client.Do(req) | ||
// ... | ||
``` |
3 changes: 3 additions & 0 deletions
3
...urus-plugin-content-docs-go-storage/current/operations/storage_http_signer/_category_.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
label: 'StorageHTTPSigner' | ||
collapsed: true |
16 changes: 16 additions & 0 deletions
16
...-plugin-content-docs-go-storage/current/operations/storage_http_signer/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: 介绍 | ||
sidebar_position: 1 | ||
--- | ||
|
||
`StorageHTTPSigner` is used to generate HTTP requests with signature information for storage service. | ||
|
||
## Basic Operations | ||
|
||
### QuerySignHTTPRead | ||
|
||
[QuerySignHTTPRead](./query_sign_http_read.md) will read data from the file by using query parameters to authenticate requests. | ||
|
||
### QuerySignHTTPWrite | ||
|
||
[QuerySignHTTPWrite](./query_sign_http_write.md) will write data into a file by using query parameters to authenticate requests. |
1 change: 1 addition & 0 deletions
1
...-docs-go-storage/current/operations/storage_http_signer/query_sign_http_read.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`QuerySignHTTPRead` is used to read data from the file by using query parameters to authenticate requests. |
1 change: 1 addition & 0 deletions
1
...docs-go-storage/current/operations/storage_http_signer/query_sign_http_write.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
`QuerySignHTTPWrite` is used to write data into a file by using query parameters to authenticate requests. |
5ea8fdc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: