Skip to content

Commit 7da6992

Browse files
Moving stateless and encryption_key as part of the db_uri
1 parent dc9f684 commit 7da6992

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Diff for: example/plugins/frontends/openid_connect_frontend.yaml.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: OIDC
33
config:
44
signing_key_path: frontend.key
55
signing_key_id: frontend.key1
6-
db_uri: mongodb://db.example.com # optional: supports MongoDB, radis (e.g: redis://example/0), and stateless
7-
# (e.g: stateless://user:encryptionkey?alg=aes256) storages. It will default to in-memory storage if not specified.
6+
db_uri: mongodb://db.example.com # optional: supports MongoDB, radis (e.g: redis://example/0), and stateless (e.g:
7+
# stateless://user:encryptionkey@localhost?alg=aes256) storages. It will default to in-memory storage if not specified.
88
client_db_path: /path/to/your/cdb.json
99
sub_hash_salt: randomSALTvalue # if not specified, it is randomly generated on every startup
1010
provider:

Diff for: src/satosa/frontends/openid_connect.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ def _create_provider(self, endpoint_baseurl):
8787
cdb = json.loads(f.read())
8888
else:
8989
cdb = {}
90-
self.user_db = MongoWrapper(db_uri, "satosa", "authz_codes") if db_uri else {}
90+
91+
self.user_db = MongoWrapper(db_uri, "satosa", "authz_codes") if db_uri and not StorageBase.type(
92+
db_uri) == "stateless" else {}
93+
9194
self.provider = Provider(
9295
self.signing_key,
9396
capabilities,

Diff for: tests/flows/test_oidc-saml.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ def oidc_stateless_frontend_config(signing_key_path, client_db_path):
7777
"issuer": "https://proxy-op.example.com",
7878
"signing_key_path": signing_key_path,
7979
"client_db_path": client_db_path,
80-
"encryption_key": "abc123",
80+
"db_uri": "stateless://user:abc123@localhost",
8181
"provider": {
82-
"stateless": True,
8382
"response_types_supported": ["id_token", "code"]
8483
}
8584
}

0 commit comments

Comments
 (0)