authconfig.proto 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // Copyright 2022 Google LLC
  2. //
  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. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.connectors.v1;
  16. import "google/cloud/connectors/v1/common.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/cloud/connectors/v1;connectors";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "AuthConfigProto";
  20. option java_package = "com.google.cloud.connectors.v1";
  21. // AuthConfig defines details of a authentication type.
  22. message AuthConfig {
  23. // Parameters to support Username and Password Authentication.
  24. message UserPassword {
  25. // Username.
  26. string username = 1;
  27. // Secret version reference containing the password.
  28. Secret password = 2;
  29. }
  30. // Parameters to support JSON Web Token (JWT) Profile for Oauth 2.0
  31. // Authorization Grant based authentication.
  32. // See https://tools.ietf.org/html/rfc7523 for more details.
  33. message Oauth2JwtBearer {
  34. // JWT claims used for the jwt-bearer authorization grant.
  35. message JwtClaims {
  36. // Value for the "iss" claim.
  37. string issuer = 1;
  38. // Value for the "sub" claim.
  39. string subject = 2;
  40. // Value for the "aud" claim.
  41. string audience = 3;
  42. }
  43. // Secret version reference containing a PKCS#8 PEM-encoded private
  44. // key associated with the Client Certificate. This private key will be
  45. // used to sign JWTs used for the jwt-bearer authorization grant.
  46. // Specified in the form as: `projects/*/secrets/*/versions/*`.
  47. Secret client_key = 1;
  48. // JwtClaims providers fields to generate the token.
  49. JwtClaims jwt_claims = 2;
  50. }
  51. // Parameters to support Oauth 2.0 Client Credentials Grant Authentication.
  52. // See https://tools.ietf.org/html/rfc6749#section-1.3.4 for more details.
  53. message Oauth2ClientCredentials {
  54. // The client identifier.
  55. string client_id = 1;
  56. // Secret version reference containing the client secret.
  57. Secret client_secret = 2;
  58. }
  59. // Parameters to support Ssh public key Authentication.
  60. message SshPublicKey {
  61. // The user account used to authenticate.
  62. string username = 1;
  63. // This is an optional field used in case client has enabled multi-factor
  64. // authentication
  65. Secret password = 2;
  66. // SSH Client Cert. It should contain both public and private key.
  67. Secret ssh_client_cert = 3;
  68. // Format of SSH Client cert.
  69. string cert_type = 4;
  70. // Password (passphrase) for ssh client certificate if it has one.
  71. Secret ssh_client_cert_pass = 5;
  72. }
  73. // The type of authentication configured.
  74. AuthType auth_type = 1;
  75. // Supported auth types.
  76. oneof type {
  77. // UserPassword.
  78. UserPassword user_password = 2;
  79. // Oauth2JwtBearer.
  80. Oauth2JwtBearer oauth2_jwt_bearer = 3;
  81. // Oauth2ClientCredentials.
  82. Oauth2ClientCredentials oauth2_client_credentials = 4;
  83. // SSH Public Key.
  84. SshPublicKey ssh_public_key = 6;
  85. }
  86. // List containing additional auth configs.
  87. repeated ConfigVariable additional_variables = 5;
  88. }
  89. // AuthConfigTemplate defines required field over an authentication type.
  90. message AuthConfigTemplate {
  91. // The type of authentication configured.
  92. AuthType auth_type = 1;
  93. // Config variables to describe an `AuthConfig` for a `Connection`.
  94. repeated ConfigVariableTemplate config_variable_templates = 2;
  95. }
  96. // AuthType defines different authentication types.
  97. enum AuthType {
  98. // Authentication type not specified.
  99. AUTH_TYPE_UNSPECIFIED = 0;
  100. // Username and Password Authentication.
  101. USER_PASSWORD = 1;
  102. // JSON Web Token (JWT) Profile for Oauth 2.0
  103. // Authorization Grant based authentication
  104. OAUTH2_JWT_BEARER = 2;
  105. // Oauth 2.0 Client Credentials Grant Authentication
  106. OAUTH2_CLIENT_CREDENTIALS = 3;
  107. // SSH Public Key Authentication
  108. SSH_PUBLIC_KEY = 4;
  109. }