Skip to content

Commit a78e72f

Browse files
Runtime DB in redis
1 parent 51295d4 commit a78e72f

File tree

34 files changed

+4744
-47
lines changed

34 files changed

+4744
-47
lines changed

.github/actions/run-integration-tests/action.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Run Integration Tests
2-
description: Runs integration tests against a specific database type
2+
description: Runs integration tests against a specific database type (sqlite, postgres, or redis)
33
inputs:
44
database-type:
5-
description: 'Database type to test against (sqlite or postgres)'
5+
description: 'Database type to test against (sqlite, postgres, or redis)'
66
required: true
7-
type: string
87
coverage-enabled:
98
description: 'Whether to enable coverage collection'
109
required: false
11-
type: boolean
1210
default: false
1311

1412
runs:

.github/workflows/pr-builder.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ jobs:
474474
runs-on: ubuntu-latest
475475
strategy:
476476
matrix:
477-
database: [sqlite, postgres]
477+
database: [sqlite, postgres, redis]
478478
fail-fast: false
479479
services:
480480
postgres:
@@ -490,6 +490,15 @@ jobs:
490490
--health-interval 10s
491491
--health-timeout 5s
492492
--health-retries 5
493+
redis:
494+
image: redis:latest
495+
ports:
496+
- 6379:6379
497+
options: >-
498+
--health-cmd "redis-cli ping"
499+
--health-interval 10s
500+
--health-timeout 5s
501+
--health-retries 5
493502
steps:
494503
- name: 📥 Checkout Code
495504
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

.vale/styles/config/vocabularies/vocab/accept.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ templated
5050
=======
5151
JWTs
5252
>>>>>>> 5337c408 (Add initial quickstarts and guides to Thunder)
53+
ACL
54+
ACLs

backend/cmd/server/repository/resources/conf/default.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343
"options": "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)",
4444
"max_open_conns": 500,
4545
"max_idle_conns": 100,
46-
"conn_max_lifetime": 3600
46+
"conn_max_lifetime": 3600,
47+
"address": "",
48+
"db": 0,
49+
"key_prefix": ""
4750
},
4851
"user": {
4952
"type": "sqlite",

backend/internal/attributecache/init.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,18 @@
1818

1919
package attributecache
2020

21-
// Initialize initializes the attribute cache service with a SQL store
22-
// and returns an instance of AttributeCacheServiceInterface.
21+
import (
22+
"github.com/asgardeo/thunder/internal/system/config"
23+
"github.com/asgardeo/thunder/internal/system/database/provider"
24+
)
25+
26+
// Initialize initializes the attribute cache service and returns an instance of AttributeCacheServiceInterface.
2327
func Initialize() AttributeCacheServiceInterface {
24-
store := newAttributeCacheStore()
28+
var store attributeCacheStoreInterface
29+
if config.GetThunderRuntime().Config.Database.Runtime.Type == provider.DataSourceTypeRedis {
30+
store = newRedisAttributeCacheStore(provider.GetRedisProvider())
31+
} else {
32+
store = newAttributeCacheStore()
33+
}
2534
return newAttributeCacheService(store)
2635
}

0 commit comments

Comments
 (0)