mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-29 17:18:43 +08:00
feature (middleware): expose gcm encrypt to templating
This commit is contained in:
@ -382,6 +382,10 @@ func SessionAuthMiddleware(ctx *App, res http.ResponseWriter, req *http.Request)
|
||||
}
|
||||
return false
|
||||
},
|
||||
"encryptGCM": func(str string, key string) (string, error) {
|
||||
data, err := EncryptAESGCM([]byte(key), []byte(str))
|
||||
return base64.StdEncoding.EncodeToString(data), err
|
||||
},
|
||||
}).
|
||||
Parse(str)
|
||||
mappingToUse[k] = str
|
||||
|
||||
Reference in New Issue
Block a user