diff options
author | Simo Sorce <simo@redhat.com> | 2016-05-09 18:31:31 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-06-29 21:46:55 +0200 |
commit | 8f2a34cc6964a1f80a1434e05315a7ae0bb5774e (patch) | |
tree | 4dc176746c2abbd95b43a238f0a4b643feca49c4 /src/responder/secrets/secsrv_private.h | |
parent | 625bb2ddf15e8f305a53afa44e87f2146fa930af (diff) | |
download | sssd-8f2a34cc6964a1f80a1434e05315a7ae0bb5774e.tar.gz sssd-8f2a34cc6964a1f80a1434e05315a7ae0bb5774e.tar.xz sssd-8f2a34cc6964a1f80a1434e05315a7ae0bb5774e.zip |
Secrets: Add Proxy backend
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/responder/secrets/secsrv_private.h')
-rw-r--r-- | src/responder/secrets/secsrv_private.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/responder/secrets/secsrv_private.h b/src/responder/secrets/secsrv_private.h index 4b55f645a..ce8cf8216 100644 --- a/src/responder/secrets/secsrv_private.h +++ b/src/responder/secrets/secsrv_private.h @@ -24,6 +24,7 @@ #include "config.h" #include "responder/common/responder.h" +#include "responder/secrets/secsrv.h" #include <http_parser.h> struct sec_kvp { @@ -58,13 +59,14 @@ struct sec_url { char *host; int port; char *path; + char *query; char *fragment; char *userinfo; - char *query; }; struct sec_req_ctx { struct cli_ctx *cctx; + const char *base_path; const char *cfg_section; bool complete; @@ -73,7 +75,7 @@ struct sec_req_ctx { char *request_url; char *mapped_path; - uint8_t method; + enum http_method method; struct sec_url parsed_url; struct sec_kvp *headers; int num_headers; @@ -88,9 +90,13 @@ typedef struct tevent_req *(*sec_provider_req_t)(TALLOC_CTX *mem_ctx, struct sec_req_ctx *secreq); struct provider_handle { + const char *name; sec_provider_req_t fn; void *context; }; +int sec_get_provider(struct sec_ctx *sctx, const char *name, + struct provider_handle **out_handle); +int sec_add_provider(struct sec_ctx *sctx, struct provider_handle *handle); #define SEC_BASEPATH "/secrets/" @@ -99,12 +105,19 @@ int sec_req_routing(TALLOC_CTX *mem_ctx, struct sec_req_ctx *secreq, struct provider_handle **handle); int sec_provider_recv(struct tevent_req *subreq); +int sec_http_append_header(TALLOC_CTX *mem_ctx, char **dest, + char *field, char *value); + int sec_http_status_reply(TALLOC_CTX *mem_ctx, struct sec_data *reply, enum sec_http_status_codes code); int sec_http_reply_with_body(TALLOC_CTX *mem_ctx, struct sec_data *reply, enum sec_http_status_codes code, const char *content_type, struct sec_data *body); +int sec_http_reply_with_headers(TALLOC_CTX *mem_ctx, struct sec_data *reply, + int status_code, const char *reason, + struct sec_kvp *headers, int num_headers, + struct sec_data *body); enum sec_http_status_codes sec_errno_to_http_status(errno_t err); int sec_json_to_simple_secret(TALLOC_CTX *mem_ctx, @@ -118,4 +131,11 @@ int sec_array_to_json(TALLOC_CTX *mem_ctx, char **array, int count, char **output); +/* secsrv_cmd.c */ +#define SEC_REQUEST_MAX_SIZE 65536 +#define SEC_PACKET_MAX_RECV_SIZE 8192 + +int sec_send_data(int fd, struct sec_data *data); +int sec_recv_data(int fd, struct sec_data *data); + #endif /* __SECSRV_PRIVATE_H__ */ |