Переглянути джерело

permissions: docs - elaborated more the help for allow_trusted()

Daniel-Constantin Mierla 7 роки тому
батько
коміт
8527063594
1 змінених файлів з 16 додано та 7 видалено
  1. 16 7
      src/modules/permissions/doc/permissions_admin.xml

+ 16 - 7
src/modules/permissions/doc/permissions_admin.xml

@@ -1185,12 +1185,12 @@ if ($var(group) != -1) {
 	</section>
 	</section>
 	<section id ="permissions.f.allow_trusted">
 	<section id ="permissions.f.allow_trusted">
 		<title>
 		<title>
-		<function moreinfo="none">allow_trusted([src_ip_pvar, proto_pvar, uri_pvar])</function>
+		<function moreinfo="none">allow_trusted([src_ip_pvar, proto_pvar, furi_pvar])</function>
 		</title>
 		</title>
 		<para>
 		<para>
 		Checks based either on request's source address and transport
 		Checks based either on request's source address and transport
 		protocol or source address and transport protocol given
 		protocol or source address and transport protocol given
-		in pvar arguments, and From URI of request (or uri_pvar if provided)
+		in pvar arguments, and From URI of request (or furi_pvar if provided)
 		if request can be trusted without
 		if request can be trusted without
 		authentication.  Returns <quote>1</quote> if a match is found
 		authentication.  Returns <quote>1</quote> if a match is found
 		as described in <xref linkend="sec-trusted-requests"/>
 		as described in <xref linkend="sec-trusted-requests"/>
@@ -1200,9 +1200,14 @@ if ($var(group) != -1) {
 		matching peer to AVP peer_tag_avp.
 		matching peer to AVP peer_tag_avp.
 		</para>
 		</para>
 		<para>
 		<para>
-		Source address, transport protocol and uri given in pvar
-		arguments must be in string format.  Valid transport
-		protocol values are (ignoring case) "any", "udp, "tcp", "tls",
+		NOTE: source IP is matched using string comparison. Be careful if the
+		IP can have different forms, for a safer alternative for matching IP
+		addresses, look at allow_source_address or allow_address().
+		</para>
+		<para>
+		Source address, transport protocol and uri given in the
+		arguments must be in string format and they can contain script variables.
+		Valid transport protocol values are (ignoring case) "any", "udp, "tcp", "tls",
 		"ws", "wss" and "sctp".
 		"ws", "wss" and "sctp".
 		</para>
 		</para>
 		<para>
 		<para>
@@ -1214,11 +1219,15 @@ if ($var(group) != -1) {
 ...
 ...
 if (allow_trusted()) {
 if (allow_trusted()) {
 	t_relay();
 	t_relay();
-};
+}
 ...
 ...
 if (allow_trusted("$si", "$proto")) {
 if (allow_trusted("$si", "$proto")) {
 	t_relay();
 	t_relay();
-};
+}
+...
+if (allow_trusted("$si", "any", "$ai")) {
+	t_relay();
+}
 ...
 ...
 </programlisting>
 </programlisting>
 		</example>
 		</example>