Software /
code /
prosody
File
teal-src/net/http.d.tl @ 12648:f299e570a0fe
mod_authz_internal: Use util.roles, some API changes and config support
This commit was too awkward to split (hg record didn't like it), so:
- Switch to the new util.roles lib to provide a consistent representation of
a role object.
- Change API method from get_role_info() to get_role_by_name() (touches
sessionmanager and usermanager)
- Change get_roles() to get_user_roles(), take a username instead of a JID
This is more consistent with all other usermanager API methods.
- Support configuration of custom roles and permissions via the config file
(to be documented).
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 19 Jul 2022 18:02:02 +0100 |
parent | 12612:588b1d175838 |
line wrap: on
line source
local Promise = require "util.promise".Promise; local record sslctx -- from LuaSec end local record lib enum http_method "GET" "HEAD" "POST" "PUT" "OPTIONS" "DELETE" -- etc? end record http_client_options sslctx : sslctx end record http_options id : string onlystatus : boolean body : string method : http_method headers : { string : string } insecure : boolean suppress_errors : boolean streaming_handler : function suppress_url : boolean sslctx : sslctx end record http_request host : string port : string enum scheme "http" "https" end scheme : scheme url : string userinfo : string path : string method : http_method headers : { string : string } insecure : boolean suppress_errors : boolean streaming_handler : function http : http_client time : integer id : string callback : http_callback end record http_response end type http_callback = function (string, number, http_response, http_request) record http_client options : http_client_options request : function (http_client, string, http_options, http_callback) end request : function (string, http_options, http_callback) : Promise, string default : http_client new : function (http_client_options) : http_client events : table -- COMPAT urlencode : function (string) : string urldecode : function (string) : string formencode : function ({ string : string }) : string formdecode : function (string) : { string : string } destroy_request : function (http_request) enum available_features "sni" end features : { available_features : boolean } end return lib