mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
feat: store assets in database (#3290)
* feat: use database as asset storage * being only uploading assets if allowed * tests * fixes * cleanup after merge * renaming * various fixes * fix: change to repository event types and removed unused code * feat: set default features * error handling * error handling and naming * fix tests * fix tests * fix merge * rename
This commit is contained in:
@@ -163,7 +163,7 @@ func (m *Styling) generateStylingFile(policy *iam_model.LabelPolicyView) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return m.uploadFilesToBucket(policy.AggregateID, "text/css", reader, size)
|
||||
return m.uploadFilesToStorage(policy.InstanceID, policy.AggregateID, "text/css", reader, size)
|
||||
}
|
||||
|
||||
func (m *Styling) writeFile(policy *iam_model.LabelPolicyView) (io.Reader, int64, error) {
|
||||
@@ -245,9 +245,10 @@ const fontFaceTemplate = `
|
||||
}
|
||||
`
|
||||
|
||||
func (m *Styling) uploadFilesToBucket(aggregateID, contentType string, reader io.Reader, size int64) error {
|
||||
func (m *Styling) uploadFilesToStorage(instanceID, aggregateID, contentType string, reader io.Reader, size int64) error {
|
||||
fileName := domain.CssPath + "/" + domain.CssVariablesFileName
|
||||
_, err := m.static.PutObject(context.Background(), aggregateID, fileName, contentType, reader, size, true)
|
||||
//TODO: handle location as soon as possible
|
||||
_, err := m.static.PutObject(context.Background(), instanceID, "", aggregateID, fileName, contentType, static.ObjectTypeStyling, reader, size)
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user