Generate presigned URL for email assets at render time
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgconn"
|
||||
"go.gearno.de/kit/pg"
|
||||
"go.probo.inc/probo/pkg/filemanager"
|
||||
"go.probo.inc/probo/pkg/gid"
|
||||
)
|
||||
|
||||
@@ -44,6 +45,24 @@ type (
|
||||
Files []*File
|
||||
)
|
||||
|
||||
func (f *File) GetName() string {
|
||||
return f.FileName
|
||||
}
|
||||
|
||||
func (f *File) GetObjectKey() string {
|
||||
return f.FileKey
|
||||
}
|
||||
|
||||
func (f *File) GetBucketName() string {
|
||||
return f.BucketName
|
||||
}
|
||||
|
||||
func (f *File) GetMimeType() string {
|
||||
return f.MimeType
|
||||
}
|
||||
|
||||
var _ filemanager.File = (*File)(nil)
|
||||
|
||||
// AuthorizationAttributes returns the authorization attributes for policy evaluation.
|
||||
func (f *File) AuthorizationAttributes(ctx context.Context, conn pg.Conn) (map[string]string, error) {
|
||||
q := `SELECT organization_id FROM files WHERE id = $1 LIMIT 1;`
|
||||
|
||||
Reference in New Issue
Block a user