| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef AWS_HTTP_CREDENTIALS_PROVIDER_H |
| 6 |
#define AWS_HTTP_CREDENTIALS_PROVIDER_H |
| 7 |
|
| 8 |
#include <aws/auth/credentials.h> |
| 9 |
#include <aws/http/connection_manager.h> |
| 10 |
#include <aws/http/request_response.h> |
| 11 |
|
| 12 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
struct aws_credentials_provider_http_options { |
| 18 |
struct aws_credentials_provider_shutdown_options shutdown_options; |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
struct aws_client_bootstrap *bootstrap; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
struct aws_tls_ctx *tls_ctx; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
size_t max_connections; |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
struct aws_byte_cursor endpoint; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
struct aws_retry_strategy *retry_strategy; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
const struct proxy_env_var_settings *proxy_ev_settings; |
| 61 |
|
| 62 |
|
| 63 |
const struct aws_auth_http_system_vtable *function_table; |
| 64 |
}; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
struct aws_http_query_context { |
| 70 |
|
| 71 |
struct aws_allocator *allocator; |
| 72 |
struct aws_credentials_provider *provider; |
| 73 |
aws_on_get_credentials_callback_fn *original_callback; |
| 74 |
void *original_user_data; |
| 75 |
|
| 76 |
|
| 77 |
struct aws_http_connection *connection; |
| 78 |
struct aws_http_message *request; |
| 79 |
struct aws_byte_buf payload; |
| 80 |
struct aws_retry_token *retry_token; |
| 81 |
struct aws_byte_buf path_and_query; |
| 82 |
|
| 83 |
int status_code; |
| 84 |
int error_code; |
| 85 |
|
| 86 |
|
| 87 |
void *parameters; |
| 88 |
void *request_data; |
| 89 |
}; |
| 90 |
|
| 91 |
typedef int(create_request_fn)(struct aws_http_query_context *query_context, void *user_data); |
| 92 |
typedef void(finalize_credentials_fn)(struct aws_http_query_context *query_context); |
| 93 |
typedef void(clean_up_parameters_fn)(void *parameters); |
| 94 |
typedef void(create_request_data_fn)(struct aws_http_query_context *query_context); |
| 95 |
typedef void(reset_request_data_fn)(struct aws_http_query_context *query_context); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
struct aws_http_credentials_provider_user_data { |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
void *parameters; |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
struct aws_http_credentials_provider_request_vtable *request_vtable; |
| 112 |
}; |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
struct aws_http_credentials_provider_request_vtable { |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
create_request_fn *create_request_fn; |
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
finalize_credentials_fn *finalize_credentials_fn; |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
clean_up_parameters_fn *clean_up_parameters_fn; |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
create_request_data_fn *create_request_data_fn; |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
reset_request_data_fn *reset_request_data_fn; |
| 144 |
}; |
| 145 |
|
| 146 |
AWS_EXTERN_C_BEGIN |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
AWS_AUTH_API |
| 160 |
int aws_http_credentials_provider_init_base( |
| 161 |
struct aws_allocator *allocator, |
| 162 |
struct aws_credentials_provider *provider, |
| 163 |
struct aws_credentials_provider_http_options *options, |
| 164 |
struct aws_http_credentials_provider_user_data *user_data); |
| 165 |
|
| 166 |
AWS_EXTERN_C_END |
| 167 |
AWS_POP_SANE_WARNING_LEVEL |
| 168 |
|
| 169 |
#endif |