middleware

package
v3.0.0-...-3373b9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2024 License: GPL-3.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CallbackFailedStatusCode = http.StatusUnauthorized
)
View Source
const (
	WopiSessionCtx = "wopi_session"
)

Variables

View Source
var ContextMock = make(map[string]interface{})

ContextMock 测试时模拟Context

View Source
var SessionMock = make(map[string]interface{})

SessionMock 测试时模拟Session

Store session存储

Functions

func AuthRequired

func AuthRequired() gin.HandlerFunc

AuthRequired 需要登录

func BeforeShareDownload

func BeforeShareDownload() gin.HandlerFunc

BeforeShareDownload 分享被下载前的检查

func CSRFCheck

func CSRFCheck() gin.HandlerFunc

CSRFCheck 检查CSRF标记

func CSRFInit

func CSRFInit() gin.HandlerFunc

CSRFInit 初始化CSRF标记

func CacheControl

func CacheControl() gin.HandlerFunc

CacheControl 屏蔽客户端缓存

func CaptchaRequired

func CaptchaRequired(configName string) gin.HandlerFunc

CaptchaRequired 验证请求签名

func CheckShareUnlocked

func CheckShareUnlocked() gin.HandlerFunc

CheckShareUnlocked 检查分享是否已解锁

func CurrentUser

func CurrentUser() gin.HandlerFunc

CurrentUser 获取登录用户

func FrontendFileHandler

func FrontendFileHandler() gin.HandlerFunc

FrontendFileHandler 前端静态文件处理

func HashID

func HashID(IDType int) gin.HandlerFunc

HashID 将给定对象的HashID转换为真实ID

func IsAdmin

func IsAdmin() gin.HandlerFunc

IsAdmin 必须为管理员用户组

func IsFunctionEnabled

func IsFunctionEnabled(key string) gin.HandlerFunc

IsFunctionEnabled 当功能未开启时阻止访问

func MasterMetadata

func MasterMetadata() gin.HandlerFunc

MasterMetadata 解析主机节点发来请求的包含主机节点信息的元数据

func MobileRequestOnly

func MobileRequestOnly() gin.HandlerFunc

MobileRequestOnly

func MockHelper

func MockHelper() gin.HandlerFunc

MockHelper 单元测试助手中间件

func OSSCallbackAuth

func OSSCallbackAuth() gin.HandlerFunc

OSSCallbackAuth 阿里云OSS回调签名验证

func OneDriveCallbackAuth

func OneDriveCallbackAuth() gin.HandlerFunc

OneDriveCallbackAuth OneDrive回调签名验证

func QiniuCallbackAuth

func QiniuCallbackAuth() gin.HandlerFunc

QiniuCallbackAuth 七牛回调签名验证

func RemoteCallbackAuth

func RemoteCallbackAuth() gin.HandlerFunc

RemoteCallbackAuth 远程回调签名验证

func Sandbox

func Sandbox() gin.HandlerFunc

func Session

func Session(secret string) gin.HandlerFunc

Session 初始化session

func ShareAvailable

func ShareAvailable() gin.HandlerFunc

ShareAvailable 检查分享是否可用

func ShareCanPreview

func ShareCanPreview() gin.HandlerFunc

ShareCanPreview 检查分享是否可被预览

func ShareOwner

func ShareOwner() gin.HandlerFunc

ShareOwner 检查当前登录用户是否为分享所有者

func SignRequired

func SignRequired(authInstance auth.Auth) gin.HandlerFunc

SignRequired 验证请求签名

func SlaveRPCSignRequired

func SlaveRPCSignRequired(nodePool cluster.Pool) gin.HandlerFunc

func StaticResourceCache

func StaticResourceCache() gin.HandlerFunc

StaticResourceCache 使用静态资源缓存策略

func UpyunCallbackAuth

func UpyunCallbackAuth() gin.HandlerFunc

UpyunCallbackAuth 又拍云回调签名验证

func UseSlaveAria2Instance

func UseSlaveAria2Instance(clusterController cluster.Controller) gin.HandlerFunc

UseSlaveAria2Instance 从机用于获取对应主机节点的Aria2实例

func UseUploadSession

func UseUploadSession(policyType string) gin.HandlerFunc

对上传会话进行验证

func ValidateSourceLink() gin.HandlerFunc

ValidateSourceLink validates if the perm source link is a valid redirect link

func WebDAVAuth

func WebDAVAuth() gin.HandlerFunc

WebDAVAuth 验证WebDAV登录及权限

func WopiAccessValidation

func WopiAccessValidation(w wopi.Client, store cache.Driver) gin.HandlerFunc

func WopiWriteAccess

func WopiWriteAccess() gin.HandlerFunc

WopiWriteAccess validates if write access is obtained.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL