File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 #name : ' JOSEHeader' ,
66 #superclass : ' Object' ,
77 #instVars : [
8- ' properties'
8+ ' properties' ,
9+ ' strict'
910 ],
1011 #category : ' JSONWebToken-Core-Headers' ,
1112 #package : ' JSONWebToken-Core' ,
@@ -27,15 +28,30 @@ JOSEHeader >> = aHeader [
2728]
2829
2930{ #category : ' accessing' }
30- JOSEHeader >> at: aKey [
31- ^ properties at: aKey
31+ JOSEHeader >> at: aString [
32+
33+ ^ strict
34+ ifTrue: [ properties at: aString ]
35+ ifFalse: [ properties at: aString ifAbsent: nil ]
3236]
3337
3438{ #category : ' accessing' }
3539JOSEHeader >> at: aKey put: aValue [
3640 properties at: aKey put: aValue
3741]
3842
43+ { #category : ' initialization' }
44+ JOSEHeader >> beLenient [
45+
46+ strict := false
47+ ]
48+
49+ { #category : ' initialization' }
50+ JOSEHeader >> beStrict [
51+
52+ strict := true
53+ ]
54+
3955{ #category : ' testing' }
4056JOSEHeader >> hasSameElements: aDictionary [
4157 ^ (properties difference: aDictionary) isEmpty
@@ -46,6 +62,12 @@ JOSEHeader >> hash [
4662 ^ properties hash
4763]
4864
65+ { #category : ' initialization' }
66+ JOSEHeader >> initialize [
67+ super initialize.
68+ strict := true
69+ ]
70+
4971{ #category : ' accessing' }
5072JOSEHeader >> kid [
5173" Public Key ID"
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ JWTClaimsSet >> at: aString [
3232
3333 ^ strict
3434 ifTrue: [ claims at: aString ]
35- ifFalse: [ claims at: aString ifAbsent: [ ] ]
35+ ifFalse: [ claims at: aString ifAbsent: nil ]
3636]
3737
3838{ #category : ' accessing - basic' }
You can’t perform that action at this time.
0 commit comments