9
9
KubernetesAuthConfig ,
10
10
NoAuthConfig ,
11
11
OidcAuthConfig ,
12
+ OidcClientAuthConfig ,
12
13
)
13
14
from feast .repo_config import FeastConfigError , load_repo_config
14
15
@@ -213,7 +214,6 @@ def test_auth_config():
213
214
client_secret: test_client_secret
214
215
username: test_user_name
215
216
password: test_password
216
- realm: master
217
217
auth_discovery_url: http://localhost:8080/realms/master/.well-known/openid-configuration
218
218
registry: "registry.db"
219
219
provider: local
@@ -235,7 +235,6 @@ def test_auth_config():
235
235
client_secret: test_client_secret
236
236
username: test_user_name
237
237
password: test_password
238
- realm: master
239
238
auth_discovery_url: http://localhost:8080/realms/master/.well-known/openid-configuration
240
239
registry: "registry.db"
241
240
provider: local
@@ -247,7 +246,32 @@ def test_auth_config():
247
246
expect_error = "invalid authentication type=not_valid_auth_type" ,
248
247
)
249
248
250
- oidc_repo_config = _test_config (
249
+ oidc_server_repo_config = _test_config (
250
+ dedent (
251
+ """
252
+ project: foo
253
+ auth:
254
+ type: oidc
255
+ client_id: test_client_id
256
+ auth_discovery_url: http://localhost:8080/realms/master/.well-known/openid-configuration
257
+ registry: "registry.db"
258
+ provider: local
259
+ online_store:
260
+ path: foo
261
+ entity_key_serialization_version: 2
262
+ """
263
+ ),
264
+ expect_error = None ,
265
+ )
266
+ assert oidc_server_repo_config .auth ["type" ] == AuthType .OIDC .value
267
+ assert isinstance (oidc_server_repo_config .auth_config , OidcAuthConfig )
268
+ assert oidc_server_repo_config .auth_config .client_id == "test_client_id"
269
+ assert (
270
+ oidc_server_repo_config .auth_config .auth_discovery_url
271
+ == "http://localhost:8080/realms/master/.well-known/openid-configuration"
272
+ )
273
+
274
+ oidc_client_repo_config = _test_config (
251
275
dedent (
252
276
"""
253
277
project: foo
@@ -257,7 +281,6 @@ def test_auth_config():
257
281
client_secret: test_client_secret
258
282
username: test_user_name
259
283
password: test_password
260
- realm: master
261
284
auth_discovery_url: http://localhost:8080/realms/master/.well-known/openid-configuration
262
285
registry: "registry.db"
263
286
provider: local
@@ -268,15 +291,14 @@ def test_auth_config():
268
291
),
269
292
expect_error = None ,
270
293
)
271
- assert oidc_repo_config .auth ["type" ] == AuthType .OIDC .value
272
- assert isinstance (oidc_repo_config .auth_config , OidcAuthConfig )
273
- assert oidc_repo_config .auth_config .client_id == "test_client_id"
274
- assert oidc_repo_config .auth_config .client_secret == "test_client_secret"
275
- assert oidc_repo_config .auth_config .username == "test_user_name"
276
- assert oidc_repo_config .auth_config .password == "test_password"
277
- assert oidc_repo_config .auth_config .realm == "master"
294
+ assert oidc_client_repo_config .auth ["type" ] == AuthType .OIDC .value
295
+ assert isinstance (oidc_client_repo_config .auth_config , OidcClientAuthConfig )
296
+ assert oidc_client_repo_config .auth_config .client_id == "test_client_id"
297
+ assert oidc_client_repo_config .auth_config .client_secret == "test_client_secret"
298
+ assert oidc_client_repo_config .auth_config .username == "test_user_name"
299
+ assert oidc_client_repo_config .auth_config .password == "test_password"
278
300
assert (
279
- oidc_repo_config .auth_config .auth_discovery_url
301
+ oidc_client_repo_config .auth_config .auth_discovery_url
280
302
== "http://localhost:8080/realms/master/.well-known/openid-configuration"
281
303
)
282
304
0 commit comments