@@ -16,6 +16,7 @@ import "google/api/annotations.proto";
16
16
import "google/protobuf/duration.proto" ;
17
17
import "google/protobuf/struct.proto" ;
18
18
import "google/protobuf/wrappers.proto" ;
19
+ import "google/protobuf/empty.proto" ;
19
20
20
21
21
22
// This is the user-facing auth configuration. When processed by Gloo, certain configuration types (i.a. oauth, opa)
@@ -301,6 +302,34 @@ message HeaderConfiguration {
301
302
string id_token_header = 1 ;
302
303
}
303
304
305
+ // The json web key set (JWKS) (https://tools.ietf.org/html/rfc7517) is discovered at an interval
306
+ // from a remote source. When keys rotate in the remote source, there may be a delay in the
307
+ // local source picking up those new keys. Therefore, a user could execute a request with a token
308
+ // that has been signed by a key in the remote JWKS, but the local cache doesn't have the key yet.
309
+ // The request would fail because the key isn't contained in the local set. Since most IdPs publish key
310
+ // keys in their remote JWKS before they are used, this is not an issue most of the time.
311
+ // This policy lets you define the behavior for when a user has a token with a key
312
+ // not yet in the local cache.
313
+ message JwksOnDemandCacheRefreshPolicy {
314
+ oneof policy {
315
+ // Never refresh the local JWKS cache on demand. If a key is not in the cache, it is assumed to be malicious.
316
+ // This is the default policy since we assume that IdPs publish keys before they rotate them,
317
+ // and frequent polling finds the newest keys.
318
+ google.protobuf.Empty never = 1 ;
319
+
320
+ // If a key is not in the cache, fetch the most recent keys from the IdP and update the cache.
321
+ // NOTE: This should only be done in trusted environments, since missing keys will each trigger
322
+ // a request to the IdP. Using this in an environment exposed to the internet will allow malicious agents to
323
+ // execute a DDoS attack by spamming protected endpoints with tokens signed by invalid keys.
324
+ google.protobuf.Empty always = 2 ;
325
+
326
+ // If a key is not in the cache, fetch the most recent keys from the IdP and update the cache.
327
+ // This value sets the number of requests to the IdP per polling interval. If that limit is exceeded,
328
+ // we will stop fetching from the IdP for the remainder of the polling interval.
329
+ uint32 max_idp_req_per_polling_interval = 3 ;
330
+ }
331
+ }
332
+
304
333
message OidcAuthorizationCode {
305
334
// your client id as registered with the issuer
306
335
string client_id = 1 ;
@@ -341,6 +370,12 @@ message OidcAuthorizationCode {
341
370
// If not specified, the default value is 30 minutes.
342
371
google.protobuf.Duration discovery_poll_interval = 12 ;
343
372
373
+ // If a user executes a request with a key that is not found in the JWKS, it could be
374
+ // that the keys have rotated on the remote source, and not yet in the local cache.
375
+ // This policy lets you define the behavior for how to refresh the local cache during a request
376
+ // where an invalid key is provided
377
+ JwksOnDemandCacheRefreshPolicy jwks_cache_refresh_policy = 13 ;
378
+
344
379
// in the future we may implement this:
345
380
// add optional configuration for validation of the access token received during the OIDC flow
346
381
// AccessTokenValidation access_token_validation = 8;
@@ -545,6 +580,12 @@ message ExtAuthConfig {
545
580
// If not specified, the default value is 30 minutes.
546
581
google.protobuf.Duration discovery_poll_interval = 12 ;
547
582
583
+ // If a user executes a request with a key that is not found in the JWKS, it could be
584
+ // that the keys have rotated on the remote source, and not yet in the local cache.
585
+ // This policy lets you define the behavior for how to refresh the local cache during a request
586
+ // where an invalid key is provided
587
+ JwksOnDemandCacheRefreshPolicy jwks_cache_refresh_policy = 13 ;
588
+
548
589
// in the future we may implement this:
549
590
// add optional configuration for validation of the access token received during the OIDC flow
550
591
// AccessTokenValidation access_token_validation = 8;
0 commit comments