* feat: Implemet the vault-storage feat: Separate the storage-users and graph to handle feat: move the space create cache configurate the vault srorage Postprocessing hide the assignment of the MountID to VaultStorageProviderID behind a flag to avoid the ID mismatch configurate the proxy to create the vault home space update the filter Make the graph able to handle vault prefix. no extra service needed apply the vault filter to sharedbyme and sharedwithme added vault-storage docker use squashed reva fix the finishUpload event restict webdav copy/move from the vault feat: provide the mfa to webdav and grpc feat: refactoring: provide the mfa to webdav and grpc mfa collaboration fix GetRootDriveChildren and more fix: send the MFA header in HTTP clients from the collaboration service provide the default storage user vault configuration update create_home middleware Update deployments/examples/ocis_full/vault-storage.yml Co-authored-by: Martin <github@diemattels.at> Update services/gateway/pkg/config/config.go Co-authored-by: Martin <github@diemattels.at> Update services/graph/pkg/config/config.go Co-authored-by: Martin <github@diemattels.at> Update services/graph/pkg/config/config.go Co-authored-by: Martin <github@diemattels.at> Update services/storage-users/pkg/config/config.go Co-authored-by: Martin <github@diemattels.at> Update services/proxy/pkg/config/config.go Co-authored-by: Martin <github@diemattels.at> Update services/storage-users/pkg/config/config.go Co-authored-by: Martin <github@diemattels.at> Update deployments/examples/ocis_full/vault-storage.yml Co-authored-by: Martin <github@diemattels.at> bump reva deduplicate the requireMFA middeware on vault routes. fix AppendPlainToOpaque. added the changlog and comments * feat: add the vault mode search * Update changelog/unreleased/enhancement-vault-storage.md Co-authored-by: Martin <github@diemattels.at> * update the readme. the reva vault storage provider configuration disabled by default * feat: [OCISDEV-531] add vault capabilities to the OCS capabilities endpoint * the port range allocated. the configuration updated. --------- Co-authored-by: Martin <github@diemattels.at>
31 lines
801 B
Go
31 lines
801 B
Go
package middleware
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
type key int
|
|
|
|
const vaultModeKey key = iota
|
|
|
|
// SetVaultMode sets the vault mode in the context.
|
|
func SetVaultMode(ctx context.Context, enabled bool) context.Context {
|
|
return context.WithValue(ctx, vaultModeKey, enabled)
|
|
}
|
|
|
|
// IsVaultMode checks if the vault mode is enabled in the context.
|
|
func IsVaultMode(ctx context.Context) bool {
|
|
val, ok := ctx.Value(vaultModeKey).(bool)
|
|
return val && ok
|
|
}
|
|
|
|
// VaultModeMiddleware is a middleware that sets the vault mode in the context.
|
|
func VaultModeMiddleware() func(next http.Handler) http.Handler {
|
|
return func(next http.Handler) http.Handler {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
next.ServeHTTP(w, r.WithContext(SetVaultMode(r.Context(), true)))
|
|
})
|
|
}
|
|
}
|