MCPcopy Create free account
hub / github.com/apache/arrow / IsValid

Method IsValid

c_glib/arrow-flight-glib/server.cpp:756–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754 }
755
756 arrow::Status
757 IsValid(const arrow::flight::ServerCallContext &context,
758 const std::string &token,
759 std::string *peer_identity) override
760 {
761 auto klass = GAFLIGHT_SERVER_CUSTOM_AUTH_HANDLER_GET_CLASS(handler_);
762 auto gacontext = gaflight_server_call_context_new_raw(&context);
763 auto gtoken = g_bytes_new_static(token.data(), token.size());
764 GError *error = nullptr;
765 auto gpeer_identity = klass->is_valid(handler_, gacontext, gtoken, &error);
766 g_bytes_unref(gtoken);
767 g_object_unref(gacontext);
768 if (gpeer_identity) {
769 gsize gpeer_identity_size;
770 auto gpeer_identity_data = g_bytes_get_data(gpeer_identity, &gpeer_identity_size);
771 *peer_identity = std::string(static_cast<const char *>(gpeer_identity_data),
772 gpeer_identity_size);
773 g_bytes_unref(gpeer_identity);
774 }
775 if (error) {
776 return garrow_error_to_status(error,
777 arrow::StatusCode::Invalid,
778 "[flight-server-custom-auth-handler]"
779 "[is-valid]");
780 } else {
781 return arrow::Status::OK();
782 }
783 }
784
785 private:
786 GAFlightServerCustomAuthHandler *handler_;

Calls 6

garrow_error_to_statusFunction · 0.85
OKFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
is_validMethod · 0.45

Tested by

no test coverage detected