You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While implementing some configuration validation logic, which accepts a array of Algorithm values to be used with jsonwebtoken, I found that the library does not expose the values in a way that can be used at run-time.
In Typescript, we have the Algorithms type, but there is no actual array against which to validate data received from outside sources. It also does not make sense to have that array in our code where we would need to keep it in sync with the library.
Describe the ideal solution
This can be accomplished fairly easily:
exportconstAlgorithm=['RS256', ...];
The types in "@types/jsonwebtoken" could be easily updated so that Algorithm is a type (as it is now) and also a const array of values.
Alternatives and current work-arounds
Manually keeping the array up-to-date in our software up-to-date with the library.
The text was updated successfully, but these errors were encountered:
Describe the problem you'd like to have solved
While implementing some configuration validation logic, which accepts a array of
Algorithm
values to be used with jsonwebtoken, I found that the library does not expose the values in a way that can be used at run-time.In Typescript, we have the
Algorithms
type, but there is no actual array against which to validate data received from outside sources. It also does not make sense to have that array in our code where we would need to keep it in sync with the library.Describe the ideal solution
This can be accomplished fairly easily:
The types in "@types/jsonwebtoken" could be easily updated so that Algorithm is a type (as it is now) and also a const array of values.
Alternatives and current work-arounds
Manually keeping the array up-to-date in our software up-to-date with the library.
The text was updated successfully, but these errors were encountered: