diff --git a/Changes-v2.md b/Changes-v2.md index 1395c39a6..084da3955 100644 --- a/Changes-v2.md +++ b/Changes-v2.md @@ -38,7 +38,7 @@ key, err := jwk.FromRaw(rawKey) // Algorithm() now returns jwa.KeyAlgorithm type. `jws.Sign()` // and other function that receive JWK algorithm names accept // this new type, so you can use the same key and do the following -// (previosly you needed to type assert) +// (previously you needed to type assert) jws.Sign(payload, jws.WithKey(key.Algorithm(), key)) // If you need the specific type, type assert diff --git a/docs/04-jwk.md b/docs/04-jwk.md index 3d3098151..0167df1ca 100644 --- a/docs/04-jwk.md +++ b/docs/04-jwk.md @@ -889,7 +889,7 @@ The [`jwk.Set()`](https://pkg.go.dev/github.com/lestrrat-go/jwx/v2/jwk#Set) meth [`jwk.Set()`](https://pkg.go.dev/github.com/lestrrat-go/jwx/v2/jwk#Set) may not alter the Key Type (`kty`) field of a key. -the `jwk` package defines field key names for predefined keys as constants so you won't ever have to bang your head againt the wall after finding out that you have a typo. +the `jwk` package defines field key names for predefined keys as constants so you won't ever have to bang your head against the wall after finding out that you have a typo. ```go key.Set(jwk.KeyIDKey, `my-awesome-key`) diff --git a/docs/99-faq.md b/docs/99-faq.md index d77fd2c7f..fb479b848 100644 --- a/docs/99-faq.md +++ b/docs/99-faq.md @@ -70,7 +70,7 @@ So, for example, a service like Google will sign their JWTs using their private Often times we have people asking us about github.com/lestrrat-go/jwx/v2/jwt not being able to parse a token... except, they are not JWTs. -For example, when a provider says they will give you an "access token" ... well, it *may* be a JWT, but often times they are just some sort of string key (which will definitely parse if you pass it to `jwt.Parse`). Sometimes what you really want is stored in a different token, and it may be called an "ID token". Who knows, these things vary between implementation to implemention. +For example, when a provider says they will give you an "access token" ... well, it *may* be a JWT, but often times they are just some sort of string key (which will definitely parse if you pass it to `jwt.Parse`). Sometimes what you really want is stored in a different token, and it may be called an "ID token". Who knows, these things vary between implementation to implementation. After all, the only thing we can say is that you should check that you are parsing. diff --git a/jwk/cache.go b/jwk/cache.go index 5d5b6b90b..45266cf5c 100644 --- a/jwk/cache.go +++ b/jwk/cache.go @@ -95,7 +95,7 @@ type PostFetcher interface { PostFetch(string, Set) (Set, error) } -// PostFetchFunc is a PostFetcher based on a functon. +// PostFetchFunc is a PostFetcher based on a function. type PostFetchFunc func(string, Set) (Set, error) func (f PostFetchFunc) PostFetch(u string, set Set) (Set, error) { @@ -217,7 +217,7 @@ func (c *Cache) Register(u string, options ...RegisterOption) error { } } - // Set the transfomer at the end so that nobody can override it + // Set the transformer at the end so that nobody can override it hrropts = append(hrropts, httprc.WithTransformer(t)) return c.cache.Register(u, hrropts...) } diff --git a/jwk/options.yaml b/jwk/options.yaml index 6dfbded42..695f6e5f7 100644 --- a/jwk/options.yaml +++ b/jwk/options.yaml @@ -29,7 +29,7 @@ interfaces: ReadFileOption is a type of `Option` that can be passed to `jwk.ReadFile` - name: RegisterOption comment: | - RegisterOption desribes options that can be passed to `(jwk.Cache).Register()` + RegisterOption describes options that can be passed to `(jwk.Cache).Register()` options: - ident: HTTPClient interface: FetchOption diff --git a/jwk/options_gen.go b/jwk/options_gen.go index 2aac86fc6..13b9f05e3 100644 --- a/jwk/options_gen.go +++ b/jwk/options_gen.go @@ -89,7 +89,7 @@ type readFileOption struct { func (*readFileOption) readFileOption() {} -// RegisterOption desribes options that can be passed to `(jwk.Cache).Register()` +// RegisterOption describes options that can be passed to `(jwk.Cache).Register()` type RegisterOption interface { Option registerOption() diff --git a/jwk/refresh_test.go b/jwk/refresh_test.go index f6c56273c..101bf9bdb 100644 --- a/jwk/refresh_test.go +++ b/jwk/refresh_test.go @@ -469,10 +469,10 @@ func TestErrorSink(t *testing.T) { // timing issues can cause this to be non-deterministic... // we'll say it's okay as long as we're in +/- 1 range l := errSink.Len() - if !assert.True(t, l <= 7, "number of errors shold be less than or equal to 7 (%d)", l) { + if !assert.True(t, l <= 7, "number of errors should be less than or equal to 7 (%d)", l) { return } - if !assert.True(t, l >= 5, "number of errors shold be greather than or equal to 5 (%d)", l) { + if !assert.True(t, l >= 5, "number of errors should be greater than or equal to 5 (%d)", l) { return } }) diff --git a/jwk/whitelist.go b/jwk/whitelist.go index 6b0180d30..9b144dc4e 100644 --- a/jwk/whitelist.go +++ b/jwk/whitelist.go @@ -28,7 +28,7 @@ func (w *RegexpWhitelist) Add(pat *regexp.Regexp) *RegexpWhitelist { return w } -// IsAlloed returns true if any of the patterns in the whitelist +// IsAllowed returns true if any of the patterns in the whitelist // returns true. func (w *RegexpWhitelist) IsAllowed(u string) bool { for _, pat := range w.patterns { diff --git a/jws/jws_test.go b/jws/jws_test.go index ecf54085c..b39ff34d6 100644 --- a/jws/jws_test.go +++ b/jws/jws_test.go @@ -354,7 +354,7 @@ func TestSignMulti2(t *testing.T) { require.NoError(t, err, "Verify succeeded") require.Equal(t, payload, verified, "verified payload matches") - // XXX This actally doesn't really test much, but if there was anything + // XXX This actually doesn't really test much, but if there was anything // wrong, the process should have failed well before reaching here require.Equal(t, payload, m.Payload(), "message payload matches") }) @@ -1453,7 +1453,7 @@ func TestJKU(t *testing.T) { return } require.Equal(t, payload, decoded, `decoded payload should match`) - // XXX This actally doesn't really test much, but if there was anything + // XXX This actually doesn't really test much, but if there was anything // wrong, the process should have failed well before reaching here require.Equal(t, payload, m.Payload(), "message payload matches") } diff --git a/jwt/options.yaml b/jwt/options.yaml index 7b2241031..0abb712a2 100644 --- a/jwt/options.yaml +++ b/jwt/options.yaml @@ -51,7 +51,7 @@ options: interface: ValidateOption argument_type: time.Duration comment: | - WithTruncation speficies the amount that should be used when + WithTruncation specifies the amount that should be used when truncating time values used during time-based validation routines. By default time values are truncated down to second accuracy. If you want to use sub-second accuracy, you will need to set @@ -199,14 +199,14 @@ options: argument_type: jwe.EncryptOption comment: | WithEncryptOption provides an escape hatch for cases where extra options to - `(jws.Serializer).Encrypt()` must be specified when usng `jwt.Sign()`. Normally you do not + `(jws.Serializer).Encrypt()` must be specified when using `jwt.Sign()`. Normally you do not need to use this. - ident: SignOption interface: SignOption argument_type: jws.SignOption comment: | WithSignOption provides an escape hatch for cases where extra options to - `jws.Sign()` must be specified when usng `jwt.Sign()`. Normally you do not + `jws.Sign()` must be specified when using `jwt.Sign()`. Normally you do not need to use this. - ident: Validator interface: ValidateOption diff --git a/jwt/options_gen.go b/jwt/options_gen.go index 9a545f866..e1eab7057 100644 --- a/jwt/options_gen.go +++ b/jwt/options_gen.go @@ -290,7 +290,7 @@ func WithCookieKey(v string) ParseOption { } // WithEncryptOption provides an escape hatch for cases where extra options to -// `(jws.Serializer).Encrypt()` must be specified when usng `jwt.Sign()`. Normally you do not +// `(jws.Serializer).Encrypt()` must be specified when using `jwt.Sign()`. Normally you do not // need to use this. func WithEncryptOption(v jwe.EncryptOption) EncryptOption { return &encryptOption{option.New(identEncryptOption{}, v)} @@ -390,7 +390,7 @@ func WithResetValidators(v bool) ValidateOption { } // WithSignOption provides an escape hatch for cases where extra options to -// `jws.Sign()` must be specified when usng `jwt.Sign()`. Normally you do not +// `jws.Sign()` must be specified when using `jwt.Sign()`. Normally you do not // need to use this. func WithSignOption(v jws.SignOption) SignOption { return &signOption{option.New(identSignOption{}, v)} @@ -402,7 +402,7 @@ func WithToken(v Token) ParseOption { return &parseOption{option.New(identToken{}, v)} } -// WithTruncation speficies the amount that should be used when +// WithTruncation specifies the amount that should be used when // truncating time values used during time-based validation routines. // By default time values are truncated down to second accuracy. // If you want to use sub-second accuracy, you will need to set