Documentation ¶
Index ¶
- Constants
- func AuthorizeUnconfirmedIdentity(r *http.Request, obj string, referrers []string, roles []string) (bool, error)
- func CleanACL(name string, value string) (string, error)
- func CopyItems(dest, src http.Header)
- func CopyItemsExclude(dest, src http.Header, exclude []string)
- func NewAuthToken(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewBulk(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewCatchError(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewContext(debugResponses bool, mc ring.MemcacheRing, log srv.LowLevelLogger, ...) func(http.Handler) http.Handler
- func NewCopyMiddleware(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewCors(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewFormPost(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewHealthcheck(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewKeystoneAuth(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewMultirange(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewRatelimiter(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewRequestLogger(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewStaticWeb(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewTempAuth(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewTempURL(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewVersionedWrites(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func NewXlo(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
- func ParseACL(acl string) ([]string, []string)
- func PipedGet(path string, request *http.Request, source string, auth AuthorizeFunc) (io.ReadCloser, http.Header, int)
- func Recover(w http.ResponseWriter, r *http.Request, msg string, ...)
- func ReferrerAllowed(referrer string, referrerACL []string) bool
- func RegisterInfo(name string, data interface{})
- func RemoveItemsWithPrefix(header http.Header, prefix string)
- type AccountInfo
- type AuthorizeFunc
- type CopyWriter
- type PipeResponseWriter
- type ProxyContext
- type ProxyContextMiddleware
- type VersionedContainerWriter
- type VersionedObjectWriter
Constants ¶
const ( FP_INVALID = iota FP_ERROR FP_EXPIRED FP_SCOPE_ACCOUNT FP_SCOPE_CONTAINER )
const ( SCOPE_INVALID = iota SCOPE_ACCOUNT SCOPE_CONTAINER )
const ( DELETE_MARKER_CONTENT_TYPE = "application/x-deleted;swift_versions_deleted=1" CLIENT_VERSIONS_LOC = "X-Versions-Location" CLIENT_HISTORY_LOC = "X-History-Location" SYSMETA_VERSIONS_LOC = "X-Container-Sysmeta-Versions-Location" SYSMETA_VERSIONS_MODE = "X-Container-Sysmeta-Versions-Mode" )
Variables ¶
This section is empty.
Functions ¶
func CleanACL ¶
Returns a cleaned ACL header value, validating that it meets the formatting requirements for standard Hummingbird ACL strings.
func CopyItems ¶ added in v0.0.2
TODO: This seems like it might copy headers it shouldn't. Also, shouldn't it be called copyHeaders instead?
func CopyItemsExclude ¶ added in v0.0.2
func NewAuthToken ¶
func NewCatchError ¶
func NewContext ¶
func NewContext(debugResponses bool, mc ring.MemcacheRing, log srv.LowLevelLogger, proxyDirectClient *client.ProxyDirectClient) func(http.Handler) http.Handler
func NewCopyMiddleware ¶
func NewFormPost ¶
func NewHealthcheck ¶
func NewKeystoneAuth ¶
func NewMultirange ¶
func NewMultirange(config conf.Section, metricsScope tally.Scope) (func(http.Handler) http.Handler, error)
NewMultirange returns an instance of the multirange middleware with the given config.
This middleware intercepts object GET requests with multiple ranges in the Range header and turns them into separate single-range requests on the backend, combining them into a multipart response. This should simplify the implementation of things like xLO and the object server.
func NewRatelimiter ¶
func NewRequestLogger ¶
func NewStaticWeb ¶
func NewTempAuth ¶
func NewTempURL ¶
func NewVersionedWrites ¶ added in v0.0.2
func PipedGet ¶ added in v0.0.2
func PipedGet(path string, request *http.Request, source string, auth AuthorizeFunc) (io.ReadCloser, http.Header, int)
func ReferrerAllowed ¶
Returns True if the referrer should be allowed based on the referrerACL list
func RegisterInfo ¶
func RegisterInfo(name string, data interface{})
func RemoveItemsWithPrefix ¶
Types ¶
type AccountInfo ¶
type CopyWriter ¶
type CopyWriter struct { http.ResponseWriter Logger srv.LowLevelLogger // contains filtered or unexported fields }
func (*CopyWriter) WriteHeader ¶
func (cw *CopyWriter) WriteHeader(status int)
type PipeResponseWriter ¶
type PipeResponseWriter struct { Logger srv.LowLevelLogger // contains filtered or unexported fields }
func NewPipeResponseWriter ¶
func NewPipeResponseWriter(writer *io.PipeWriter, ready chan struct{}, logger srv.LowLevelLogger) *PipeResponseWriter
func (*PipeResponseWriter) Close ¶
func (w *PipeResponseWriter) Close()
func (*PipeResponseWriter) Header ¶
func (w *PipeResponseWriter) Header() http.Header
func (*PipeResponseWriter) WriteHeader ¶
func (w *PipeResponseWriter) WriteHeader(status int)
type ProxyContext ¶
type ProxyContext struct { *ProxyContextMiddleware C client.ProxyClient Authorize AuthorizeFunc RemoteUsers []string StorageOwner bool ACL string Logger *zap.Logger TxId string Source string // contains filtered or unexported fields }
func GetProxyContext ¶
func GetProxyContext(r *http.Request) *ProxyContext
func (*ProxyContext) AutoCreateAccount ¶
func (ctx *ProxyContext) AutoCreateAccount(account string, headers http.Header)
func (*ProxyContext) GetAccountInfo ¶
func (ctx *ProxyContext) GetAccountInfo(account string) (*AccountInfo, error)
func (*ProxyContext) InvalidateAccountInfo ¶
func (ctx *ProxyContext) InvalidateAccountInfo(account string)
type ProxyContextMiddleware ¶
type ProxyContextMiddleware struct { Cache ring.MemcacheRing // contains filtered or unexported fields }
func (*ProxyContextMiddleware) ServeHTTP ¶
func (m *ProxyContextMiddleware) ServeHTTP(writer http.ResponseWriter, request *http.Request)
type VersionedContainerWriter ¶ added in v0.0.2
type VersionedContainerWriter struct {
http.ResponseWriter
}
func (*VersionedContainerWriter) WriteHeader ¶ added in v0.0.2
func (vcw *VersionedContainerWriter) WriteHeader(status int)
type VersionedObjectWriter ¶ added in v0.0.2
type VersionedObjectWriter struct {
// contains filtered or unexported fields
}
func NewVersionedObjectWriter ¶ added in v0.0.2
func NewVersionedObjectWriter() *VersionedObjectWriter
func (*VersionedObjectWriter) Header ¶ added in v0.0.2
func (vow *VersionedObjectWriter) Header() http.Header
func (*VersionedObjectWriter) Write ¶ added in v0.0.2
func (vow *VersionedObjectWriter) Write(stuff []byte) (int, error)
func (*VersionedObjectWriter) WriteHeader ¶ added in v0.0.2
func (vow *VersionedObjectWriter) WriteHeader(status int)