From 3f5fecf9f4b2aeb37dee1accd6b1bff901943a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Tue, 21 May 2024 08:14:16 +0000 Subject: [PATCH] fix: salesforce adapter entrypoint --- cmd/salesforcesource-adapter/main.go | 18 ++++++++++++++++++ docker-compose.yml | 2 -- internal/web/adapters/db.go | 8 ++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 cmd/salesforcesource-adapter/main.go diff --git a/cmd/salesforcesource-adapter/main.go b/cmd/salesforcesource-adapter/main.go new file mode 100644 index 00000000..b7bb623e --- /dev/null +++ b/cmd/salesforcesource-adapter/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "github.com/golang-jwt/jwt/v4" + + "knative.dev/eventing/pkg/adapter/v2" + + "github.com/zeiss/typhoon/pkg/sources/adapter/salesforcesource" +) + +func main() { + // JWT package marshals Audience as array even if there is only one element in it. This does not + // seem to be supported by Salesforce. By setting the following option to false we tell the imported + // library to marshal single item Audience array as a string. + jwt.MarshalSingleStringAsArray = false + + adapter.Main("salesforce", salesforcesource.NewEnvConfig, salesforcesource.NewAdapter) +} diff --git a/docker-compose.yml b/docker-compose.yml index b67bd4a8..7330a002 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: east1: image: docker.io/nats:2.10.9 diff --git a/internal/web/adapters/db.go b/internal/web/adapters/db.go index a83d0e46..cbfbb8c5 100644 --- a/internal/web/adapters/db.go +++ b/internal/web/adapters/db.go @@ -1,6 +1,7 @@ package adapters import ( + "github.com/zeiss/typhoon/internal/api/models" "github.com/zeiss/typhoon/internal/web/ports" authz "github.com/zeiss/fiber-authz" @@ -29,5 +30,12 @@ func (d *db) RunMigrations() error { &authz.UserRole{}, &adapters.Account{}, &adapters.Session{}, + &models.User{}, + &models.Operator{}, + &models.Account{}, + &models.System{}, + &models.Tag{}, + &models.Cluster{}, + &models.SigningKeyGroup{}, ) }