credentials.proto 1.9 KB

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