This PR preserves all the existing APIs while adding sub support.
In Token and TokenStore, sub is added as an additional parameter in most functions.
In Client, since we need to accommodate iat, I introduced opts, which can be used for either, or both iat and sub. The API signature jwt(scope, iat) is preserved, however I recommend deprecate them in favor of jwt(scope, iat: iat). This also leaves room for potential other optional fields in the future.
This PR preserves all the existing APIs while adding
sub
support.In
Token
andTokenStore
,sub
is added as an additional parameter in most functions.In
Client
, since we need to accommodateiat
, I introducedopts
, which can be used for either, or bothiat
andsub
. The API signaturejwt(scope, iat)
is preserved, however I recommend deprecate them in favor ofjwt(scope, iat: iat)
. This also leaves room for potential other optional fields in the future.Also wrote tests and docs for it.
Fix #29.