docs: refine changelog

This commit is contained in:
zmstone 2024-03-23 11:57:28 +01:00
parent 22838f027a
commit df913f2450
3 changed files with 14 additions and 8 deletions

View File

@ -424,14 +424,14 @@ is_missing_namespace(ShortName, FullName, RootNames) ->
ShortName =:= FullName ShortName =:= FullName
end. end.
%% Returns short name from full name, fullname delemited by colon(:). %% Returns short name from full name, fullname delimited by colon(:).
short_name(FullName) -> short_name(FullName) ->
case string:split(FullName, ":") of case string:split(FullName, ":") of
[_, Name] -> to_bin(Name); [_, Name] -> to_bin(Name);
_ -> to_bin(FullName) _ -> to_bin(FullName)
end. end.
%% Returns the hash-anchor from full name, fullname delemited by colon(:). %% Returns the hash-anchor from full name, fullname delimited by colon(:).
format_hash(FullName) -> format_hash(FullName) ->
case string:split(FullName, ":") of case string:split(FullName, ":") of
[Namespace, Name] -> [Namespace, Name] ->

View File

@ -2,16 +2,18 @@ Customizable client attributes in `clientinfo`.
Introduced a new field `client_attrs` in the `clientinfo` object. Introduced a new field `client_attrs` in the `clientinfo` object.
This enhancement enables the initialization of `client_attrs` with specific This enhancement enables the initialization of `client_attrs` with specific
attributes derived from the `clientinfo` fields upon accepting an MQTT connection. attributes derived from the `clientinfo` fields, immediately up on accepting
an MQTT connection.
### Initialization of `client_attrs` ### Initialization of `client_attrs`
- The `client_attrs` field can be initially populated based on the configuration from one of the - The `client_attrs` field can be initially populated based on the configuration from one of the
following sources: following sources:
- `cn`: The common name from the TLS client's certificate.
- `dn`: The distinguished name from the TLS client's certificate, that is, the certificate "Subject".
- `clientid`: The MQTT client ID provided by the client. - `clientid`: The MQTT client ID provided by the client.
- `username`: The username provided by the client. - `username`: The username provided by the client.
- `cn`: The common name from the TLS client's certificate. - `user_property`: Extract a property value from 'User-Property' of the MQTT CONNECT packet.
- `dn`: The distinguished name from the TLS client's certificate, i.e., the certificate "Subject".
### Extension through Authentication Responses ### Extension through Authentication Responses
@ -21,7 +23,11 @@ attributes derived from the `clientinfo` fields upon accepting an MQTT connectio
`client_attrs` field. `client_attrs` field.
- **JWT**: Attributes can be included via a `client_attrs` claim within the JWT. - **JWT**: Attributes can be included via a `client_attrs` claim within the JWT.
### Usage in Authorization ### Usage in Authentication and Authorization
- If `client_attrs` is initialized before authentication, it can be used in external authentication
requests. For instance, `${client_attrs.property1}` can be used within request templates
directed at an HTTP server for the purpose of authenticity validation.
- The `client_attrs` can be utilized in authorization configurations or request templates, enhancing - The `client_attrs` can be utilized in authorization configurations or request templates, enhancing
flexibility and control. Examples include: flexibility and control. Examples include:

View File

@ -1592,7 +1592,7 @@ client_attrs_init_extract_from {
- `clientid`: Extract from the client ID. - `clientid`: Extract from the client ID.
- `username`: Extract from the username. - `username`: Extract from the username.
- `cn`: Extract from the Common Name (CN) field of the client certificate. - `cn`: Extract from the Common Name (CN) field of the client certificate.
- `dn`: Extract from the Distinguished Name (DN) field of the client certficate. - `dn`: Extract from the Distinguished Name (DN) field of the client certificate.
- `user_property`: Extract from the user property sent in the MQTT v5 `CONNECT` packet. - `user_property`: Extract from the user property sent in the MQTT v5 `CONNECT` packet.
In this case, `extract_regex` is not applicable, and `extract_as` should be the user property key. In this case, `extract_regex` is not applicable, and `extract_as` should be the user property key.
@ -1605,7 +1605,7 @@ client_attrs_init_extract_regexp {
desc: """~ desc: """~
The regular expression to extract a client attribute from the client property specified by `client_attrs_init.extract_from` config. The regular expression to extract a client attribute from the client property specified by `client_attrs_init.extract_from` config.
The expression should match the entire client property value, and capturing groups are concatenated to make the client attribute. The expression should match the entire client property value, and capturing groups are concatenated to make the client attribute.
For example if the client attribute is the first part of the client ID delemited by a dash, the regular expression would be `^(.+?)-.*$`. For example if the client attribute is the first part of the client ID delimited by a dash, the regular expression would be `^(.+?)-.*$`.
Note that failure to match the regular expression will result in the client attribute being absent but not an empty string.""" Note that failure to match the regular expression will result in the client attribute being absent but not an empty string."""
} }