Documentation
¶
Index ¶
- type AdminOpt
- func WithAdminCORSAllowOrigin(origin string) AdminOpt
- func WithAdminConcurrencyLimiter(maxConnections, maxRequests int) AdminOpt
- func WithAdminDebug() AdminOpt
- func WithAdminQuiet() AdminOpt
- func WithAdminRootUser(root middlewares.RootUserConfig) AdminOpt
- func WithAdminSocketPerm(perm os.FileMode) AdminOpt
- func WithAdminSrvTLS(cs *utils.CertStorage) AdminOpt
- type Option
- func WithAdminServer() Option
- func WithCORSAllowOrigin(origin string) Option
- func WithCompleteMultipartKeepalive(interval time.Duration) Option
- func WithConcurrencyLimiter(maxConnections, maxRequests int) Option
- func WithDisableACL() Option
- func WithDisableObjNameTraversalCheck() Option
- func WithHealth(health string) Option
- func WithHostStyle(virtualDomain string) Option
- func WithKeepAlive() Option
- func WithMiddleware(prefix string, handler fiber.Handler) Option
- func WithMpMaxParts(n int) Option
- func WithOnListen(fn func()) Option
- func WithQuiet() Option
- func WithReadOnly() Option
- func WithRootUser(root middlewares.RootUserConfig) Option
- func WithRoute(method, path string, handlers ...fiber.Handler) Option
- func WithSocketPerm(perm os.FileMode) Option
- func WithTLS(cs *utils.CertStorage) Option
- func WithWebUI(prefix string, cfg *webui.ServerConfig) Option
- type S3AdminRouter
- type S3AdminServer
- type S3ApiRouter
- type S3ApiServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminOpt ¶
type AdminOpt func(s *S3AdminServer)
func WithAdminCORSAllowOrigin ¶
WithAdminCORSAllowOrigin sets the default CORS Access-Control-Allow-Origin value for the standalone admin server.
func WithAdminConcurrencyLimiter ¶
WithAdminConcurrencyLimiter sets the admin standalone server's maximum connection limit and the hard limit for in-flight requests.
func WithAdminRootUser ¶
func WithAdminRootUser(root middlewares.RootUserConfig) AdminOpt
WithAdminRootUser enables the built-in root account on the admin server (see WithRootUser).
func WithAdminSocketPerm ¶
WithAdminSocketPerm sets the file-mode permissions applied to file-backed UNIX domain sockets after binding. It has no effect on TCP/IP or abstract namespace sockets.
func WithAdminSrvTLS ¶
func WithAdminSrvTLS(cs *utils.CertStorage) AdminOpt
type Option ¶
type Option func(*S3ApiServer)
Option sets various options for New()
func WithAdminServer ¶
func WithAdminServer() Option
WithAdminServer runs admin endpoints with the gateway in the same network
func WithCORSAllowOrigin ¶
WithCORSAllowOrigin sets the default CORS Access-Control-Allow-Origin value. This is applied when no bucket CORS configuration exists, and for admin APIs.
func WithCompleteMultipartKeepalive ¶
WithCompleteMultipartKeepalive keeps a slow CompleteMultipartUpload's connection alive, as S3 does: the response commits to 200 OK and sends a newline every interval until the result, or an <Error> document in its place, ends the body. It commits when the backend reports the response headers (backend.CompleteMultipartUploadReporter), with x-amz-version-id and x-amz-server-side-encryption, or for any other backend once the completion has run for interval, without them. A completion that finishes before the commit is answered as usual. Either way, the completion keeps its slot under the request limit until it finishes. Zero or negative leaves the keepalive off.
func WithConcurrencyLimiter ¶
WithConcurrencyLimiter sets the server's maximum connection limit and the hard limit for in-flight requests.
func WithDisableACL ¶
func WithDisableACL() Option
WithDisableACL disables the s3 api server ACLs, by ignoring all bucket/object ACL headers
func WithDisableObjNameTraversalCheck ¶
func WithDisableObjNameTraversalCheck() Option
WithDisableObjNameTraversalCheck disables the path-traversal rejection in object-name validation. Backends that store keys opaquely (not as filesystem paths) set this so keys like "../file.txt" are accepted and stored literally, matching AWS. The empty/"."/".."/"/" and control-character rejections stay on.
func WithHostStyle ¶
WithHostStyle enabled host-style bucket addressing on the server
func WithMiddleware ¶
WithMiddleware mounts a Fiber middleware after the gateway rate limiter and before the S3 route table is registered. The middleware must call ctx.Next() for requests it does not fully handle.
func WithMpMaxParts ¶
WithMpMaxParts sets the maximum number of parts allowed in a multipart upload.
func WithOnListen ¶
func WithOnListen(fn func()) Option
WithOnListen registers a callback that is invoked once the server is bound and ready to accept requests. It is called from the fiber OnListen hook, which fires immediately before the server begins serving the first connection. Use this instead of a fixed sleep to detect readiness reliably.
func WithReadOnly ¶
func WithReadOnly() Option
func WithRootUser ¶
func WithRootUser(root middlewares.RootUserConfig) Option
WithRootUser enables the built-in root account: an access key the auth middlewares resolve ahead of the IAM service, with the admin role and every ACL / policy check skipped. A config missing either credential is ignored. Without a root account the gateway resolves every access key through iam (see middlewares.RootUserConfig for the ownership consequences).
func WithRoute ¶
WithRoute registers a top-level Fiber route after the gateway rate limiter and before S3 routes are registered. Handlers are terminal unless they explicitly call ctx.Next().
func WithSocketPerm ¶
WithSocketPerm sets the file-mode permissions applied to file-backed UNIX domain sockets after binding. It has no effect on TCP/IP or abstract namespace sockets.
type S3AdminRouter ¶
type S3AdminRouter struct {
// contains filtered or unexported fields
}
func (*S3AdminRouter) Init ¶
func (ar *S3AdminRouter) Init(app *fiber.App, be backend.Backend, iam auth.IAMService, logger s3log.AuditLogger, root middlewares.RootUserConfig, region string, debug bool, corsAllowOrigin string)
type S3AdminServer ¶
type S3AdminServer struct {
CertStorage *utils.CertStorage
// contains filtered or unexported fields
}
func NewAdminServer ¶
func NewAdminServer(be backend.Backend, region string, iam auth.IAMService, l s3log.AuditLogger, ctrl controllers.S3ApiController, opts ...AdminOpt) *S3AdminServer
NewAdminServer constructs the admin API server. The root account is disabled unless WithAdminRootUser is passed.
func (*S3AdminServer) ServeMultiPort ¶
func (sa *S3AdminServer) ServeMultiPort(ports []string) error
ServeMultiPort creates listeners for multiple port specifications and serves on all of them simultaneously. This supports listening on multiple ports and/or addresses (e.g., [":8080", "localhost:8081"]).
func (S3AdminServer) Shutdown ¶
func (sa S3AdminServer) Shutdown() error
ShutDown gracefully shuts down the server with a context timeout
type S3ApiRouter ¶
type S3ApiRouter struct {
WithAdmSrv bool
Ctrl controllers.S3ApiController
// contains filtered or unexported fields
}
func (*S3ApiRouter) Init ¶
func (sa *S3ApiRouter) Init()
type S3ApiServer ¶
type S3ApiServer struct {
Router *S3ApiRouter
CertStorage *utils.CertStorage
// contains filtered or unexported fields
}
func New ¶
func New( be backend.Backend, region string, iam auth.IAMService, l s3log.AuditLogger, adminLogger s3log.AuditLogger, evs s3event.S3EventSender, mm metrics.Manager, opts ...Option, ) (*S3ApiServer, error)
New constructs the S3 API server. The gateway runs without a root account unless WithRootUser is passed: every non-empty access key then resolves through iam, and an empty access key is rejected before any lookup.
func (*S3ApiServer) ServeMultiPort ¶
func (sa *S3ApiServer) ServeMultiPort(ports []string) error
ServeMultiPort creates listeners for multiple port specifications and serves on all of them simultaneously. This supports listening on multiple ports and/or addresses (e.g., [":7070", "localhost:8080", "0.0.0.0:9090"]).
func (*S3ApiServer) ShutDown ¶
func (sa *S3ApiServer) ShutDown() error
ShutDown gracefully shuts down the server with a context timeout
Directories
¶
| Path | Synopsis |
|---|---|
|
code modified from golang std library src/internal/filepathlite/path.go to support path separator '/' for all platforms.
|
code modified from golang std library src/internal/filepathlite/path.go to support path separator '/' for all platforms. |