Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions source/JSONWebToken-Core/JOSEHeader.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ JOSEHeader >> = aHeader [
^ aHeader hasSameElements: properties
]

{ #category : 'accessing' }
JOSEHeader >> at: aKey [
^ properties at: aKey
]

{ #category : 'accessing' }
JOSEHeader >> at: aKey put: aValue [
properties at: aKey put: aValue
]

{ #category : 'testing' }
JOSEHeader >> hasSameElements: aDictionary [
^ (properties difference: aDictionary) isEmpty
Expand All @@ -36,6 +46,17 @@ JOSEHeader >> hash [
^ properties hash
]

{ #category : 'accessing' }
JOSEHeader >> kid [
"Public Key ID"
^ properties at: 'kid'
]

{ #category : 'accessing' }
JOSEHeader >> kid: anObject [
properties at: 'kid' put: anObject
]

{ #category : 'accessing' }
JOSEHeader >> typ [
^ self type
Expand Down
43 changes: 43 additions & 0 deletions source/JSONWebToken-Core/JWTClaimsSet.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"
A set of specific claims

The registered claim names are: iss, sub, aud, exp, nbf, iat, jti
None of the claims defined are intended to be mandatory to use or implement in all cases, but rather they provide a starting point for a set of useful, interoperable claims.
"
Class {
#name : 'JWTClaimsSet',
Expand Down Expand Up @@ -191,11 +194,41 @@ JWTClaimsSet >> issuer: anObject [
self iss: anObject
]

{ #category : 'accessing' }
JWTClaimsSet >> jti [
^ self at: 'jti'
]

{ #category : 'accessing' }
JWTClaimsSet >> jti: aString [
self at: 'jti' put: aString
]

{ #category : 'accessing' }
JWTClaimsSet >> jwtId [
^ self jti
]

{ #category : 'accessing' }
JWTClaimsSet >> jwtId: aString [
self jti: aString
]

{ #category : 'accessing' }
JWTClaimsSet >> mimeType [
^ 'JWT'
]

{ #category : 'accessing' }
JWTClaimsSet >> nbf [
^ self at: 'nbf'
]

{ #category : 'accessing' }
JWTClaimsSet >> nbf: aString [
self at: 'nbf' put: aString
]

{ #category : 'accessing' }
JWTClaimsSet >> nonce [
^ self at: 'nonce'
Expand All @@ -206,6 +239,16 @@ JWTClaimsSet >> nonce: anObject [
self at: 'nonce' put: anObject
]

{ #category : 'accessing' }
JWTClaimsSet >> notBefore [
^ self nbf
]

{ #category : 'accessing' }
JWTClaimsSet >> notBefore: aString [
self nbf: aString
]

{ #category : 'accessing' }
JWTClaimsSet >> setClaims: aCollection [
claims := aCollection
Expand Down