chi-s3-vhs/README.md

58 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

# Dynamic S3 address-style routing prototype
Prototype of dynamic routing for path-style and virtual-hosted-style requests
implemented with go-chi framework.
## Build
```
$ make
```
## Run
### Default setting.
VHS is disabled. VHS can be overridden by HTTP Header.
```
$ ./bin/chi-s3-vhs
$ curl bucketA.localhost:44412/bucketB/obj
bucket:[bucketB] object:[obj]
$ curl -H "X-FrostFS-VHS: enabled" bucketA.localhost:44412/bucketB/obj
bucket:[bucketA] object:[bucketB/obj]
```
### Global VHS
VHS can be overridden by HTTP Header
```
$ ./bin/chi-s3-vhs --global
$ curl bucketA.localhost:44412/bucketB/obj
bucket:[bucketA] object:[bucketB/obj]
$ curl -H "X-FrostFS-VHS: disabled" bucketA.localhost:44412/bucketB/obj
bucket:[bucketB] object:[obj]
```
### Namespace override
Namespace setting may override default value, but not header value
```
$ ./chi-s3-vhs --global --ns foo=disabled
$ curl bucketA.localhost:44412/bucketB/obj
bucket:[bucketA] object:[bucketB/obj]
$ curl -H "X-FrostFS-Namespace: foo" bucketA.localhost:44412/bucketB/obj
bucket:[bucketB] object:[obj]
$ curl -H "X-FrostFS-Namespace: foo" -H "X-FrostFS-VHS: enabled" bucketA.localhost:44412/bucketB/obj
bucket:[bucketA] object:[bucketB/obj]
```