Enable specifying allowed offset when verifying athenz role token #3187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
We are using Athenz for client authentication. Occasionally, the following error occurs and client authentication fails.
This means that the timestamp included in the authentication token is more future than the server time. Since the difference between them is only 1 second, I think that the time of either server or client is slightly off.
This error can be avoided by increasing the value of
allowed offset
. Currently, this value is set to 0 in Pulsar, but the default value in Athenz ZMS seems to be 300 seconds.https://github.com/yahoo/athenz/blob/93fe62c17f3ab4556c71c5136c1646df4a874a5f/servers/zms/conf/zms.properties#L277-L280
Modifications
allowed offset
from 0 to 30 (I think 300 seconds is too long)allowed offset
using system propertyResult
Even if the time of the server or client is slightly off, the authentication will succeed.