generator.proto 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. syntax = "proto3";
  2. package generator.v1;
  3. option go_package = "github.com/external-secrets/external-secrets/proto/generator;generator";
  4. // GeneratorProvider is the service interface that generator implementations must satisfy.
  5. service GeneratorProvider {
  6. // Generate creates a new secret or set of secrets.
  7. // The returned map is a mapping of secret names to their respective values.
  8. // The state is an optional field that can be used to store any generator-specific
  9. // state which can be used during the Cleanup phase.
  10. rpc Generate(GenerateRequest) returns (GenerateResponse);
  11. // Cleanup deletes any resources created during the Generate phase.
  12. // Cleanup is idempotent and should not return an error if the resources
  13. // have already been deleted.
  14. rpc Cleanup(CleanupRequest) returns (CleanupResponse);
  15. }
  16. // GeneratorRef references a generator custom resource.
  17. message GeneratorRef {
  18. // Specify the apiVersion of the generator resource
  19. string api_version = 1;
  20. // Specify the Kind of the generator resource
  21. string kind = 2;
  22. // Specify the name of the generator resource
  23. string name = 3;
  24. // Namespace of the generator resource (optional for cluster-scoped generators)
  25. string namespace = 4;
  26. }
  27. // GenerateRequest contains the information needed to generate secrets
  28. message GenerateRequest {
  29. // Reference to the generator resource
  30. GeneratorRef generator_ref = 1;
  31. // Namespace of the ExternalSecret making the request (for validation)
  32. string source_namespace = 2;
  33. }
  34. // GenerateResponse contains the generated secrets and optional state
  35. message GenerateResponse {
  36. // Map of secret keys to their values
  37. map<string, bytes> secrets = 1;
  38. // Optional state that can be used during cleanup
  39. // This is provider-specific and opaque to the controller
  40. bytes state = 2;
  41. }
  42. // CleanupRequest contains the information needed to cleanup resources
  43. message CleanupRequest {
  44. // Reference to the generator resource
  45. GeneratorRef generator_ref = 1;
  46. // State returned from the Generate call
  47. bytes state = 2;
  48. // Namespace of the ExternalSecret making the request (for validation)
  49. string source_namespace = 3;
  50. }
  51. // CleanupResponse is the response from cleanup
  52. message CleanupResponse {
  53. // Empty response - errors are communicated via gRPC status
  54. }