mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
ab62f2d79d
* fix: return full url of assets in admin and mgmt api * remove asset loading over asset service * remove unused code Co-authored-by: Max Peintner <max@caos.ch>
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
const (
|
|
UsersAssetPath = "users"
|
|
AvatarAssetPath = "/avatar"
|
|
|
|
policyPrefix = "policy"
|
|
LabelPolicyPrefix = policyPrefix + "/label"
|
|
labelPolicyLogoPrefix = LabelPolicyPrefix + "/logo"
|
|
labelPolicyIconPrefix = LabelPolicyPrefix + "/icon"
|
|
labelPolicyFontPrefix = LabelPolicyPrefix + "/font"
|
|
Dark = "dark"
|
|
|
|
CssPath = LabelPolicyPrefix + "/css"
|
|
CssVariablesFileName = "variables.css"
|
|
|
|
LabelPolicyLogoPath = labelPolicyLogoPrefix
|
|
LabelPolicyIconPath = labelPolicyIconPrefix
|
|
LabelPolicyFontPath = labelPolicyFontPrefix
|
|
)
|
|
|
|
type AssetInfo struct {
|
|
Bucket string
|
|
Key string
|
|
ETag string
|
|
Size int64
|
|
LastModified time.Time
|
|
Location string
|
|
VersionID string
|
|
Expiration time.Time
|
|
AutheticatedURL string
|
|
ContentType string
|
|
}
|
|
|
|
func GetHumanAvatarAssetPath(userID string) string {
|
|
return UsersAssetPath + "/" + userID + AvatarAssetPath
|
|
}
|
|
|
|
func AssetURL(prefix, resourceOwner, key string) string {
|
|
if prefix == "" || resourceOwner == "" || key == "" {
|
|
return ""
|
|
}
|
|
return prefix + resourceOwner + "/" + key
|
|
}
|