2026-04-06 15:48:37 +05:30
|
|
|
// Copyright IBM Corp. 2020, 2026
|
2023-04-24 19:27:41 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
|
|
|
|
package plugin
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2026-10-12 10:33:41 -07:00
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/globals"
|
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/db"
|
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/errors"
|
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/types/resource"
|
2023-04-24 19:27:41 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const StorageDomain = "storage"
|
|
|
|
|
|
|
|
|
|
func init() {
|
2023-11-15 19:55:46 -05:00
|
|
|
globals.RegisterPrefixToResourceInfo(globals.PluginStorageBucketPrefix, resource.StorageBucket, StorageDomain, Subtype)
|
2023-04-24 19:27:41 -04:00
|
|
|
}
|
|
|
|
|
|
2023-11-02 16:03:47 -04:00
|
|
|
const (
|
2023-11-15 19:55:46 -05:00
|
|
|
Subtype = globals.Subtype("plugin")
|
2023-11-02 16:03:47 -04:00
|
|
|
)
|
|
|
|
|
|
2023-04-24 19:27:41 -04:00
|
|
|
func newStorageBucketId(ctx context.Context) (string, error) {
|
|
|
|
|
const op = "plugin.newStorageBucketId"
|
2023-06-06 17:09:08 -04:00
|
|
|
id, err := db.NewPublicId(ctx, globals.PluginStorageBucketPrefix)
|
2023-04-24 19:27:41 -04:00
|
|
|
if err != nil {
|
|
|
|
|
return "", errors.Wrap(ctx, err, op)
|
|
|
|
|
}
|
|
|
|
|
return id, nil
|
|
|
|
|
}
|