Browse code

modules: readme files regenerated - jwt ... [skip ci]

Kamailio Dev authored on 03/05/2021 06:01:12
Showing 1 changed files
... ...
@@ -122,14 +122,17 @@ modparam("jwt", "key_mode", 1)
122 122
        libjwt (e.g., RS256, HS256, ES256, ...)
123 123
      * claims - the list of claims to be added to JWT, in the format
124 124
        "name1=value1;name2=value2;..." (same as the SIP parameters
125
-       format).
125
+       format). The string values can be enclosed in single or double
126
+       quotes. If a value is not eclosed in between quotes, it is added as
127
+       numeric value if it is successfully converted to a long value,
128
+       otherwise is added as string value.
126 129
 
127 130
    This function can be used from ANY_ROUTE.
128 131
 
129 132
    Example 1.2. jwt_generate usage
130 133
 ...
131 134
   jwt_generate("/path/to/prvkey.pem", "RS256",
132
-        "caller=$fU;callee=$tU;callid=$ci");
135
+        "caller='$fU';callee='$tU';callid='$ci';index=100");
133 136
 ...
134 137
 
135 138
 4.2.  jwt_verify(pubkey, alg, claims, jwtval)
... ...
@@ -142,7 +145,8 @@ modparam("jwt", "key_mode", 1)
142 145
        libjwt (e.g., RS256, HS256, ES256, ...)
143 146
      * claims - the list of claims to be checked they are in the JWT, in
144 147
        the format "name1=value1;name2=value2;..." (same as the SIP
145
-       parameters format).
148
+       parameters format, see also the description of claims parameter for
149
+       jwt_generate()).
146 150
      * jwtval - the value of the JWT to verify
147 151
 
148 152
    This function can be used from ANY_ROUTE.
... ...
@@ -150,7 +154,7 @@ modparam("jwt", "key_mode", 1)
150 154
    Example 1.3. jwt_verify usage
151 155
 ...
152 156
   if(!jwt_verify("/path/to/pubkey.pem", "RS256",
153
-         "caller=$fU;callee=$tU;callid=$ci",
157
+         "caller='$fU';callee='$tU';callid='$ci';index=100",
154 158
         "$var(jwt)") {
155 159
     xwarn("failed to verify jwt\n");
156 160
   }
... ...
@@ -171,6 +175,6 @@ modparam("jwt", "key_mode", 1)
171 175
    Example 1.4. $jwt(name) usage
172 176
 ...
173 177
   jwt_generate("/path/to/prvkey.pem", "RS256",
174
-        "caller=$fU;callee=$tU;callid=$ci");
178
+        "caller='$fU';callee='$tU';callid='$ci';index=100");
175 179
   xinfo("jwt is: $jwt(val)");
176 180
 ...