From 3e7bd3b70febcf545b7698098853babc5afa7598 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Fri, 9 Aug 2024 16:32:04 +0200 Subject: [PATCH] fix: set correct max cost for oauth2 introspection authn handler --- .schema/config.schema.json | 4 ++-- driver/configuration/provider_koanf_public_test.go | 2 +- spec/config.schema.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.schema/config.schema.json b/.schema/config.schema.json index 4dcd8a8032..5e99f70fe7 100644 --- a/.schema/config.schema.json +++ b/.schema/config.schema.json @@ -888,9 +888,9 @@ }, "max_cost": { "type": "integer", - "default": 1000, + "default": 100000000, "title": "Max Cost", - "description": "Max number of tokens to cache." + "description": "Max cost to cache." } } } diff --git a/driver/configuration/provider_koanf_public_test.go b/driver/configuration/provider_koanf_public_test.go index 50cbf91309..0af06c129d 100644 --- a/driver/configuration/provider_koanf_public_test.go +++ b/driver/configuration/provider_koanf_public_test.go @@ -48,7 +48,7 @@ func TestPipelineConfig(t *testing.T) { p := setup(t) require.NoError(t, p.PipelineConfig("authenticators", "oauth2_introspection", nil, &res)) - assert.JSONEq(t, `{"cache":{"enabled":false, "max_cost":1000},"introspection_url":"https://override/path","preserve_host":false,"pre_authorization":{"client_id":"some_id","client_secret":"some_secret","enabled":true,"audience":"some_audience","scope":["foo","bar"],"token_url":"https://my-website.com/oauth2/token"},"retry":{"max_delay":"100ms", "give_up_after":"1s"},"scope_strategy":"exact"}`, string(res), "%s", res) + assert.JSONEq(t, `{"cache":{"enabled":false, "max_cost":100000000},"introspection_url":"https://override/path","preserve_host":false,"pre_authorization":{"client_id":"some_id","client_secret":"some_secret","enabled":true,"audience":"some_audience","scope":["foo","bar"],"token_url":"https://my-website.com/oauth2/token"},"retry":{"max_delay":"100ms", "give_up_after":"1s"},"scope_strategy":"exact"}`, string(res), "%s", res) }) t.Run("case=should setup", func(t *testing.T) { diff --git a/spec/config.schema.json b/spec/config.schema.json index ce6ef286d5..bb2bef34fe 100644 --- a/spec/config.schema.json +++ b/spec/config.schema.json @@ -904,9 +904,9 @@ }, "max_cost": { "type": "integer", - "default": 1000, + "default": 100000000, "title": "Max Cost", - "description": "Max number of tokens to cache." + "description": "Max cost to cache." } } }