credentials.proto 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. // List available credentials (metadata only)
  13. rpc ListCredentials(ListCredentialsRequest) returns (ListCredentialsResponse);
  14. }
  15. // Request to get credential auth header
  16. message GetCredentialAuthRequest {
  17. string credential_id = 1;
  18. string workflow_id = 2; // For access control verification
  19. }
  20. // Response with auth header
  21. message GetCredentialAuthResponse {
  22. bool success = 1;
  23. string header_name = 2; // e.g., "Authorization"
  24. string header_value = 3; // e.g., "Bearer token123"
  25. string error = 4; // Error message if success is false
  26. }
  27. // Credential info (metadata only, no secrets)
  28. message CredentialInfo {
  29. string id = 1;
  30. string name = 2;
  31. string type = 3; // "basic", "bearer", "api_key", "oauth2", "imap"
  32. string description = 4;
  33. }
  34. // Request to get IMAP credentials
  35. message GetImapCredentialsRequest {
  36. string credential_id = 1;
  37. string workflow_id = 2; // For access control verification
  38. }
  39. // Response with IMAP credentials
  40. message GetImapCredentialsResponse {
  41. bool success = 1;
  42. string host = 2;
  43. int32 port = 3;
  44. string username = 4;
  45. string password = 5;
  46. bool use_ssl = 6;
  47. string error = 7; // Error message if success is false
  48. }
  49. // Request to get MySQL credentials
  50. message GetMysqlCredentialsRequest {
  51. string credential_id = 1;
  52. string workflow_id = 2; // For access control verification
  53. }
  54. // Response with MySQL credentials
  55. message GetMysqlCredentialsResponse {
  56. bool success = 1;
  57. string host = 2;
  58. int32 port = 3;
  59. string username = 4;
  60. string password = 5;
  61. string database = 6;
  62. bool use_ssl = 7;
  63. string error = 8; // Error message if success is false
  64. }
  65. // Request to list credentials
  66. message ListCredentialsRequest {
  67. string workflow_id = 1; // Optional: filter by workflow access
  68. }
  69. // Response with credential list
  70. message ListCredentialsResponse {
  71. repeated CredentialInfo credentials = 1;
  72. }