emqx_conf.hrl 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2022-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
  3. %%
  4. %% Licensed under the Apache License, Version 2.0 (the "License");
  5. %% you may not use this file except in compliance with the License.
  6. %% You may obtain a copy of the License at
  7. %%
  8. %% http://www.apache.org/licenses/LICENSE-2.0
  9. %%
  10. %% Unless required by applicable law or agreed to in writing, software
  11. %% distributed under the License is distributed on an "AS IS" BASIS,
  12. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. %% See the License for the specific language governing permissions and
  14. %% limitations under the License.
  15. %%--------------------------------------------------------------------
  16. -ifndef(EMQX_CONF_HRL).
  17. -define(EMQX_CONF_HRL, true).
  18. -define(CLUSTER_RPC_SHARD, emqx_cluster_rpc_shard).
  19. -define(CLUSTER_MFA, cluster_rpc_mfa).
  20. -define(CLUSTER_COMMIT, cluster_rpc_commit).
  21. -define(DEFAULT_INIT_TXN_ID, -1).
  22. -record(cluster_rpc_mfa, {
  23. tnx_id :: pos_integer(),
  24. mfa :: {module(), atom(), [any()]},
  25. created_at :: calendar:datetime(),
  26. initiator :: node()
  27. }).
  28. -record(cluster_rpc_commit, {
  29. node :: node(),
  30. tnx_id :: pos_integer() | '$1'
  31. }).
  32. -define(READONLY_KEYS, [cluster, rpc, node]).
  33. -define(CE_AUTHZ_SOURCE_SCHEMA_MODS, [
  34. emqx_authz_file_schema,
  35. emqx_authz_mnesia_schema,
  36. emqx_authz_http_schema,
  37. emqx_authz_redis_schema,
  38. emqx_authz_mysql_schema,
  39. emqx_authz_postgresql_schema,
  40. emqx_authz_mongodb_schema,
  41. emqx_authz_ldap_schema
  42. ]).
  43. -define(EE_AUTHZ_SOURCE_SCHEMA_MODS, []).
  44. -define(CE_AUTHN_PROVIDER_SCHEMA_MODS, [
  45. emqx_authn_mnesia_schema,
  46. emqx_authn_mysql_schema,
  47. emqx_authn_postgresql_schema,
  48. emqx_authn_mongodb_schema,
  49. emqx_authn_redis_schema,
  50. emqx_authn_http_schema,
  51. emqx_authn_jwt_schema,
  52. emqx_authn_scram_mnesia_schema,
  53. emqx_authn_ldap_schema
  54. ]).
  55. -define(EE_AUTHN_PROVIDER_SCHEMA_MODS, [
  56. emqx_gcp_device_authn_schema
  57. ]).
  58. -if(?EMQX_RELEASE_EDITION == ee).
  59. -define(AUTHZ_SOURCE_SCHEMA_MODS, ?CE_AUTHZ_SOURCE_SCHEMA_MODS ++ ?EE_AUTHZ_SOURCE_SCHEMA_MODS).
  60. -define(AUTHN_PROVIDER_SCHEMA_MODS,
  61. (?CE_AUTHN_PROVIDER_SCHEMA_MODS ++ ?EE_AUTHN_PROVIDER_SCHEMA_MODS)
  62. ).
  63. -else.
  64. -define(AUTHZ_SOURCE_SCHEMA_MODS, ?CE_AUTHZ_SOURCE_SCHEMA_MODS).
  65. -define(AUTHN_PROVIDER_SCHEMA_MODS, ?CE_AUTHN_PROVIDER_SCHEMA_MODS).
  66. -endif.
  67. -endif.