Interface JwtAccessKeyCollector
-
public interface JwtAccessKeyCollectorCollects
JwtAccessKeyinstances for JWT validation.It is expected that the
JwtAccessKeyinstances (and their correspondingJwtValidateKeyinstances) are rotated. This minimises the impact of "leaked" keys (for whatever reason) from creating security problems.Furthermore, in a clustered environment, co-ordinating the creation of
JwtAccessKeyinstances can become complicated. It is, therefore, possible to have multipleJwtAccessKeyinstances in play, with the example following algorithm:- A collect of keys is triggered for a particular instance in the cluster
- The instance retrieves all
JwtAccessKeyinstances from a central store, and identifies a newJwtAccessKeyis required. - The instance creates the
JwtAccessKeyand stores it in the central store. - Note: the active window for the
JwtAccessKeyshould be in the future. It should only be active after a time that all instances in the cluster will have collected the newJwtAccessKey(and correspondingJwtValidateKeyinstances). - The instance then includes the
JwtAccessKeyin its encoding - Other instances in the cluster trigger a collect, and pull in the created
JwtAccessKeyfrom the central store. - Should two instances in the cluster create a
JwtAccessKeysimultaneously, then bothJwtAccessKeyinstances can be arbitrarily used. This is ok as all instances should load both correspondingJwtValidateKeyinstances.- Note: this does come with the cost of extra computation on the consumers
to validate the JWT instances. However, this algorithm also works if the
cluster is co-ordinated to only create the one
JwtAccessKeyper time period (reducing this computation).
- Note: this does come with the cost of extra computation on the consumers
to validate the JWT instances. However, this algorithm also works if the
cluster is co-ordinated to only create the one
- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsetKeys(JwtAccessKey[] keys)Specifies theJwtAccessKeyinstances.
-
-
-
Method Detail
-
setKeys
void setKeys(JwtAccessKey[] keys)
Specifies theJwtAccessKeyinstances.- Parameters:
keys-JwtAccessKeyinstances.
-
-