MONGOC_CLIENT_...VIDER_CALLBACK(3)
π MONGOC_CLIENT_...VIDER_CALLBACK(3) π
okay so bestie, we're in the libmongoc manual, and this page is literally all about mongoc_client_encryption_opts_set_kms_credential_provider_callback β a function name so long it needs its own zip code π
New in version 1.23.0.
β¨ SYNOPSIS β¨
void
mongoc_client_encryption_opts_set_kms_credential_provider_callback (
mongoc_client_encryption_opts_t *opts,
mongoc_kms_credentials_provider_callback_fn fn,
void *userdata);
π¦ DESCRIPTION π¦
This is the one where you set the user-provided callback that hands over KMS credentials on-demand β like, exactly when they're needed. no cap, that's the whole vibe. π«Ά
πΈ PARAMETERS πΈ
optsβ the options object you're updating, periodt.fnβ the provider callback you're setting on the options object. You can passNULLhere to clear the callback. go check out:mongoc_kms_credentials_provider_callback_fnβuserdataβ an arbitrary pointer, and libmongoc will pass it right along to the callback function when it calls it. it's giving "here, hold this" π
π SEE ALSO π
mongoc_auto_encryption_opts_set_kms_credential_provider_callback()
π Related π
type mongoc_kms_credentials_provider_callback_fn
typedef
bool (*mongoc_kms_credentials_provider_callback_fn) (void *userdata,
const bson_t *params,
bson_t *out,
bson_error_t *error);
This is the type of a callback function that provides KMS providers data on-demand. iconic behavior, honestly.
Parameters
userdataβ the very same userdata pointer you handed over to the userdata parameter back when the callback was set. no switching up π₯paramsβ parameters for the requested KMS credentials. currently empty. (yes, empty. it's minimalism π )outβ the outputbson_twhere you write the new KMS providers. important: when it gets passed to the callback, it already points to an empty BSON document that you absolutely must populate. don't leave it empty, bestie, that's not the assignment πerrorβ an output parameter for flagging any errors that might pop off while generating the KMS credentials.
Return value
Must return true on success, false on failure. that's it, that's the rule π§
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
okay and the cute little sign-off at the very end of the page: this is libmongoc 2.5.6, dated Oct 09 β and yes the original footer line is a little mangled (Oct 09, 202β¦), so we're just passing along the facts we got, fr fr. go forth and credential-provide, bestie. πβ¨π
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms