Enhance README.md with Go import examples and clarify usage - #35
Conversation
… re-validation process
WalkthroughDocumentation-only changes: root README Usage removed and external OAuth link added; jwt README reorganized (Go import guidance, validation behavior notes, features); added Go Imports sections to oauth2 authorization_code and client_credentials READMEs. No code or public API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
oauth2/client_credentials/README.md (1)
9-17: Imports section reads well; small consistency tweak.Consider noting “jwt is only needed if WithTokenValidation(...) is used” (mirrors comments used elsewhere). Optional: show
WithScopes("read:users")later in “Basic Usage” to avoid a zero-arg call in the first snippet.jwt/README.md (1)
46-49: Nice clarification on validation caching; add one cautionary sentence.Suggest appending: “Change validation options by re-parsing the token; mutating options after parsing has no effect on an existing token.”
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md(0 hunks)jwt/README.md(2 hunks)oauth2/authorization_code/README.md(1 hunks)oauth2/client_credentials/README.md(1 hunks)
💤 Files with no reviewable changes (1)
- README.md
🔇 Additional comments (2)
oauth2/authorization_code/README.md (1)
9-16: Good addition: explicit import guidance.The required/optional split is clear and aligns with the examples below.
jwt/README.md (1)
13-19: Import block LGTM.Matches package path used throughout and reduces confusion vs. go get instructions.
…ing structure, security, and use cases.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
jwt/README.md (3)
5-18: Nice addition; add standards references for completeness.Consider adding RFC links to anchor the guidance in specs.
This guide covers: ... - JWT benefits compared to other token types + - Standards: RFC 7519 (JWT) and RFC 7517 (JWKS)
27-33: Import alias tip to avoid jwt name collision with golang-jwt/jwt.Many users will import github.com/golang-jwt/jwt/v5 as well. Suggest showing an alias to avoid clashing identifiers.
## Go Imports ```go -import ( - "github.com/kinde-oss/kinde-go/jwt" // required -) +import ( + "github.com/kinde-oss/kinde-go/jwt" // required + // If you also import github.com/golang-jwt/jwt/v5, consider aliasing one of them to avoid name collisions: + // kindejwt "github.com/kinde-oss/kinde-go/jwt" + // golangjwt "github.com/golang-jwt/jwt/v5" +)Also consider a one-line note below the block: “If you use github.com/golang-jwt/jwt/v5 in the same file, alias one of the imports (e.g., kindejwt or golangjwt) to avoid identifier conflicts.” --- `60-63`: **Clarify caching semantics vs. time-based validity and confirm OAuth2 re-validation** - Token validation (signature, exp/nbf, audience, algorithm) runs once in ParseOAuth2Token; Token.IsValid() and GetSubject/GetIssuer/etc. read cached results and do not re-check exp/nbf on each call—long-lived Token objects must be re-parsed or refreshed to catch expiration. - ClientCredentials and AuthorizationCode flows invoke ParseOAuth2Token on every TokenSource retrieval, ensuring a fresh parse & re-validation each time you call GetToken or use the OAuth2 client. </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 89b60b03695cd37035c8cfb0ec9e1c257ee4eb60 and 4b5df74c39848b48164614765209c0fa37509e64. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `README.md` (1 hunks) * `jwt/README.md` (3 hunks) </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary> * README.md </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Add Go import examples for the client_credentials, authorization_code, and jwt packages. Remove outdated usage instructions to streamline documentation and clarify token validation behavior in the OAuth2 flow.