aboutsummaryrefslogtreecommitdiff
path: root/website.go
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-06-24 08:44:22 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-06-24 08:44:22 +0200
commit9cd06c95eba491bce1a60f7d1b2fef320aec1124 (patch)
tree728b48b066bceda167d8d5b57e92d720766ba6eb /website.go
parent793cb2d3c20d47f3a74f385c4b9aeadf2e2297b0 (diff)
downloadguichet-9cd06c95eba491bce1a60f7d1b2fef320aec1124.tar.gz
guichet-9cd06c95eba491bce1a60f7d1b2fef320aec1124.zip
don't display the global key anymore
Diffstat (limited to 'website.go')
-rw-r--r--website.go27
1 files changed, 13 insertions, 14 deletions
diff --git a/website.go b/website.go
index 74daf89..cdfae89 100644
--- a/website.go
+++ b/website.go
@@ -81,26 +81,17 @@ func NewWebsiteController(user *LoggedUser) (*WebsiteController, error) {
}
type WebsiteDescribe struct {
- 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, 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{
- *s3key.AccessKeyId,
- *s3key.SecretAccessKey,
&w.WebsiteCount,
w.User.Quota.WebsiteSizeBurstedPretty(),
r}, nil
@@ -231,9 +222,11 @@ func (w *WebsiteController) Delete(pretty string) error {
}
type WebsiteView struct {
- Name *WebsiteId `json:"vhost"`
- Size QuotaStat `json:"quota_size"`
- Files QuotaStat `json:"quota_files"`
+ Name *WebsiteId `json:"vhost"`
+ AccessKeyId string `json:"access_key_id"`
+ SecretAccessKey string `json:"secret_access_key"`
+ Size QuotaStat `json:"quota_size"`
+ Files QuotaStat `json:"quota_files"`
}
func NewWebsiteView(binfo *garage.BucketInfo) *WebsiteView {
@@ -242,10 +235,16 @@ func NewWebsiteView(binfo *garage.BucketInfo) *WebsiteView {
wid := NewWebsiteIdFromBucketInfo(binfo)
size := NewQuotaStat(*binfo.Bytes, (&q).GetMaxSize(), true)
objects := NewQuotaStat(*binfo.Objects, (&q).GetMaxObjects(), false)
- return &WebsiteView{wid, size, objects}
+ return &WebsiteView{
+ wid,
+ "not yet implemented",
+ "not yet implemented",
+ size,
+ objects,
+ }
}
type WebsitePatch struct {
- Size *int64 `json:"quota_size"`
+ Size *int64 `json:"quota_size"`
Vhost *string `json:"vhost"`
}