Skip to content

Commit bc584c0

Browse files
committed
Merge branch 'development'
2 parents 0bfdd52 + a1534b0 commit bc584c0

24 files changed

Lines changed: 114 additions & 45 deletions

File tree

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
env:
4+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5+
6+
# Controls when the action will run. Triggers the workflow on push or pull request
7+
# events but only for the development branch
8+
on:
9+
pull_request:
10+
types: [assigned, opened, synchronize, reopened]
11+
12+
push:
13+
branches:
14+
- development
15+
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: hpi-swa/setup-smalltalkCI@v1
23+
id: smalltalkci
24+
with:
25+
smalltalk-version: Pharo64-9.0
26+
- run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-version }}
27+
shell: bash
28+
timeout-minutes: 15

.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

source/BaselineOfJSONWebToken.package/BaselineOfJSONWebToken.class/instance/baseline..st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ baseline: spec
88
with: [ spec repository: 'github://svenvc/NeoJSON:master/repository' ].
99
spec
1010
baseline: 'OpenSSL'
11-
with: [ spec repository: 'github://PierceNg/OpenSSL-Pharo/src-st' ].
11+
with: [ spec repository: 'github://PierceNg/OpenSSL-Pharo:openssl_1_1_pharo9/src-st' ].
1212
spec
1313
package: #'JSONWebToken-Core'
1414
with: [ spec requires: #('NeoJSON') ];
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
as yet unclassified
2+
simpleJsonWebSignature
3+
^ JsonWebSignature new
4+
algorithmName: 'HS256';
5+
payload: (JWTClaimsSet new
6+
at: 'bar' put: 'foo');
7+
key: 'foobar'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
as yet unclassified
2+
simpleTokenString
3+
^ self simpleJsonWebSignature compactSerialized.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tests
2+
testDecodingThreeParts
3+
| tokenString invalid |
4+
tokenString := self simpleTokenString.
5+
invalid := $. join: ($. split: tokenString) allButLast.
6+
self
7+
should: [ JsonWebSignature materializeCompact: invalid key: 'foobar' ]
8+
raise: JWSInvalidTokenFormat.

source/JSONWebToken-Core.package/JWAHMACSHA256.class/class/checkSignature.withKey..st renamed to source/JSONWebToken-Core.package/JWAHMACSHA256.class/class/checkSignatureOfParts.withKey..st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sign
2-
checkSignature: parts withKey: key
2+
checkSignatureOfParts: parts withKey: key
33
(self
44
signMessage:
55
($.

source/JSONWebToken-Core.package/JWANone.class/class/checkSignature.withKey..st

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sign
2+
checkSignatureOfParts: parts withKey: key
3+

source/JSONWebToken-Core.package/JWSCompactSerializer.class/instance/materialize.key.checkSignature..st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ materialize: aString key: aKeyString checkSignature: checkSignature
44
| parts header jws |
55

66
parts := $. split: aString.
7-
header := JWSHeader fromJson: ( self base64Decoded: parts first ) asString.
7+
(parts size = 3) ifFalse: [ JWSInvalidTokenFormat signal: 'the format of the token is invalid' ].
8+
header := JWSHeader fromJson: ( self class base64UrlDecoded: parts first ) utf8Decoded.
89
jws := JsonWebSignature new
910
key: aKeyString;
1011
setProtectedHeader: header.
1112
checkSignature
1213
ifTrue: [ jws checkSignature: parts ].
13-
^ jws payload: ( JWTClaimsSet fromJson: ( self base64Decoded: parts second ) asString )
14+
^ jws payload: ( JWTClaimsSet fromJson: ( self class base64UrlDecoded: parts second ) utf8Decoded )

0 commit comments

Comments
 (0)