credentials.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. syntax = "proto3";
  2. package smartbotic.proto;
  3. option cc_enable_arenas = true;
  4. // Credential service for runners to fetch authentication headers
  5. service CredentialService {
  6. // Get HTTP authentication header for a credential
  7. rpc GetCredentialAuth(GetCredentialAuthRequest) returns (GetCredentialAuthResponse);
  8. // Get IMAP credentials for a credential
  9. rpc GetImapCredentials(GetImapCredentialsRequest) returns (GetImapCredentialsResponse);
  10. // Get MySQL credentials for a credential
  11. rpc GetMysqlCredentials(GetMysqlCredentialsRequest) returns (GetMysqlCredentialsResponse);
  12. // Get PostgreSQL credentials for a credential
  13. rpc GetPostgresqlCredentials(GetPostgresqlCredentialsRequest) returns (GetPostgresqlCredentialsResponse);
  14. // List available credentials (metadata only)
  15. rpc ListCredentials(ListCredentialsRequest) returns (ListCredentialsResponse);
  16. }
  17. // Request to get credential auth header
  18. message GetCredentialAuthRequest {
  19. string credential_id = 1;
  20. string workflow_id = 2; // For access control verification
  21. }
  22. // Response with auth header
  23. message GetCredentialAuthResponse {
  24. bool success = 1;
  25. string header_name = 2; // e.g., "Authorization"
  26. string header_value = 3; // e.g., "Bearer token123"
  27. string error = 4; // Error message if success is false
  28. }
  29. // Credential info (metadata only, no secrets)
  30. message CredentialInfo {
  31. string id = 1;
  32. string name = 2;
  33. string type = 3; // "basic", "bearer", "api_key", "oauth2", "imap", "mysql", "postgresql"
  34. string description = 4;
  35. }
  36. // Request to get IMAP credentials
  37. message GetImapCredentialsRequest {
  38. string credential_id = 1;
  39. string workflow_id = 2; // For access control verification
  40. }
  41. // Response with IMAP credentials
  42. message GetImapCredentialsResponse {
  43. bool success = 1;
  44. string host = 2;
  45. int32 port = 3;
  46. string username = 4;
  47. string password = 5;
  48. bool use_ssl = 6;
  49. string error = 7; // Error message if success is false
  50. }
  51. // Request to get MySQL credentials
  52. message GetMysqlCredentialsRequest {
  53. string credential_id = 1;
  54. string workflow_id = 2; // For access control verification
  55. }
  56. // Response with MySQL credentials
  57. message GetMysqlCredentialsResponse {
  58. bool success = 1;
  59. string host = 2;
  60. int32 port = 3;
  61. string username = 4;
  62. string password = 5;
  63. string database = 6;
  64. bool use_ssl = 7;
  65. string error = 8; // Error message if success is false
  66. }
  67. // Request to get PostgreSQL credentials
  68. message GetPostgresqlCredentialsRequest {
  69. string credential_id = 1;
  70. string workflow_id = 2; // For access control verification
  71. }
  72. // Response with PostgreSQL credentials
  73. message GetPostgresqlCredentialsResponse {
  74. bool success = 1;
  75. string host = 2;
  76. int32 port = 3;
  77. string username = 4;
  78. string password = 5;
  79. string database = 6;
  80. bool use_ssl = 7;
  81. string error = 8; // Error message if success is false
  82. }
  83. // Request to list credentials
  84. message ListCredentialsRequest {
  85. string workflow_id = 1; // Optional: filter by workflow access
  86. }
  87. // Response with credential list
  88. message ListCredentialsResponse {
  89. repeated CredentialInfo credentials = 1;
  90. }