apache / apache/arrow-adbc

format: Allow credentials to be supplied via a callback

Open
#4,231 9 comments 1 reaction 0 assignees View on GitHub
Type: enhancement
Dominant language
C#
Stars
627
Forks
217
Avg merge
17h
Merged PRs (30d)
57

Description

### What feature or improvement would you like to see?

Credentials are increasingly of limited duration, which introduces the possibility of them expiring in the middle of an operation. While one approach is to give the driver enough information so that it can refresh the credential on its own, there are systems where such delegation is difficult or impossible. For these cases, it would be nice for the driver to call back into the host to ask for an updated credential.

One possible approach:
```
/// \brief A credential handler function.
///
/// The handler must not call any ADBC functions other than the
/// ConnectionSetOption functions and releasing the warning.
///
/// There are no requirements on ordering or concurrency of calls to the
/// handler; the driver may call the handler at any time from any thread,
/// including calling the handler concurrently.
///
/// \param[in] details Additional details about the credential required.
/// The application is responsible for releasing the details, but the
/// pointer itself will not be valid after the handler returns.
/// \param[in] user_data The user_data pointer.
typedef void (*AdbcCredentialHandler)(const struct AdbcError* details, void* user_data);

AdbcStatusCode (*ConnectionSetCredentialHandler)(struct AdbcConnection*,
AdbcCredentialHandler handler,
void* user_data, struct AdbcError*);```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.