aboutsummaryrefslogtreecommitdiff
path: root/website.go
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-09-26 08:40:30 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-09-26 08:40:30 +0200
commitd8633d7fb89b55996f25e1a67180408c805ba15f (patch)
tree50c7b637e1f89c6ffcf8fcc7bf99429e91c944ef /website.go
parent982bd8a43c50bb5845b694dbd0b3e0ffbf43dad7 (diff)
downloadguichet-d8633d7fb89b55996f25e1a67180408c805ba15f.tar.gz
guichet-d8633d7fb89b55996f25e1a67180408c805ba15f.zip
final
Diffstat (limited to 'website.go')
-rw-r--r--website.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/website.go b/website.go
index 7e89a41..6158042 100644
--- a/website.go
+++ b/website.go
@@ -81,16 +81,29 @@ func NewWebsiteController(user *LoggedUser) (*WebsiteController, error) {
}
type WebsiteDescribe struct {
- AllowedWebsites *QuotaStat `json:"quota"`
+ AccessKeyId string `json:"access_key_id"`
+ SecretAccessKey string `json:"secret_access_key"`
+ AllowedWebsites *QuotaStat `json:"quota_website_count"`
+ BurstBucketQuotaSize string `json:"burst_bucket_quota_size"`
Websites []*WebsiteId `json:"vhosts"`
}
-func (w *WebsiteController) Describe() *WebsiteDescribe {
+func (w *WebsiteController) Describe() (*WebsiteDescribe, error) {
+ s3key, err := w.User.S3KeyInfo()
+ if err != nil {
+ return nil, err
+ }
+
r := make([]*WebsiteId, 0, len(w.PrettyList))
for _, k := range w.PrettyList {
r = append(r, w.WebsiteIdx[k])
}
- return &WebsiteDescribe { &w.WebsiteCount, r }
+ return &WebsiteDescribe {
+ *s3key.AccessKeyId,
+ *s3key.SecretAccessKey,
+ &w.WebsiteCount,
+ w.User.Quota.WebsiteSizeBurstedPretty(),
+ r }, nil
}
func (w *WebsiteController) Inspect(pretty string) (*WebsiteView, error) {