Lightning.Workers.RunToken (Lightning v2.19.0-pre)
View SourceJWT token configuration to verify if workers work is legit.
Verify run tokens through Lightning.Workers.verify_run_token/2, never
through verify_and_validate/3 here. Joken looks up a validator per claim
the token carries, so the exp and sub checks below do not run for a
token that simply omits them; verify_run_token/2 is where the claims are
required to be present, and so is the only place those two checks bind.
Summary
Functions
Combines generate_claims/1 and encode_and_sign/2
Same as generate_and_sign/2 but raises if error
Combines verify/2 and validate/2
Same as verify_and_validate/2 but raises if error
Functions
@spec generate_and_sign(Joken.claims(), Joken.signer_arg()) :: {:ok, Joken.bearer_token(), Joken.claims()} | {:error, Joken.error_reason()}
Combines generate_claims/1 and encode_and_sign/2
@spec generate_and_sign!(Joken.claims(), Joken.signer_arg()) :: Joken.bearer_token()
Same as generate_and_sign/2 but raises if error
@spec verify_and_validate(Joken.bearer_token(), Joken.signer_arg(), term()) :: {:ok, Joken.claims()} | {:error, Joken.error_reason()}
Combines verify/2 and validate/2
@spec verify_and_validate!(Joken.bearer_token(), Joken.signer_arg(), term()) :: Joken.claims()
Same as verify_and_validate/2 but raises if error