secret_api.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. Copyright © The ESO Authors
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. https://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package secretserver
  14. import (
  15. "github.com/DelineaXPM/tss-sdk-go/v3/server"
  16. )
  17. // secretAPI represents the subset of the Secret Server API
  18. // which is supported by tss-sdk-go/v3.
  19. type secretAPI interface {
  20. // Secret retrieves a secret by its ID.
  21. Secret(id int) (*server.Secret, error)
  22. // Secrets searches for secrets by text and field name.
  23. Secrets(searchText, field string) ([]server.Secret, error)
  24. // SecretByPath retrieves a secret using its folder path.
  25. SecretByPath(secretPath string) (*server.Secret, error)
  26. // CreateSecret creates a new secret in Secret Server.
  27. CreateSecret(secret server.Secret) (*server.Secret, error)
  28. // UpdateSecret updates an existing secret in Secret Server.
  29. UpdateSecret(secret server.Secret) (*server.Secret, error)
  30. // DeleteSecret deletes a secret by its ID.
  31. DeleteSecret(id int) error
  32. // SecretTemplate retrieves a secret template by its ID.
  33. SecretTemplate(id int) (*server.SecretTemplate, error)
  34. }