emqx_authn_jwt_schema.hocon 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. emqx_authn_jwt_schema {
  2. acl_claim_name.desc:
  3. """The JWT claim designated for accessing ACL (Access Control List) rules can be specified,
  4. such as using the `acl` claim. A typical decoded JWT with this claim might appear as:
  5. `{"username": "user1", "acl": ...}`.
  6. Supported ACL Rule Formats:
  7. - Object Format:
  8. Utilizes action types pub (publish), sub (subscribe), or all (both publish and subscribe).
  9. The value is a list of topic filters.
  10. Example: `{"pub": ["topic1"], "sub": [], "all": ["${username}/#"]}`.
  11. This example signifies that the token owner can publish to topic1 and perform both publish and subscribe
  12. actions on topics starting with their username.
  13. Note: In this format, if no topic matches, the action is denied, and the authorization process terminates.
  14. - Array Format (resembles File-Based ACL Rules):
  15. Example: `[{"permission": "allow", "action": "all", "topic": "${username}/#"}]`.
  16. Additionally, the `pub` or `publish` action rules can be extended with `qos` and `retain` field,
  17. and `sub` or `subscribe` action rules can be extended with a `qos` field.
  18. Note: Here, if no rule matches, the action is not immediately denied.
  19. The process continues to other configured authorization sources,
  20. and ultimately falls back to the default permission in config `authorization.no_match`.
  21. The ACL claim utilizes MQTT topic wildcard matching rules for publishing or subscribing.
  22. A special syntax for the 'subscribe' action allows the use of `eq` for an exact match.
  23. For instance, `eq t/#` permits or denies subscription to `t/#`, but not to `t/1`."""
  24. acl_claim_name.label:
  25. """ACL claim name"""
  26. algorithm.desc:
  27. """JWT signing algorithm, Supports HMAC (configured as <code>hmac-based</code>) and RSA, ECDSA (configured as <code>public-key</code>)."""
  28. algorithm.label:
  29. """JWT Signing Algorithm"""
  30. cacertfile.desc:
  31. """Path to a file containing PEM-encoded CA certificates."""
  32. cacertfile.label:
  33. """CA Certificate File"""
  34. certfile.desc:
  35. """Path to a file containing the user certificate."""
  36. certfile.label:
  37. """Certificate File"""
  38. enable.desc:
  39. """Enable/disable SSL."""
  40. enable.label:
  41. """Enable/disable SSL"""
  42. endpoint.desc:
  43. """JWKS endpoint, it's a read-only endpoint that returns the server's public key set in the JWKS format."""
  44. endpoint.label:
  45. """JWKS Endpoint"""
  46. from.desc:
  47. """Field to take JWT from."""
  48. from.label:
  49. """From Field"""
  50. jwt_hmac.desc:
  51. """Configuration when the JWT for authentication is issued using the HMAC algorithm."""
  52. jwt_jwks.desc:
  53. """Configuration when JWTs used for authentication need to be fetched from the JWKS endpoint."""
  54. keyfile.desc:
  55. """Path to a file containing the user's private PEM-encoded key."""
  56. keyfile.label:
  57. """Key File"""
  58. jwt_public_key.desc:
  59. """Configuration when the JWT for authentication is issued using RSA or ECDSA algorithm."""
  60. public_key.desc:
  61. """The public key used to verify the JWT."""
  62. public_key.label:
  63. """Public Key"""
  64. refresh_interval.desc:
  65. """JWKS refresh interval."""
  66. refresh_interval.label:
  67. """JWKS Refresh Interval"""
  68. secret.desc:
  69. """The key to verify the JWT using HMAC algorithm."""
  70. secret.label:
  71. """Secret"""
  72. secret_base64_encoded.desc:
  73. """Whether secret is base64 encoded."""
  74. secret_base64_encoded.label:
  75. """Whether Secret is Base64 Encoded"""
  76. server_name_indication.desc:
  77. """Server Name Indication (SNI)."""
  78. server_name_indication.label:
  79. """Server Name Indication"""
  80. ssl.desc:
  81. """SSL options."""
  82. ssl.label:
  83. """SSL Options"""
  84. use_jwks.desc:
  85. """Whether to use JWKS."""
  86. use_jwks.label:
  87. """Whether to Use JWKS"""
  88. verify.desc:
  89. """Enable or disable SSL peer verification."""
  90. verify.label:
  91. """Verify"""
  92. verify_claims.desc:
  93. """A list of custom claims to validate. The allowed formats are the following:
  94. A map where claim names are map keys and expected values are map values:
  95. <code>{ claim_name = "${username}", ...}</code>.
  96. A list of maps with <code>name</code> (claim name) and <code>value</code> (expected claim value) keys:
  97. <code>[{name = "claim_name", value = "${username}"}, ...]</code>.
  98. Values can use the following placeholders:
  99. - <code>${username}</code>: Will be replaced at runtime with <code>Username</code> used by the client when connecting
  100. - <code>${clientid}</code>: Will be replaced at runtime with <code>Client ID</code> used by the client when connecting
  101. Authentication will verify that the value of claims in the JWT (taken from the Password field) matches what is required in <code>verify_claims</code>."""
  102. verify_claims.label:
  103. """Verify Claims"""
  104. }