Skip to content

Commit ce52acb

Browse files
authored
Add spellcheck Github action to catch common spelling mistakes (#458)
1 parent e9547a1 commit ce52acb

File tree

4 files changed

+48
-2
lines changed

4 files changed

+48
-2
lines changed

.github/spell-check.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[default]
2+
extend-ignore-re = [
3+
# Ignore JWT/JWE tokens
4+
"\\beyJ[\\dA-Za-z=_-]+(?:\\.[\\dA-Za-z=_-]{3,}){1,4}",
5+
]
6+
7+
[default.extend-identifiers]
8+
# Common registered claim abbreviations
9+
alg = "alg"
10+
typ = "typ"
11+
iss = "iss"
12+
sub = "sub"
13+
aud = "aud"
14+
exp = "exp"
15+
nbf = "nbf"
16+
iat = "iat"
17+
jti = "jti"
18+
cty = "cty"
19+
20+
# Custom exceptions (i.e. Github Usernames, proper nouns etc)
21+
thaJeztah = "thaJeztah"

.github/workflows/spell-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: spelling
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
12+
env:
13+
CLICOLOR: 1
14+
15+
jobs:
16+
spelling:
17+
name: Spell Check with Typos
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout Actions Repository
21+
uses: actions/checkout@v4
22+
- name: Spell Check Repo
23+
uses: crate-ci/[email protected]
24+
with:
25+
config: ./.github/spell-check.toml

VERSION_HISTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Backwards compatible API change that was missed in 2.0.0.
9797

9898
There were two major reasons for breaking backwards compatibility with this update. The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations. There will likely be no required code changes to support this change.
9999

100-
The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`.
100+
The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods. Not all keys used for all signing methods have a single standard on-disk representation. Requiring `[]byte` as the type for all keys proved too limiting. Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys. Backwards compatibility has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`.
101101

102102
It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`.
103103

parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func splitToken(token string) ([]string, bool) {
216216
parts[1] = claims
217217
// One more cut to ensure the signature is the last part of the token and there are no more
218218
// delimiters. This avoids an issue where malicious input could contain additional delimiters
219-
// causing unecessary overhead parsing tokens.
219+
// causing unnecessary overhead parsing tokens.
220220
signature, _, unexpected := strings.Cut(remain, tokenDelimiter)
221221
if unexpected {
222222
return nil, false

0 commit comments

Comments
 (0)