Documentation
¶
Index ¶
Constants ¶
const ( DefaultListen = ":8080" // DefaultRegion lives with the backend definition it applies to, so both // Store implementations resolve it identically. DefaultRegion = store.DefaultRegion )
Variables ¶
var Version = "v0.0.12"
Functions ¶
func NewConfigStore ¶
NewConfigStore builds a store.Store from a validated config.
Types ¶
type BackendConfig ¶
Password and BackendConfig are defined in the store package; the aliases keep the config schema in one place with the rest of the config types.
type BucketConfig ¶
type BucketConfig struct {
Name string `yaml:"name" json:"name"`
Backend *BackendConfig `yaml:"backend" json:"backend"`
Policy string `yaml:"policy,omitempty" json:"policy,omitempty"` // bucket policy JSON text
CORS []*cors.Rule `yaml:"cors,omitempty" json:"cors,omitempty"`
// CreatedAt is reported by ListBuckets (unset = the Unix epoch).
CreatedAt time.Time `yaml:"created_at,omitzero" json:"created_at,omitzero"`
}
type CLI ¶
type CLI struct {
Config string `help:"config file path" default:"s3rp.yaml" env:"S3RP_CONFIG"`
Listen string `help:"listen address (overrides config)" env:"S3RP_LISTEN"`
LogLevel string `help:"log level" default:"info" enum:"debug,info,warn,error" env:"S3RP_LOG_LEVEL"`
Version kong.VersionFlag `help:"show version"`
}
type Config ¶
type Config struct {
Listen string `yaml:"listen" json:"listen"`
// VirtualHostSuffix enables virtual-hosted-style addressing under this
// host name ("s3.example.com": bucket "photos" is photos.s3.example.com)
// alongside the path style; empty = path style only.
VirtualHostSuffix string `yaml:"virtual_host_suffix,omitempty" json:"virtual_host_suffix,omitempty"`
Tenants []*TenantConfig `yaml:"tenants,omitempty" json:"tenants,omitempty"`
}
func LoadConfig ¶
LoadConfig reads a YAML config file, expanding environment variables in the content.
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type Password ¶
Password and BackendConfig are defined in the store package; the aliases keep the config schema in one place with the rest of the config types.
type S3RP ¶
S3RP is the service assembled from a config: it decides where definitions come from and runs the HTTP server, while the S3 API itself is the Gateway.
func NewWithStore ¶
NewWithStore creates an S3RP using the given Store for tenant, key and bucket definitions.
type TenantConfig ¶
type TenantConfig struct {
Name string `yaml:"name" json:"name"`
Users []*UserConfig `yaml:"users" json:"users"`
Buckets []*BucketConfig `yaml:"buckets" json:"buckets"`
}
TenantConfig defines a tenant: its users and the buckets it owns.
type UserConfig ¶
type UserConfig struct {
Name string `yaml:"name" json:"name"`
Keys []*KeyConfig `yaml:"keys" json:"keys"`
Policy []policy.ActionStatement `yaml:"policy,omitempty" json:"policy,omitempty"`
}
UserConfig defines a user of a tenant. The user name is the stable identity (e.g. for policy principals); access keys rotate under it.
Directories
¶
| Path | Synopsis |
|---|---|
|
bench
|
|
|
bwlimit
command
Command bwlimit is s3rp with the bandwidth-limit hook installed, for benchmarking it.
|
Command bwlimit is s3rp with the bandwidth-limit hook installed, for benchmarking it. |
|
Package checksum implements the S3 x-amz-checksum-* algorithms and the headers that carry them.
|
Package checksum implements the S3 x-amz-checksum-* algorithms and the headers that carry them. |
|
cmd
|
|
|
s3rp
command
|
|
|
s3tests-harness
command
Command s3tests-harness serves an s3rp gateway augmented with CreateBucket/DeleteBucket for running the ceph/s3-tests compatibility suite.
|
Command s3tests-harness serves an s3rp gateway augmented with CreateBucket/DeleteBucket for running the ceph/s3-tests compatibility suite. |
|
Package cors evaluates S3-style CORS rules and writes the corresponding response headers.
|
Package cors evaluates S3-style CORS rules and writes the corresponding response headers. |
|
Package policy implements AWS-style bucket policy documents for s3rp.
|
Package policy implements AWS-style bucket policy documents for s3rp. |
|
Package s3err renders S3 API error responses and maps aws-sdk-go-v2 errors onto them, preserving the backend's error code and HTTP status.
|
Package s3err renders S3 API error responses and maps aws-sdk-go-v2 errors onto them, preserving the backend's error code and HTTP status. |
|
Package s3gw implements the S3 API of a multi-tenant gateway: signature verification, authorization, the operations themselves and the routing that reaches them.
|
Package s3gw implements the S3 API of a multi-tenant gateway: signature verification, authorization, the operations themselves and the routing that reaches them. |
|
s3tests
|
|
|
harness
Package harness assembles an s3rp gateway suitable for running the ceph/s3-tests compatibility suite against it.
|
Package harness assembles an s3rp gateway suitable for running the ceph/s3-tests compatibility suite against it. |
|
Package s3xml holds the XML request and response bodies of the S3 API and the helper to render them.
|
Package s3xml holds the XML request and response bodies of the S3 API and the helper to render them. |
|
Package sigv4 verifies inbound AWS SigV4 signatures on the server side: it re-signs a clone of the request with the client's secret and compares the signatures, and decodes the aws-chunked (STREAMING-*) request bodies whose per-chunk signatures chain from the request signature.
|
Package sigv4 verifies inbound AWS SigV4 signatures on the server side: it re-signs a clone of the request with the client's secret and compares the signatures, and decodes the aws-chunked (STREAMING-*) request bodies whose per-chunk signatures chain from the request signature. |
|
Package store defines the read-only contract for tenant, key and bucket definitions used by s3rp.
|
Package store defines the read-only contract for tenant, key and bucket definitions used by s3rp. |