diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8552850..ab8a441 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,25 +1,64 @@ { - "name": "Go", - "image": "mcr.microsoft.com/devcontainers/go:1.25-bookworm", - "runArgs": [ - "--add-host=host.docker.internal:host-gateway" - ], - "customizations": { - "vscode": { - "extensions": [ - "streetsidesoftware.code-spell-checker", - "golang.go", - "DavidAnson.vscode-markdownlint" - ] - } - }, - "mounts": [ - { - "source": "${localEnv:HOME}/.ssh", - "target": "/home/vscode/.ssh", - "type": "bind" - } - ], - "remoteUser": "vscode", - "postCreateCommand": "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest" -} \ No newline at end of file + "name": "Go", + "image": "mcr.microsoft.com/devcontainers/go:1.25-bookworm", + "features": { + "ghcr.io/devcontainers-extra/features/mise:1": {}, + "ghcr.io/roul/devcontainer-features/mise-golang:1": { + "version": "1.25.3" + } + }, + "runArgs": ["--add-host=host.docker.internal:host-gateway"], + "customizations": { + "vscode": { + "extensions": [ + "DavidAnson.vscode-markdownlint", + "golang.go", + "hverlin.mise-vscode", + "streetsidesoftware.code-spell-checker", + "EditorConfig.EditorConfig", + "tamasfe.even-better-toml", + "timonwong.shellcheck", + "/workspaces/magic/.devcontainer/extensions/pkl-vscode-0.21.0.vsix" + ], + "settings": { + "go.testFlags": ["-v", "-race"], + "go.coverOnSingleTest": true, + "go.coverOnSingleTestFile": true, + "go.coverOnTestPackage": true, + "go.lintTool": "golangci-lint", + "go.lintOnSave": "package", + "[go]": { + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + } + }, + "gopls": { + "usePlaceholders": false, + "staticcheck": true, + "formatting.gofumpt": true + }, + "editor.rulers": [120, 180] + } + } + }, + "mounts": [ + { + "source": "${localEnv:HOME}/.ssh", + "target": "/home/vscode/.ssh", + "type": "bind" + }, + { + "source": "mise-data-volume", + "target": "/mnt/mise-data", + "type": "volume" + } + ], + "containerEnv": { + "MISE_DATA_DIR": "/mnt/mise-data" + }, + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/mnt/mise-data/shims" + }, + "remoteUser": "vscode", + "postCreateCommand": "bash .devcontainer/post-create.sh" +} diff --git a/.devcontainer/extensions/pkl-vscode-0.21.0.vsix b/.devcontainer/extensions/pkl-vscode-0.21.0.vsix new file mode 100755 index 0000000..676f7f2 Binary files /dev/null and b/.devcontainer/extensions/pkl-vscode-0.21.0.vsix differ diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100755 index 0000000..7ea2735 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,15 @@ +#!/bin/env bash + +set -e + +sudo chown -R vscode:vscode /mnt/mise-data +curl -fsSL https://deb.nodesource.com/setup_25.x |\ + DEBIAN_FRONTEND=noninteractive sudo -E bash - +sudo apt install -y -qq \ + nodejs \ + npm \ + python3.11-venv +node -v +npm -v +mise install -y +hk install diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 04ae14a..7a2a0ee 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,7 +1,8 @@ +--- name: Bug Report description: Create a detailed bug report to help ups improve magic -title: 'issue: ' -labels: ['bug', 'triage'] +title: "issue: " +labels: ["bug", "triage"] assignees: [] body: - type: markdown @@ -60,7 +61,7 @@ body: attributes: label: Logs & Screenshots description: Include relevant logs, errors, screenshots, magic dust or anything that might help us identify the bug. - placeholder: 'Attach logs from the browser console or error messages.' + placeholder: "Attach logs from the browser console or error messages." validations: required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3ba13e0..bd9dfe4 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,2 @@ +--- blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 01b70b3..bdc385e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -1,7 +1,8 @@ +--- name: Feature Request description: Suggest something new -title: 'feat: ' -labels: ['triage'] +title: "feat: " +labels: ["triage"] body: - type: markdown attributes: @@ -41,4 +42,3 @@ body: attributes: label: Additional Context description: Add any other context or screenshots about the feature request here. - diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..1d3a71b --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,22 @@ +version: "2" +linters: + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofumpt + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/.goreleaser.yaml b/.goreleaser.yaml index cbed619..8678972 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,3 @@ +--- builds: - skip: true - diff --git a/.mise.toml b/.mise.toml new file mode 100644 index 0000000..8bb3662 --- /dev/null +++ b/.mise.toml @@ -0,0 +1,31 @@ +[tools] +"go:github.com/securego/gosec/v2/cmd/gosec" = "2.23.0" +"go:golang.org/x/tools/cmd/goimports" = "0.42.0" +"go:golang.org/x/vuln/cmd/govulncheck" = "1.1.4" +"go:mvdan.cc/gofumpt" = "0.9.2" +cspell = "9.6.4" +golang = "1.25.3" +golangci-lint = "2.10.1" +goreleaser = "2.13.3" +hk = "1.36.0" +java = 'corretto-25.0.2.10.1' +npm = "9.8.0" +pipx = "1.8.0" +pkl = "0.30.2" +shellcheck = "0.11.0" +yamllint = "1.38.0" +yq = "4.30.8" +zizmor = "1.22.0" + +[env] +GOLANGCI_LINT_TIMEOUT = "5m" + +[tasks.test] +env = {TEST_FLAGS = "-v -cover"} +run = "go test ./... ${TEST_FLAGS}" + +[tasks.build] +run = "go build ./..." + +[tasks.clean] +run = "go clean ./..." diff --git a/.vscode/launch.json b/.vscode/launch.json index 6deb9a6..d428a1f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,4 +12,4 @@ "program": "main.go" } ] -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 5f7cc40..673472e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,4 +6,4 @@ "tink" ], "go.diagnostic.vulncheck": "Imports" -} \ No newline at end of file +} diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..0c01e2b --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,3 @@ +--- +rules: + line-length: disable diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c00f1c..d99649d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,4 +8,4 @@ Before submitting major changes, here are a few guidelines to follow: 2. Open an [issue](https://github.com/tink3rlabs/magic/issues) first, to discuss a new feature or enhancement. 3. Write tests, and make sure the test suite passes locally and on CI. 4. Open a pull request, and reference the relevant issue(s). -5. After receiving feedback, [squash](https://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) your commits and add a [great commit message](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/). \ No newline at end of file +5. After receiving feedback, [squash](https://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) your commits and add a [great commit message](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/). diff --git a/LICENSE b/LICENSE index f8be4a4..c592b95 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/Makefile b/Makefile deleted file mode 100644 index f4d3735..0000000 --- a/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -.PHONY: lint test build clean fmt vet help - -# Default target -.DEFAULT_GOAL := help - -# Variables -GOLANGCI_LINT_TIMEOUT := 5m -TEST_FLAGS := -v -cover - -help: ## Show this help message - @echo 'Usage: make [target]' - @echo '' - @echo 'Available targets:' - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST) - -lint: ## Run golangci-lint - @echo "Running golangci-lint..." - golangci-lint run --timeout=$(GOLANGCI_LINT_TIMEOUT) - -test: ## Run tests with coverage - @echo "Running tests..." - go test $(TEST_FLAGS) ./... - -build: ## Build the project - @echo "Building..." - go build ./... - -fmt: ## Format code - @echo "Formatting code..." - go fmt ./... - -vet: ## Run go vet - @echo "Running go vet..." - go vet ./... - -clean: ## Clean build artifacts - @echo "Cleaning..." - go clean ./... - -ci: lint test ## Run CI checks (lint + test) - -all: fmt vet lint test build ## Run all checks and build diff --git a/hk.pkl b/hk.pkl new file mode 100644 index 0000000..7314545 --- /dev/null +++ b/hk.pkl @@ -0,0 +1,56 @@ +amends "package://github.com/jdx/hk/releases/download/v1.36.0/hk@1.36.0#/Config.pkl" +import "package://github.com/jdx/hk/releases/download/v1.36.0/hk@1.36.0#/Builtins.pkl" + +local linters = new Mapping { + ["shellcheck"] = Builtins.shellcheck + ["golangci-lint"] = (Builtins.golangci_lint) { + // Run on the whole project instead of individual files + check = "golangci-lint run --fix=false ./..." + fix = "golangci-lint run --fix ./..." + // Disable batching since we aren't passing specific files anymore + batch = false + } + ["yamllint"] = Builtins.yamllint + ["mixed-line-ending"] = Builtins.mixed_line_ending + ["end-of-line-fixer"] = Builtins.newlines + // ["go-sec"] = (Builtins.go_sec) { + // // Run on the whole project instead of individual files + // check = "gosec ./..." + // // Disable batching since we aren't passing specific files anymore + // batch = false + // } + // ["go-vet"] = (Builtins.go_vet) { + // // Run on the whole project instead of individual files + // check = "go vet ./..." + // // Disable batching since we aren't passing specific files anymore + // batch = false + // } + // ["go-vuln-check"] = (Builtins.go_vuln_check) { + // // Run on the whole project instead of individual files + // check = "govulncheck ./..." + // // Disable batching since we aren't passing specific files anymore + // batch = false + // } + // ["zizmor"] = Builtins.zizmor # Lint Github Actions workflows + + // Or define custom steps: + // ["custom"] { + // glob = "**/*.py" + // check = "mypy {{ files }}" + // } +} + +hooks { + ["pre-commit"] { + fix = true + stash = "git" + steps = linters + } + ["fix"] { + fix = true + steps = linters + } + ["check"] { + steps = linters + } +} diff --git a/leadership/leadership.go b/leadership/leadership.go index e252c80..dbf8e97 100644 --- a/leadership/leadership.go +++ b/leadership/leadership.go @@ -18,11 +18,15 @@ import ( "github.com/tink3rlabs/magic/storage" ) -var leaderElectionLock = &sync.Mutex{} -var leaderElectionInstance *LeaderElection +var ( + leaderElectionLock = &sync.Mutex{} + leaderElectionInstance *LeaderElection +) -const RESULT_ELECTED = "elected" -const DEFAULT_HEARTBEAT = 60 * time.Second +const ( + RESULT_ELECTED = "elected" + DEFAULT_HEARTBEAT = 60 * time.Second +) // LeaderElection provides methods for electing a leader out of eligible cluster members type LeaderElection struct { @@ -61,7 +65,7 @@ func NewLeaderElection(props LeaderElectionProps) *LeaderElection { if heartbeatInterval == 0 { heartbeatInterval = DEFAULT_HEARTBEAT } - var tableName = "members" + tableName := "members" if (props.AdditionalProps["table_name"] != "") && (props.AdditionalProps["table_name"] != nil) { tableName = props.AdditionalProps["table_name"].(string) } @@ -122,7 +126,8 @@ func (l *LeaderElection) createLeadershipTable() error { } else { waiter := dynamodb.NewTableExistsWaiter(a.DB) err = waiter.Wait(context.TODO(), &dynamodb.DescribeTableInput{ - TableName: aws.String(l.tableName)}, 1*time.Minute) + TableName: aws.String(l.tableName), + }, 1*time.Minute) if err != nil { return err } else { @@ -227,7 +232,6 @@ func (l *LeaderElection) monitorLeader() { } else { slog.Info("Starting re-election due to leader inactivity", slog.String("leader_id", l.Leader.Id), slog.Duration("inactivity_duration", diff)) err = l.electLeader(true) - if err != nil { slog.Error("failed to elect new leader", slog.Any("error", err)) } diff --git a/logger/logger.go b/logger/logger.go index 47ac00f..55647f9 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -27,7 +27,6 @@ func MapLogLevel(levelStr string) slog.Level { } func Init(config *Config) { - var handler slog.Handler // Choose the handler based on the format and log level from the config @@ -41,12 +40,11 @@ func Init(config *Config) { // logger.LogLevel = logger.LogLevel(config.Level) logger := slog.New(handler) - //Set the global default logger this is the logger that will be used when slog.() functions are used + // Set the global default logger this is the logger that will be used when slog.() functions are used slog.SetDefault(logger) - } -// slog doesn't have fatal, hence creating the function +// Fatal augments slog that missing the function and exits the program with a non-zero status code func Fatal(msg string, args ...any) { slog.Error(msg, args...) os.Exit(1) diff --git a/middlewares/auth.go b/middlewares/auth.go index 4c96ce7..9eb2f37 100644 --- a/middlewares/auth.go +++ b/middlewares/auth.go @@ -17,12 +17,14 @@ import ( // internal context key types -type contextKeyTenant struct{} -type contextKeyUserId struct{} -type contextKeyUserEmail struct{} -type contextKeyRoles struct{} -type contextKeyGroups struct{} -type contextKeyValidatedClaims struct{} +type ( + contextKeyTenant struct{} + contextKeyUserId struct{} + contextKeyUserEmail struct{} + contextKeyRoles struct{} + contextKeyGroups struct{} + contextKeyValidatedClaims struct{} +) // ClaimsConfig allows you to configure claim keys. These must match the keys used by your IDP type ClaimsConfig struct { diff --git a/middlewares/validator.go b/middlewares/validator.go index 8e2f531..a75f819 100644 --- a/middlewares/validator.go +++ b/middlewares/validator.go @@ -31,7 +31,6 @@ func JSONSchemaValidator(schema string, data interface{}) (ValidationResult, err documentLoader := gojsonschema.NewGoLoader(data) result, err := gojsonschema.Validate(schemaLoader, documentLoader) - if err != nil { slog.Error("gojsonschema validation function failed", slog.Any("error", err)) return ValidationResult{}, err diff --git a/pubsub/publlisher.go b/pubsub/publlisher.go index db6a294..9a94f82 100644 --- a/pubsub/publlisher.go +++ b/pubsub/publlisher.go @@ -12,8 +12,10 @@ const ( SNS PublisherType = "sns" ) -type PublisherType string -type PublisherFactory struct{} +type ( + PublisherType string + PublisherFactory struct{} +) func (s PublisherFactory) GetInstance(publisherType PublisherType, config any) (Publisher, error) { if config == nil { diff --git a/storage/cosmosdb.go b/storage/cosmosdb.go index 3474b6f..b29a4ab 100644 --- a/storage/cosmosdb.go +++ b/storage/cosmosdb.go @@ -27,8 +27,10 @@ type CosmosDBAdapter struct { databaseName string } -var cosmosDBAdapterLock = &sync.Mutex{} -var cosmosDBAdapterInstance *CosmosDBAdapter +var ( + cosmosDBAdapterLock = &sync.Mutex{} + cosmosDBAdapterInstance *CosmosDBAdapter +) func GetCosmosDBAdapterInstance(config map[string]string) *CosmosDBAdapter { if cosmosDBAdapterInstance == nil { diff --git a/storage/dynamodb.go b/storage/dynamodb.go index c7cbc33..cd15ce7 100644 --- a/storage/dynamodb.go +++ b/storage/dynamodb.go @@ -25,8 +25,10 @@ type DynamoDBAdapter struct { config map[string]string } -var dynamoDBAdapterLock = &sync.Mutex{} -var dynamoDBAdapterInstance *DynamoDBAdapter +var ( + dynamoDBAdapterLock = &sync.Mutex{} + dynamoDBAdapterInstance *DynamoDBAdapter +) func GetDynamoDBAdapterInstance(config map[string]string) *DynamoDBAdapter { if dynamoDBAdapterInstance == nil { @@ -99,12 +101,15 @@ func (s *DynamoDBAdapter) GetSchemaName() string { func (s *DynamoDBAdapter) CreateSchema() error { return fmt.Errorf("DynamoDB CreateSchema is not supported") } + func (s *DynamoDBAdapter) CreateMigrationTable() error { return fmt.Errorf("DynamoDB CreateMigrationTable is not supported") } + func (s *DynamoDBAdapter) UpdateMigrationTable(id int, name string, desc string) error { return fmt.Errorf("DynamoDB UpgradeMigrationTable is not supported") } + func (s *DynamoDBAdapter) GetLatestMigration() (int, error) { return -1, fmt.Errorf("DynamoDB GetLatestMigration is not supported") } @@ -119,7 +124,6 @@ func (s *DynamoDBAdapter) Create(item any, params ...map[string]any) error { TableName: aws.String(s.getTableName(item)), Item: i, }) - if err != nil { return fmt.Errorf("failed to create or update item: %v", err) } @@ -137,7 +141,6 @@ func (s *DynamoDBAdapter) Get(dest any, filter map[string]any, params ...map[str TableName: aws.String(s.getTableName(dest)), Key: key, }) - if err != nil { return fmt.Errorf("failed to get item, %v", err) } @@ -168,7 +171,6 @@ func (s *DynamoDBAdapter) Delete(item any, filter map[string]any, params ...map[ TableName: aws.String(s.getTableName(item)), Key: key, }) - if err != nil { return fmt.Errorf("failed to delete item, %v", err) } diff --git a/storage/memory.go b/storage/memory.go index 2f9ae07..5f19aa7 100644 --- a/storage/memory.go +++ b/storage/memory.go @@ -56,16 +56,18 @@ func (m *MemoryAdapter) CreateSchema() error { func (m *MemoryAdapter) CreateMigrationTable() error { return m.DB.CreateMigrationTable() } + func (m *MemoryAdapter) UpdateMigrationTable(id int, name string, desc string) error { return m.DB.UpdateMigrationTable(id, name, desc) } + func (m *MemoryAdapter) GetLatestMigration() (int, error) { statement := "SELECT max(id) from migrations" var latestMigration int result := m.DB.DB.Raw(statement).Scan(&latestMigration) if result.Error != nil { - //either a real issue or there are no migrations yet check if we can query the migration table + // either a real issue or there are no migrations yet check if we can query the migration table var count int statement = "SELECT count(*) from migrations" countResult := m.DB.DB.Raw(statement).Scan(&count) diff --git a/storage/migration.go b/storage/migration.go index 524c4b1..a2a136b 100644 --- a/storage/migration.go +++ b/storage/migration.go @@ -81,7 +81,7 @@ func (m *DatabaseMigration) runMigrations(migrations map[string]MigrationFile) { logger.Fatal("failed to get latest migration", slog.Any("error", err)) } - //iterating over a map is randomized so we need to make sure we use the correct order of migrations + // iterating over a map is randomized so we need to make sure we use the correct order of migrations keys := make([]string, 0, len(migrations)) for k := range migrations { keys = append(keys, k) diff --git a/storage/sql.go b/storage/sql.go index 8313e11..26cf2c1 100644 --- a/storage/sql.go +++ b/storage/sql.go @@ -31,8 +31,10 @@ type SQLAdapter struct { provider StorageProviders } -var sqlAdapterLock = &sync.Mutex{} -var sqlAdapterInstance *SQLAdapter +var ( + sqlAdapterLock = &sync.Mutex{} + sqlAdapterInstance *SQLAdapter +) func GetSQLAdapterInstance(config map[string]string) *SQLAdapter { if sqlAdapterInstance == nil { @@ -138,7 +140,6 @@ func (s *SQLAdapter) CreateMigrationTable() error { statement = "CREATE TABLE IF NOT EXISTS migrations (id INTEGER PRIMARY KEY, name TEXT, description TEXT, timestamp INTEGER)" } return s.Execute(statement) - } func (s *SQLAdapter) UpdateMigrationTable(id int, name string, desc string) error { @@ -150,7 +151,6 @@ func (s *SQLAdapter) UpdateMigrationTable(id int, name string, desc string) erro statement = fmt.Sprintf(`INSERT INTO %s.migrations VALUES(%v, '%v', '%v', %v)`, s.GetSchemaName(), id, name, desc, time.Now().UnixMilli()) } return s.Execute(statement) - } func (s *SQLAdapter) GetLatestMigration() (int, error) { @@ -168,7 +168,7 @@ func (s *SQLAdapter) GetLatestMigration() (int, error) { statement = fmt.Sprintf("SELECT max(id) from %s", fromSource) result := s.DB.Raw(statement).Scan(&latestMigration) if result.Error != nil { - //either a real issue or there are no migrations yet check if we can query the migration table + // either a real issue or there are no migrations yet check if we can query the migration table var count int statement = fmt.Sprintf("SELECT count(*) from %s", fromSource) countResult := s.DB.Raw(statement).Scan(&count) diff --git a/storage/storage.go b/storage/storage.go index 2414a3f..160df08 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -5,8 +5,10 @@ import ( "errors" ) -var ConfigFs embed.FS -var ErrNotFound = errors.New("the requested resource was not found") +var ( + ConfigFs embed.FS + ErrNotFound = errors.New("the requested resource was not found") +) type StorageAdapter interface { Execute(statement string) error @@ -28,9 +30,11 @@ type StorageAdapter interface { Query(dest any, statement string, limit int, cursor string, params ...map[string]any) (string, error) } -type StorageAdapterType string -type StorageProviders string -type StorageAdapterFactory struct{} +type ( + StorageAdapterType string + StorageProviders string + StorageAdapterFactory struct{} +) const ( // CASSANDRA StorageAdapterType = "cassandra"