Giter Site home page Giter Site logo

discoos / eventstore-client-dart Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 1.02 MB

A gRPC Client for EventStoreDb

License: BSD 2-Clause "Simplified" License

Makefile 0.29% Dart 96.79% Shell 0.25% Kotlin 0.01% Swift 0.07% Objective-C 0.01% CMake 1.11% C++ 1.24% C 0.08% HTML 0.11% Dockerfile 0.04%

eventstore-client-dart's People

Contributors

kengu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

eventstore-client-dart's Issues

Add Monitoring API support

Implement EventStoreMonitoringClient from

service Monitoring {
	rpc Stats(StatsReq) returns (stream StatsResp);	
}

message StatsReq {
	bool use_metadata = 1;
	uint64 refresh_time_period_in_ms = 4;
}

message StatsResp {
	map<string, string> stats = 1;
}

HostCertificateNotFound exception on ES Cloud hosted instance

I am trying to connect to an ES cloud-based instance but I am getting the HostCertificateNotFound exception, however, I don't think this should happen as there would be nowhere for us to add the certificate to the host.

There are some differences in how we create our settings with C# compared to dart:

var settings = EventStoreClientSettings.Create(eventStoreConfiguration.Endpoint);
settings.DefaultCredentials = new UserCredentials(eventStoreConfiguration.Username, eventStoreConfiguration.Password);
var esClient = new EventStoreClient(settings);

I'm not sure if there is another bit of config I need with dart?!

Add User Management API support

Implement EventStoreUsersClient from

service Users {
	rpc Create (CreateReq) returns (CreateResp);
	rpc Update (UpdateReq) returns (UpdateResp);
	rpc Delete (DeleteReq) returns (DeleteResp);
	rpc Disable (DisableReq) returns (DisableResp);
	rpc Enable (EnableReq) returns (EnableResp);
	rpc Details (DetailsReq) returns (stream DetailsResp);
	rpc ChangePassword (ChangePasswordReq) returns (ChangePasswordResp);
	rpc ResetPassword (ResetPasswordReq) returns (ResetPasswordResp);
}

message CreateReq {
	Options options = 1;
	message Options {
		string login_name = 1;
		string password = 2;
		string full_name = 3;
		repeated string groups = 4;
	}
}

message CreateResp {

}

message UpdateReq {
	Options options = 1;
	message Options {
		string login_name = 1;
		string password = 2;
		string full_name = 3;
		repeated string groups = 4;
	}
}

message UpdateResp {

}

message DeleteReq {
	Options options = 1;
	message Options {
		string login_name = 1;
	}
}

message DeleteResp {

}

message EnableReq {
	Options options = 1;
	message Options {
		string login_name = 1;
	}
}

message EnableResp {

}

message DisableReq {
	Options options = 1;
	message Options {
		string login_name = 1;
	}
}

message DisableResp {
}

message DetailsReq {
	Options options = 1;
	message Options {
		string login_name = 1;
	}
}

message DetailsResp {
	UserDetails user_details = 1;
	message UserDetails {
		string login_name = 1;
		string full_name = 2;
		repeated string groups = 3;
		DateTime last_updated = 4;
		bool disabled = 5;

		message DateTime {
			int64 ticks_since_epoch = 1;
		}
	}
}

message ChangePasswordReq {
	Options options = 1;
	message Options {
		string login_name = 1;
		string current_password = 2;
		string new_password = 3;
	}
}

message ChangePasswordResp {
}

message ResetPasswordReq {
	Options options = 1;
	message Options {
		string login_name = 1;
		string new_password = 2;
	}
}

message ResetPasswordResp {
}

See EventStore.Client.UserManagement

Add example for secure connections using tls

Since the only documentation on how to configure secure connections with tls is the official on eventstore.org, support issues like #1 is expected. Adding an example of how you should configure tls with the public key used by eventstore will help new users to overcome the lack of documentation specific for Dart in the short term.

Unable to build web app with ES client package

It looks like there might be an issue with the compatibility with the latest dart packages. Getting the following errors when trying to build web app - MacOS is building and running fine:

'dart compile js' instead.
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/constants.d
art:7:13:
Error: The integer literal 9223372036854775807 can't be represented exactly in JavaScript.
const Max = 9223372036854775807;
            ^^^^^^^^^^^^^^^^^^^
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/client_base
.dart:205:25:
Error: The argument type 'X509Certificate/*1*/' can't be assigned to the parameter type
'X509Certificate/*2*/'.
 - 'X509Certificate/*1*/' is from 'dart:io'.
 - 'X509Certificate/*2*/' is from 'package:universal_io/src/io/secure_socket.dart'
 ('../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/secure_socket.d
 art').
                        cert,
                        ^
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/helpers.dar
t:133:53:
Error: The argument type 'X509Certificate/*1*/' can't be assigned to the parameter type
'X509Certificate/*2*/'.
 - 'X509Certificate/*1*/' is from 'package:universal_io/src/io/secure_socket.dart'
 ('../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/secure_socket.d
 art').
 - 'X509Certificate/*2*/' is from 'dart:io'.
        return channelCredentials.onBadCertificate!(cert, host);
                                                    ^
../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/eventstore_client-0.6.1/lib/src/core/helpers.dar
t:144:7:
Error: A value of type 'bool Function(X509Certificate, String, int)?' can't be assigned to a variable of
type 'bool Function(X509Certificate, String, int)' because 'bool Function(X509Certificate, String, int)?'
is nullable and 'bool Function(X509Certificate, String, int)' isn't.
 - 'X509Certificate' is from 'package:universal_io/src/io/secure_socket.dart'
 ('../../develop/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/secure_socket.d
 art').
    ).onBadCertificate;
      ^
Error: Compilation failed.

Add web platform support

As of version 0.6.1, the web platform is not supported because of an transitive dependency on dart:io (see evenstore_client score). It is needed on non-web platforms for configuring secure gRPC and http connections using TLS and certificates. On the web platform, the grpc and universial_io packages only support configuring secure or insecure connections using a boolean flag. We need to rewrite EventStoreClientBase in client_base.dart to accommodate the same difference in configurability. The grcp package serves as an example on how this could be done.

This enhancement will resolve bug #6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.