Skip to content

Commit

Permalink
copied source from smalltalkhub. Converted the ConfigurationOf to a B…
Browse files Browse the repository at this point in the history
…aselineOf
  • Loading branch information
noha committed Nov 22, 2017
1 parent f4342cf commit 3bbe10e
Show file tree
Hide file tree
Showing 136 changed files with 535 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/BaselineOfJSONWebToken.package/.filetree
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
baselines
baseline: spec
<baseline>

spec for: #'common' do: [
spec project: 'NeoJSON' with: [
spec
className: #ConfigurationOfNeoJSON;
versionString: '13';
repository: 'http://mc.stfx.eu/Neo' ].
spec
package: #'JSONWebToken-Core';
package: 'JSONWebToken-Tests' with: [
spec requires: #(#'JSONWebToken-Core' ). ]. ].
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "BaselineOf",
"category" : "BaselineOfJSONWebToken",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "BaselineOfJSONWebToken",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SystemOrganization addCategory: #BaselineOfJSONWebToken!
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(name 'BaselineOfJSONWebToken')
1 change: 1 addition & 0 deletions source/BaselineOfJSONWebToken.package/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ }
5 changes: 5 additions & 0 deletions source/JSONWebToken-Core.package/.filetree
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"separateMethodMetaAndSource" : false,
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
as yet unclassified
neoJsonMapping: mapper
mapper for: self do: [ :mapping |
mapping
mapInstVar: #type to: #typ;
mapInstVar: #algorithm to: #alg ]

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
= aHeader
^ aHeader hasSameElements: properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
hasSameElements: aDictionary
^ (properties difference: aDictionary) isEmpty
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
hash
^ properties hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
typ: aString
self type: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
typ
^ self type
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
type: anObject
properties at: 'typ' put: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
type
^ properties at: 'typ'
13 changes: 13 additions & 0 deletions source/JSONWebToken-Core.package/JOSEHeader.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"commentStamp" : "",
"super" : "Object",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"properties"
],
"name" : "JOSEHeader",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
parameterValue
^ 'HS256'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sign
signMessage: aString withKey: anObject
^ ((HMAC on: SHA256)
key: anObject asByteArray;
digestMessage: aString asByteArray)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "JsonWebAlgorithm",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "JWAHMACSHA256",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
parameterValue
^ 'none'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
signing
signMessage: aString withKey: aKeyString
^ ''
11 changes: 11 additions & 0 deletions source/JSONWebToken-Core.package/JWANone.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "JsonWebAlgorithm",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "JWANone",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
alg: anObject
properties at: 'alg' put: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
alg
^ properties at: 'alg'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
algorithm: anObject
algorithm := anObject.
self alg: anObject parameterValue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
algorithm
^ algorithm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
converting
asJson
^ NeoJSONWriter toString: (properties copy at: 'alg' put: algorithm parameterValue; yourself)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
contentType: aString
properties at: 'typ' put: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialization
initialize
super initialize.
properties := SmallDictionary new
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
registeredHeaders
^ #( typ cty )
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
accessing
setProperties: aDictionary
properties := aDictionary.
(properties includesKey: 'alg') ifTrue: [
algorithm := JsonWebAlgorithm named: (properties at: 'alg') ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"commentStamp" : "",
"super" : "JOSEHeader",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"algorithm"
],
"name" : "JWCryptoHeader",
"type" : "normal"
}
Empty file.
11 changes: 11 additions & 0 deletions source/JSONWebToken-Core.package/JWEHeader.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "JWCryptoHeader",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "JWEHeader",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
reading
materialize: aString
| parts jws |
parts := $. split: aString.
jws := JWSHeader fromJson: (parts at: 1) base64Decoded.
self halt.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
reading
materialize: aString key: aKeyString
| parts header jws |
parts := $. split: aString.
header := JWSHeader fromJson: (parts at: 1) base64Decoded.
jws := JsonWebSignature new
key: aKeyString;
setProtectedHeader: header.
((jws signatureFor: ($. join: { parts first . parts second })) = parts third base64Decoded asByteArray) ifFalse: [
Error signal: 'signature does not match' ].
^ jws payload: (JWTClaimsSet fromJson: parts second base64Decoded)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
as yet unclassified
serialize: aWebSignature
| signature |
aWebSignature writeProtectedHeaderOn: self.
stream nextPut: $. .
aWebSignature writePayloadOn: self.

signature := aWebSignature signatureFor: stream contents.
stream
nextPut: $.;
nextPutAll: signature base64Encoded.
^ stream contents
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
writeHeader: aHeader
stream nextPutAll: aHeader asJson base64Encoded
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
writing
writePayload: anObject
stream nextPutAll: anObject asJson base64Encoded
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "JWSSerializer",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "JWSCompactSerializer",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
instance-creation
fromJson: aString
^ self new
setProperties: (NeoJSONReader fromString: aString)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
testing
isEqualTo: aHeader
^ aHeader hasSameElements: properties
11 changes: 11 additions & 0 deletions source/JSONWebToken-Core.package/JWSHeader.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"commentStamp" : "",
"super" : "JWCryptoHeader",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "JWSHeader",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
toJson: anObject
^ NeoJSONWriter toString: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
initialize
super initialize.
stream := String new writeStream.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"commentStamp" : "",
"super" : "Object",
"category" : "JSONWebToken-Core-JSONWebToken-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"stream"
],
"name" : "JWSSerializer",
"type" : "normal"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
fromJson: aString
^ self new
setClaims: (NeoJSONReader fromString: aString)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
converting
asJson
^ NeoJSONWriter toString: claims
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
at: aString
^ claims at: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
at: aString put: anObject
claims at: aString put: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
aud: aString
self at: 'aud' put: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
aud
^ self at: 'aud'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
audiences: anObject
self aud: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
audiences
^ self aud
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
authTime: anObject
self at: 'auth_time' put: anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
authTime
^ self at: 'auth_time'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
authenticationContextClassReference: anObject
self at: 'acr' put: anObject
Loading

0 comments on commit 3bbe10e

Please sign in to comment.