Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 2 additions & 4 deletions .github/actions/run-integration-tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Run Integration Tests
description: Runs integration tests against a specific database type
description: Runs integration tests against a specific database type (sqlite, postgres, or redis)
inputs:
database-type:
description: 'Database type to test against (sqlite or postgres)'
description: 'Database type to test against (sqlite, postgres, or redis)'
required: true
type: string
coverage-enabled:
description: 'Whether to enable coverage collection'
required: false
type: boolean
default: false

runs:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
database: [sqlite, postgres]
database: [sqlite, postgres, redis]
fail-fast: false
services:
postgres:
Expand All @@ -490,6 +490,15 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: 📥 Checkout Code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
Expand Down
2 changes: 2 additions & 0 deletions .vale/styles/config/vocabularies/vocab/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ templated
=======
JWTs
>>>>>>> 5337c408 (Add initial quickstarts and guides to Thunder)
ACL
ACLs
33 changes: 18 additions & 15 deletions backend/cmd/server/repository/conf/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,30 @@ tls:
database:
config:
type: "sqlite"
path: "repository/database/configdb.db"
options: "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)"
max_open_conns: 500
max_idle_conns: 100
conn_max_lifetime: 3600
sqlite:
path: "repository/database/configdb.db"
options: "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)"
max_open_conns: 500
max_idle_conns: 100
conn_max_lifetime: 3600

runtime:
type: "sqlite"
path: "repository/database/runtimedb.db"
options: "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)"
max_open_conns: 500
max_idle_conns: 100
conn_max_lifetime: 3600
sqlite:
path: "repository/database/runtimedb.db"
options: "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)"
max_open_conns: 500
max_idle_conns: 100
conn_max_lifetime: 3600

user:
type: "sqlite"
path: "repository/database/userdb.db"
options: "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)"
max_open_conns: 500
max_idle_conns: 100
conn_max_lifetime: 3600
sqlite:
path: "repository/database/userdb.db"
options: "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)"
max_open_conns: 500
max_idle_conns: 100
conn_max_lifetime: 3600

crypto:
encryption:
Expand Down
61 changes: 28 additions & 33 deletions backend/cmd/server/repository/resources/conf/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,40 @@
"database": {
"config": {
"type": "sqlite",
"hostname": "",
"port": 0,
"name": "",
"username": "",
"password": "",
"sslmode": "",
"path": "repository/database/configdb.db",
"options": "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)",
"max_open_conns": 500,
"max_idle_conns": 100,
"conn_max_lifetime": 3600
"sqlite": {
"path": "repository/database/configdb.db",
"options": "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)",
"max_open_conns": 500,
"max_idle_conns": 100,
"conn_max_lifetime": 3600
}
},
"runtime": {
"type": "sqlite",
"hostname": "",
"port": 0,
"name": "",
"username": "",
"password": "",
"sslmode": "",
"path": "repository/database/runtimedb.db",
"options": "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)",
"max_open_conns": 500,
"max_idle_conns": 100,
"conn_max_lifetime": 3600
"sqlite": {
"path": "repository/database/runtimedb.db",
"options": "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)",
"max_open_conns": 500,
"max_idle_conns": 100,
"conn_max_lifetime": 3600
},
"redis": {
"address": "",
"username": "",
"password": "",
"db": 0,
"key_prefix": ""
}
},
"user": {
"type": "sqlite",
"hostname": "",
"port": 0,
"name": "",
"username": "",
"password": "",
"sslmode": "",
"path": "repository/database/userdb.db",
"options": "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)",
"max_open_conns": 500,
"max_idle_conns": 100,
"conn_max_lifetime": 3600
"sqlite": {
"path": "repository/database/userdb.db",
"options": "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)",
"max_open_conns": 500,
"max_idle_conns": 100,
"conn_max_lifetime": 3600
}
}
},
"cache": {
Expand Down
6 changes: 2 additions & 4 deletions backend/internal/application/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ import (
// process share the same SQLite instance instead of creating separate databases.
func newInMemoryDataSource() config.DataSource {
return config.DataSource{
Type: "sqlite",
Path: "file::memory:?cache=shared",
MaxOpenConns: 1,
MaxIdleConns: 1,
Type: "sqlite",
SQLite: config.SQLiteDataSource{Path: "file::memory:?cache=shared", MaxOpenConns: 1, MaxIdleConns: 1},
}
}

Expand Down
15 changes: 12 additions & 3 deletions backend/internal/attributecache/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@

package attributecache

// Initialize initializes the attribute cache service with a SQL store
// and returns an instance of AttributeCacheServiceInterface.
import (
"github.com/asgardeo/thunder/internal/system/config"
"github.com/asgardeo/thunder/internal/system/database/provider"
)

// Initialize initializes the attribute cache service and returns an instance of AttributeCacheServiceInterface.
func Initialize() AttributeCacheServiceInterface {
store := newAttributeCacheStore()
var store attributeCacheStoreInterface
if config.GetThunderRuntime().Config.Database.Runtime.Type == provider.DataSourceTypeRedis {
store = newRedisAttributeCacheStore(provider.GetRedisProvider())
} else {
store = newAttributeCacheStore()
}
return newAttributeCacheService(store)
}
Loading
Loading