Authentication.proto 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. package pb;
  19. option java_package = "org.apache.hadoop.hbase.protobuf.generated";
  20. option java_outer_classname = "AuthenticationProtos";
  21. option java_generic_services = true;
  22. option java_generate_equals_and_hash = true;
  23. option optimize_for = SPEED;
  24. message AuthenticationKey {
  25. required int32 id = 1;
  26. required int64 expiration_date = 2;
  27. required bytes key = 3;
  28. }
  29. message TokenIdentifier {
  30. enum Kind {
  31. HBASE_AUTH_TOKEN = 0;
  32. }
  33. required Kind kind = 1;
  34. required bytes username = 2;
  35. required int32 key_id = 3;
  36. optional int64 issue_date = 4;
  37. optional int64 expiration_date = 5;
  38. optional int64 sequence_number = 6;
  39. }
  40. // Serialization of the org.apache.hadoop.security.token.Token class
  41. // Note that this is a Hadoop class, so fields may change!
  42. message Token {
  43. // the TokenIdentifier in serialized form
  44. // Note: we can't use the protobuf directly because the Hadoop Token class
  45. // only stores the serialized bytes
  46. optional bytes identifier = 1;
  47. optional bytes password = 2;
  48. optional bytes service = 3;
  49. }
  50. // RPC request & response messages
  51. message GetAuthenticationTokenRequest {
  52. }
  53. message GetAuthenticationTokenResponse {
  54. optional Token token = 1;
  55. }
  56. message WhoAmIRequest {
  57. }
  58. message WhoAmIResponse {
  59. optional string username = 1;
  60. optional string auth_method = 2;
  61. }
  62. // RPC service
  63. service AuthenticationService {
  64. rpc GetAuthenticationToken(GetAuthenticationTokenRequest)
  65. returns (GetAuthenticationTokenResponse);
  66. rpc WhoAmI(WhoAmIRequest)
  67. returns (WhoAmIResponse);
  68. }