jose-jwt icon indicating copy to clipboard operation
jose-jwt copied to clipboard

JweAlgorithm.DIR should be JweAlgorithm.dir - casing issue

Open C-Sharp-Coder opened this issue 7 years ago • 4 comments

or change JweAlgorithms[JweAlgorithm.DIR] = "dir" to JweAlgorithms[JweAlgorithm.DIR] = "DIR"

C-Sharp-Coder avatar Apr 28 '17 23:04 C-Sharp-Coder

Hi @C-Sharp-Coder , It correctly set to dir (lowercase) according to RFC: https://tools.ietf.org/html/rfc7518#section-4.5

What the issue are you facing with constant: JweAlgorithm.DIR ?

dvsekhvalnov avatar May 01 '17 10:05 dvsekhvalnov

@C-Sharp-Coder, If you need this mapping only for decoding, #66 should help :)

freeman avatar May 02 '17 13:05 freeman

@dvsekhvalnov , Then should update casing of JweAlgorithm.DIR to JweAlgorithm.dir similar to JwsAlgorithm.none?
I am doing case sensitive comparison of header values. When I try to convert "dir" to JweAlgorithm.DIR it fails because of case.

C-Sharp-Coder avatar May 02 '17 18:05 C-Sharp-Coder

Well, probably it is logical, but given it was JweAlgorithm.DIR for very long time any change here will break existing clients.

Will aliases work you?

Also if you can post some code it can help to better understand what the exact issue you are facing.

dvsekhvalnov avatar May 03 '17 10:05 dvsekhvalnov