3aba5cb2b7
Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com> Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
50 lines
1.9 KiB
Go
50 lines
1.9 KiB
Go
package metadata
|
|
|
|
import (
|
|
"context"
|
|
|
|
claims "github.com/grafana/authlib/types"
|
|
|
|
secretv0alpha1 "github.com/grafana/grafana/pkg/apis/secret/v0alpha1"
|
|
"github.com/grafana/grafana/pkg/infra/db"
|
|
"github.com/grafana/grafana/pkg/registry/apis/secret/contracts"
|
|
"github.com/grafana/grafana/pkg/registry/apis/secret/xkube"
|
|
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
|
"k8s.io/apimachinery/pkg/apis/meta/internalversion"
|
|
)
|
|
|
|
func ProvideSecureValueMetadataStorage(db db.DB, features featuremgmt.FeatureToggles, accessClient claims.AccessClient) (contracts.SecureValueMetadataStorage, error) {
|
|
if !features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs) ||
|
|
!features.IsEnabledGlobally(featuremgmt.FlagSecretsManagementAppPlatform) {
|
|
return &secureValueMetadataStorage{}, nil
|
|
}
|
|
|
|
return &secureValueMetadataStorage{db: db, accessClient: accessClient}, nil
|
|
}
|
|
|
|
// secureValueMetadataStorage is the actual implementation of the secure value metadata storage.
|
|
type secureValueMetadataStorage struct {
|
|
db db.DB
|
|
accessClient claims.AccessClient
|
|
}
|
|
|
|
func (s *secureValueMetadataStorage) Create(ctx context.Context, sv *secretv0alpha1.SecureValue) (*secretv0alpha1.SecureValue, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
func (s *secureValueMetadataStorage) Read(ctx context.Context, namespace xkube.Namespace, name string) (*secretv0alpha1.SecureValue, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
func (s *secureValueMetadataStorage) Update(ctx context.Context, newSecureValue *secretv0alpha1.SecureValue) (*secretv0alpha1.SecureValue, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
func (s *secureValueMetadataStorage) Delete(ctx context.Context, namespace xkube.Namespace, name string) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *secureValueMetadataStorage) List(ctx context.Context, namespace xkube.Namespace, options *internalversion.ListOptions) (*secretv0alpha1.SecureValueList, error) {
|
|
return nil, nil
|
|
}
|