Skip to content

Commit

Permalink
New Crowdin updates (#224)
Browse files Browse the repository at this point in the history
* 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
BeyondRobot authored Sep 6, 2021
1 parent 187d220 commit 5ea8fdc
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"message": "Pager",
"description": "The label for category Pager in sidebar docs"
},
"sidebar.docs.category.StorageHTTPSigner": {
"message": "StorageHTTPSigner",
"description": "The label for category StorageHTTPSigner in sidebar docs"
},
"sidebar.docs.category.Pairs": {
"message": "Pairs",
"description": "The label for category Pairs in sidebar docs"
Expand Down
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)
// ...
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
label: 'StorageHTTPSigner'
collapsed: true
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.
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.
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.

1 comment on commit 5ea8fdc

@vercel
Copy link

@vercel vercel bot commented on 5ea8fdc Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.