provider.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. package provider
  13. import (
  14. "context"
  15. "sigs.k8s.io/controller-runtime/pkg/client"
  16. esv1alpha1 "github.com/external-secrets/external-secrets/api/v1alpha1"
  17. )
  18. // Provider is a common interface for interacting with secret backends.
  19. type Provider interface {
  20. // New constructs a SecretsManager Provider
  21. New(ctx context.Context, store esv1alpha1.SecretStoreProvider, kube client.Client, namespace string) (Provider, error)
  22. // GetSecret returns a single secret from the provider
  23. GetSecret(ctx context.Context, ref esv1alpha1.ExternalSecretDataRemoteRef) ([]byte, error)
  24. // GetSecretMap returns multiple k/v pairs from the provider
  25. GetSecretMap(ctx context.Context, ref esv1alpha1.ExternalSecretDataRemoteRef) (map[string][]byte, error)
  26. }