Skip to content
Snippets Groups Projects
Commit 798f1ac9 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Allow generating different RAPI resource lookup tables


Until now the RAPI resource table returned by
“rapi.connector.GetHandlers” always uses fixed strings or compiled
regular expressions as dictionary keys. Now that a table of all RAPI
resources (and their access rights) should be written for the
documentation, a plain string version of the URIs must be available. The
compiled pattern might contain escape sequences and is not suitable.

This patch changes “GetHandlers” to accept a hook function which is used
to translate non-static resource URIs such as “/2/jobs/[job_id]/wait”.
The default implemention retains the original behaviour by translating
to compiled regular expressions.

Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent fb4b885a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment