credentials.pxd.pxi 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright 2015 gRPC authors.
  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. cdef class CallCredentials:
  15. cdef grpc_call_credentials *c(self) except *
  16. # TODO(https://github.com/grpc/grpc/issues/12531): remove.
  17. cdef grpc_call_credentials *c_credentials
  18. cdef int _get_metadata(
  19. void *state, grpc_auth_metadata_context context,
  20. grpc_credentials_plugin_metadata_cb cb, void *user_data,
  21. grpc_metadata creds_md[GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX],
  22. size_t *num_creds_md, grpc_status_code *status,
  23. const char **error_details) except * with gil
  24. cdef void _destroy(void *state) except * with gil
  25. cdef class MetadataPluginCallCredentials(CallCredentials):
  26. cdef readonly object _metadata_plugin
  27. cdef readonly bytes _name
  28. cdef grpc_call_credentials *c(self) except *
  29. cdef grpc_call_credentials *_composition(call_credentialses)
  30. cdef class CompositeCallCredentials(CallCredentials):
  31. cdef readonly tuple _call_credentialses
  32. cdef grpc_call_credentials *c(self) except *
  33. cdef class ChannelCredentials:
  34. cdef grpc_channel_credentials *c(self) except *
  35. cdef class SSLSessionCacheLRU:
  36. cdef grpc_ssl_session_cache *_cache
  37. cdef class SSLChannelCredentials(ChannelCredentials):
  38. cdef readonly object _pem_root_certificates
  39. cdef readonly object _private_key
  40. cdef readonly object _certificate_chain
  41. cdef grpc_channel_credentials *c(self) except *
  42. cdef class CompositeChannelCredentials(ChannelCredentials):
  43. cdef readonly tuple _call_credentialses
  44. cdef readonly ChannelCredentials _channel_credentials
  45. cdef grpc_channel_credentials *c(self) except *
  46. cdef class XDSChannelCredentials(ChannelCredentials):
  47. cdef readonly ChannelCredentials _fallback_credentials
  48. cdef grpc_channel_credentials *c(self) except *
  49. cdef class ServerCertificateConfig:
  50. cdef grpc_ssl_server_certificate_config *c_cert_config
  51. cdef const char *c_pem_root_certs
  52. cdef grpc_ssl_pem_key_cert_pair *c_ssl_pem_key_cert_pairs
  53. cdef size_t c_ssl_pem_key_cert_pairs_count
  54. cdef list references
  55. cdef class ServerCredentials:
  56. cdef grpc_server_credentials *c_credentials
  57. cdef grpc_ssl_pem_key_cert_pair *c_ssl_pem_key_cert_pairs
  58. cdef size_t c_ssl_pem_key_cert_pairs_count
  59. cdef list references
  60. # the cert config related state is used only if this credentials is
  61. # created with cert config/fetcher
  62. cdef object initial_cert_config
  63. cdef object cert_config_fetcher
  64. # whether C-core has asked for the initial_cert_config
  65. cdef bint initial_cert_config_fetched
  66. cdef class LocalChannelCredentials(ChannelCredentials):
  67. cdef grpc_local_connect_type _local_connect_type
  68. cdef class ALTSChannelCredentials(ChannelCredentials):
  69. cdef grpc_alts_credentials_options *c_options
  70. cdef grpc_channel_credentials *c(self) except *