chi-s3-vhs/README.md
Alex Vanin bedb008081 Initial commit
Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2024-07-10 14:15:59 +03:00

57 lines
1.2 KiB
Markdown

# 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]
```