Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added event feeds to the baton SDK #92

Merged
merged 22 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ add-dep:
protogen:
buf generate

.PHONY: protofmt
protofmt:
buf format -w

.PHONY: test
test:
go test -v ./...
16 changes: 10 additions & 6 deletions internal/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import (
"sync"
"time"

grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/protobuf/proto"

connectorV2 "github.com/conductorone/baton-sdk/pb/c1/connector/v2"
connectorwrapperV1 "github.com/conductorone/baton-sdk/pb/c1/connector_wrapper/v1"
ratelimitV1 "github.com/conductorone/baton-sdk/pb/c1/ratelimit/v1"
Expand All @@ -19,12 +26,6 @@ import (
"github.com/conductorone/baton-sdk/pkg/types"
"github.com/conductorone/baton-sdk/pkg/ugrpc"
utls2 "github.com/conductorone/baton-sdk/pkg/utls"
grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
"github.com/grpc-ecosystem/go-grpc-middleware/logging/zap/ctxzap"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/protobuf/proto"
)

const listenerFdEnv = "BATON_CONNECTOR_SERVICE_LISTENER_FD"
Expand All @@ -41,6 +42,7 @@ type connectorClient struct {
connectorV2.ResourceManagerServiceClient
connectorV2.AccountManagerServiceClient
connectorV2.CredentialManagerServiceClient
connectorV2.EventServiceClient
}

var ErrConnectorNotImplemented = errors.New("client does not implement connector connectorV2")
Expand Down Expand Up @@ -139,6 +141,7 @@ func (cw *wrapper) Run(ctx context.Context, serverCfg *connectorwrapperV1.Server
connectorV2.RegisterResourcesServiceServer(server, cw.server)
connectorV2.RegisterResourceTypesServiceServer(server, cw.server)
connectorV2.RegisterAssetServiceServer(server, cw.server)
connectorV2.RegisterEventServiceServer(server, cw.server)

if cw.provisioningEnabled {
connectorV2.RegisterGrantManagerServiceServer(server, cw.server)
Expand Down Expand Up @@ -310,6 +313,7 @@ func (cw *wrapper) C(ctx context.Context) (types.ConnectorClient, error) {
ResourceManagerServiceClient: connectorV2.NewResourceManagerServiceClient(cw.conn),
AccountManagerServiceClient: connectorV2.NewAccountManagerServiceClient(cw.conn),
CredentialManagerServiceClient: connectorV2.NewCredentialManagerServiceClient(cw.conn),
EventServiceClient: connectorV2.NewEventServiceClient(cw.conn),
}

return cw.client, nil
Expand Down
6 changes: 3 additions & 3 deletions pb/c1/c1z/v1/diff.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions pb/c1/connector/v2/annotation_trait.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pb/c1/connector/v2/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pb/c1/connector/v2/connector.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading