| 1 |
#ifndef AWS_S3EXPRESS_CREDENTIALS_PROVIDER_IMPL_H |
| 2 |
#define AWS_S3EXPRESS_CREDENTIALS_PROVIDER_IMPL_H |
| 3 |
|
| 4 |
#include <aws/common/hash_table.h> |
| 5 |
#include <aws/common/mutex.h> |
| 6 |
#include <aws/common/ref_count.h> |
| 7 |
#include <aws/s3/s3_client.h> |
| 8 |
#include <aws/s3/s3express_credentials_provider.h> |
| 9 |
|
| 10 |
struct aws_cache; |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
struct aws_s3express_session { |
| 16 |
struct aws_allocator *allocator; |
| 17 |
|
| 18 |
struct aws_string *hash_key; |
| 19 |
|
| 20 |
|
| 21 |
struct aws_credentials *s3express_credentials; |
| 22 |
|
| 23 |
|
| 24 |
struct aws_s3express_session_creator *creator; |
| 25 |
|
| 26 |
|
| 27 |
struct aws_string *region; |
| 28 |
struct aws_string *host; |
| 29 |
|
| 30 |
struct aws_http_headers *headers; |
| 31 |
bool inactive; |
| 32 |
|
| 33 |
|
| 34 |
struct aws_s3express_credentials_provider_impl *impl; |
| 35 |
}; |
| 36 |
|
| 37 |
struct aws_s3express_credentials_provider_impl { |
| 38 |
struct aws_s3_client *client; |
| 39 |
|
| 40 |
|
| 41 |
struct aws_ref_count internal_ref; |
| 42 |
|
| 43 |
struct aws_task *bg_refresh_task; |
| 44 |
struct aws_event_loop *bg_event_loop; |
| 45 |
|
| 46 |
const struct aws_credentials *default_original_credentials; |
| 47 |
struct aws_credentials_provider *default_original_credentials_provider; |
| 48 |
|
| 49 |
struct { |
| 50 |
|
| 51 |
struct aws_mutex lock; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
struct aws_hash_table session_creator_table; |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
struct aws_cache *cache; |
| 62 |
bool destroying; |
| 63 |
} synced_data; |
| 64 |
|
| 65 |
struct { |
| 66 |
|
| 67 |
|
| 68 |
struct aws_uri *endpoint_override; |
| 69 |
uint64_t bg_refresh_secs_override; |
| 70 |
|
| 71 |
bool (*s3express_session_is_valid_override)(struct aws_s3express_session *session, uint64_t now_seconds); |
| 72 |
bool (*s3express_session_about_to_expire_override)(struct aws_s3express_session *session, uint64_t now_seconds); |
| 73 |
|
| 74 |
|
| 75 |
aws_s3_meta_request_finish_fn *meta_request_finished_overhead; |
| 76 |
} mock_test; |
| 77 |
}; |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
struct aws_s3express_credentials_provider_default_options { |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
struct aws_s3_client *client; |
| 87 |
|
| 88 |
|
| 89 |
aws_simple_completion_callback *shutdown_complete_callback; |
| 90 |
void *shutdown_user_data; |
| 91 |
|
| 92 |
struct { |
| 93 |
uint64_t bg_refresh_secs_override; |
| 94 |
} mock_test; |
| 95 |
}; |
| 96 |
|
| 97 |
AWS_EXTERN_C_BEGIN |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
AWS_S3_API |
| 105 |
struct aws_s3express_credentials_provider *aws_s3express_credentials_provider_new_default( |
| 106 |
struct aws_allocator *allocator, |
| 107 |
const struct aws_s3express_credentials_provider_default_options *options); |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
AWS_S3_API |
| 118 |
struct aws_string *aws_encode_s3express_hash_key_new( |
| 119 |
struct aws_allocator *allocator, |
| 120 |
const struct aws_credentials *original_credentials, |
| 121 |
struct aws_byte_cursor host_value, |
| 122 |
struct aws_http_headers *headers); |
| 123 |
|
| 124 |
AWS_EXTERN_C_END |
| 125 |
#endif |